Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: package l2jban.events;Arena2x2.java
- ===================================================================
- --- package l2jban.events;Arena2x2.java (revision 84)
- +++ package l2jban.events;Arena2x2.java (working copy)
- + package l2jban.events;
- +
- + import java.util.ArrayList;
- + import java.util.HashMap;
- + import java.util.List;
- + import java.util.Map;
- + import java.util.logging.Logger;
- +
- + import net.sf.l2j.commons.concurrent.ThreadPool;
- + import net.sf.l2j.commons.random.Rnd;
- +
- + import net.sf.l2j.Config;
- + import net.sf.l2j.gameserver.model.L2Effect;
- + import net.sf.l2j.gameserver.model.actor.Player;
- + import net.sf.l2j.gameserver.model.actor.Summon;
- + import net.sf.l2j.gameserver.model.actor.instance.Pet;
- + import net.sf.l2j.gameserver.enums.actors.ClassId;
- + import net.sf.l2j.gameserver.enums.ZoneId;
- + import net.sf.l2j.gameserver.network.SystemMessageId;
- + import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
- + import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
- +
- + public class Arena2x2 implements Runnable
- + {
- + protected static final Logger _log = Logger.getLogger(Arena2x2.class.getName());
- +
- + public static List<Pair> registered;
- +
- + int free = Config.ARENA_EVENT_COUNT;
- +
- + Arena[] arenas = new Arena[Config.ARENA_EVENT_COUNT];
- +
- + Map<Integer, String> fights = new HashMap<>(Config.ARENA_EVENT_COUNT);
- +
- + public Arena2x2()
- + {
- + registered = new ArrayList<>();
- +
- + for (int i = 0; i < Config.ARENA_EVENT_COUNT; i++)
- + {
- + int[] coord = Config.ARENA_EVENT_LOCS[i];
- + arenas[i] = new Arena(i, coord[0], coord[1], coord[2]);
- + }
- + }
- +
- + public static Arena2x2 getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + public boolean register(Player player, Player assist)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player || p.getAssist() == player)
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist || p.getAssist() == assist)
- + {
- + player.sendMessage("Tournament: Your partner already registered!");
- + return false;
- + }
- + }
- + return registered.add(new Pair(player, assist));
- + }
- +
- + public boolean isRegistered(Player player)
- + {
- + for (Pair p : registered)
- + if (p.getLeader() == player || p.getAssist() == player)
- + return true;
- + return false;
- + }
- +
- + public Map<Integer, String> getFights()
- + {
- + return fights;
- + }
- +
- + public boolean remove(Player player)
- + {
- + for (Pair p : registered)
- + if (p.getLeader() == player || p.getAssist() == player)
- + {
- + p.removeMessage();
- + registered.remove(p);
- + return true;
- + }
- + return false;
- + }
- +
- + @Override
- + public synchronized void run()
- + {
- + for (;;)
- + if (registered.size() < 2 || free == 0)
- + try
- + {
- + Thread.sleep(Config.ARENA_CALL_INTERVAL * 1000);
- +
- + }
- + catch (InterruptedException localInterruptedException)
- + {
- + }
- + else
- + {
- + List<Pair> opponents = selectOpponents();
- + if (opponents != null && opponents.size() == 2)
- + {
- + Thread T = new Thread(new EvtArenaTask(opponents));
- + T.setDaemon(true);
- + T.start();
- + }
- +
- + try
- + {
- + Thread.sleep(Config.ARENA_CALL_INTERVAL * 1000);
- + }
- + catch (InterruptedException localInterruptedException1)
- + {
- + }
- + }
- + }
- +
- + @SuppressWarnings("null")
- + private List<Pair> selectOpponents()
- + {
- + List<Pair> opponents = new ArrayList<>();
- + Pair pairOne = null;
- + Pair pairTwo = null;
- + int tries = 3;
- + do
- + {
- + int first = 0;
- + int second = 0;
- + if (getRegisteredCount() < 2)
- + return opponents;
- + if (pairOne == null)
- + {
- + first = Rnd.get(getRegisteredCount());
- + pairOne = registered.get(first);
- + if (pairOne.check())
- + {
- + opponents.add(0, pairOne);
- + registered.remove(first);
- + }
- + else
- + {
- + pairOne = null;
- + registered.remove(first);
- + return null;
- + }
- + }
- +
- + if (pairTwo == null)
- + {
- + second = Rnd.get(getRegisteredCount());
- + pairTwo = registered.get(second);
- + if (pairTwo.check())
- + {
- + opponents.add(1, pairTwo);
- + registered.remove(second);
- + }
- + else
- + {
- + pairTwo = null;
- + registered.remove(second);
- + return null;
- + }
- + }
- +
- + if (pairOne != null && pairTwo != null)
- + break;
- + tries--;
- + }
- + while (tries > 0);
- + return opponents;
- + }
- +
- + public int getRegisteredCount()
- + {
- + return registered.size();
- + }
- +
- + private class Pair
- + {
- + Player leader;
- + Player assist;
- +
- + public Pair(Player leader, Player assist)
- + {
- + this.leader = leader;
- + this.assist = assist;
- + }
- +
- + public Player getAssist()
- + {
- + return assist;
- + }
- +
- + public Player getLeader()
- + {
- + return leader;
- + }
- +
- + public boolean check()
- + {
- + if ((leader == null || !leader.isOnline()) && (assist != null || assist.isOnline()))
- + {
- + assist.sendMessage("Tournament: You participation in Event was Canceled.");
- + return false;
- + }
- + if ((assist == null || !assist.isOnline()) && (leader != null || leader.isOnline()))
- + {
- + leader.sendMessage("Tournament: You participation in Event was Canceled.");
- + return false;
- + }
- + return true;
- + }
- +
- + public boolean isDead()
- + {
- +
- +
- + if ((leader == null || leader.isDead() || !leader.isOnline() || !leader.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !assist.isOnline() || !assist.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist.isArenaAttack()))
- + return false;
- + return !leader.isDead() || !assist.isDead();
- +
- + }
- +
- +
- +
- + public boolean isAlive()
- + {
- +
- + if ((leader == null || leader.isDead() || !leader.isOnline() || !leader.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !assist.isOnline() || !assist.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist.isArenaAttack()))
- + return false;
- + return !leader.isDead() || !assist.isDead();
- +
- +
- + }
- +
- + public void teleportTo(int x, int y, int z)
- + {
- + if (leader != null && leader.isOnline())
- + {
- +
- + leader.setCurrentCp(leader.getMaxCp());
- + leader.setCurrentHp(leader.getMaxHp());
- + leader.setCurrentMp(leader.getMaxMp());
- +
- + if (leader.isInObserverMode())
- + {
- + leader.setLastCords(x, y, z);
- + leader.leaveOlympiadObserverMode();
- + }
- + else
- + leader.teleportTo(x, y, z, 0);
- + leader.broadcastUserInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setCurrentCp(assist.getMaxCp());
- + assist.setCurrentHp(assist.getMaxHp());
- + assist.setCurrentMp(assist.getMaxMp());
- +
- +
- + if (assist.isInObserverMode())
- + {
- + assist.setLastCords(x, y + 50, z);
- + assist.leaveOlympiadObserverMode();
- + }
- + else
- + assist.teleportTo(x, y + 50, z, 0);
- + assist.broadcastUserInfo();
- + }
- + }
- +
- + public void EventTitle(String title, String color)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setTitle(title);
- + leader.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setTitle(title);
- + assist.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- + }
- +
- + public void saveTitle()
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader._originalTitleColorTournament = leader.getAppearance().getTitleColor();
- + leader._originalTitleTournament = leader.getTitle();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist._originalTitleColorTournament = assist.getAppearance().getTitleColor();
- + assist._originalTitleTournament = assist.getTitle();
- + }
- + }
- +
- + public void backTitle()
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setTitle(leader._originalTitleTournament);
- + leader.getAppearance().setTitleColor(leader._originalTitleColorTournament);
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setTitle(assist._originalTitleTournament);
- + assist.getAppearance().setTitleColor(assist._originalTitleColorTournament);
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- + }
- +
- + public void rewards()
- + {
- + if (leader != null && leader.isOnline())
- +
- + leader.addItem("Arena_Event", '.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT, leader, true);
- +
- + if (assist != null && assist.isOnline())
- + assist.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT, assist, true);
- +
- + sendPacket("Congratulations, your team won the event!", 5);
- + }
- +
- + public void rewardsLost()
- + {
- + if (leader != null && leader.isOnline())
- + leader.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT, leader, true);
- + if (assist != null && assist.isOnline())
- + assist.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT, assist, true);
- + sendPacket("your team lost the event! =(", 5);
- + }
- +
- + public void setInTournamentEvent(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + leader.setInArenaEvent(val);
- + if (assist != null && assist.isOnline())
- + assist.setInArenaEvent(val);
- + }
- +
- + public void removeMessage()
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.sendMessage("Tournament: Your participation has been removed.");
- + leader.setArenaProtection(false);
- + leader.setArena2x2(false);
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.sendMessage("Tournament: Your participation has been removed.");
- + assist.setArenaProtection(false);
- + leader.setArena2x2(false);
- + }
- + }
- +
- + public void setArenaProtection(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setArenaProtection(val);
- + leader.setArena2x2(val);
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setArenaProtection(val);
- + leader.setArena2x2(val);
- + }
- + }
- +
- + public void revive()
- + {
- + if (leader != null && leader.isOnline() && leader.isDead())
- + leader.doRevive();
- + if (assist != null && assist.isOnline() && assist.isDead())
- + assist.doRevive();
- + }
- +
- + public void setImobilised(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setIsInvul(val);
- + leader.setStopArena(val);
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setIsInvul(val);
- + assist.setStopArena(val);
- + }
- + }
- +
- + public void setArenaAttack(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setArenaAttack(val);
- + leader.broadcastUserInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setArenaAttack(val);
- + assist.broadcastUserInfo();
- + }
- + }
- +
- +
- + public void removePet()
- + {
- + if (leader != null && leader.isOnline())
- + {
- +
- + if (leader.getSummon() != null)
- + {
- + Summon summon = leader.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(leader);
- + }
- + if (leader.getMountType() == 1 || leader.getMountType() == 2)
- + leader.dismount();
- + }
- + if (assist != null && assist.isOnline())
- + {
- +
- + if (assist.getSummon() != null)
- + {
- + Summon summon = assist.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist);
- + }
- + if (assist.getMountType() == 1 || assist.getMountType() == 2)
- + assist.dismount();
- + }
- +
- +
- + }
- +
- +
- + public void removeSkills()
- + {
- + for (L2Effect effect : leader.getAllEffects())
- + if (effect.getSkill().getId() == 406 || effect.getSkill().getId() == 139 || effect.getSkill().getId() == 176 || effect.getSkill().getId() == 420)
- + {
- + leader.stopSkillEffects(effect.getSkill().getId());
- + leader.enableSkill(effect.getSkill());
- + }
- +
- + for (L2Effect effect : assist.getAllEffects())
- + if (effect.getSkill().getId() == 406 || effect.getSkill().getId() == 139 || effect.getSkill().getId() == 176 || effect.getSkill().getId() == 420)
- + {
- + assist.stopSkillEffects(effect.getSkill().getId());
- + assist.enableSkill(effect.getSkill());
- + }
- +
- + if (Config.ARENA_SKILL_PROTECT)
- + if (leader != null && leader.isOnline())
- + {
- + for (L2Effect effect : leader.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + leader.stopSkillEffects(effect.getSkill().getId());
- + if (leader.getMountType() == 2)
- + {
- + leader.sendPacket(SystemMessageId.AREA_CANNOT_BE_ENTERED_WHILE_MOUNTED_WYVERN);
- + leader.enteredNoLanding(5);
- + }
- + }
- +
- + if (Config.ARENA_SKILL_PROTECT)
- + if (assist != null && assist.isOnline())
- + {
- + for (L2Effect effect : assist.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist.stopSkillEffects(effect.getSkill().getId());
- + if (assist.getMountType() == 2)
- + {
- + assist.sendPacket(SystemMessageId.AREA_CANNOT_BE_ENTERED_WHILE_MOUNTED_WYVERN);
- + assist.enteredNoLanding(5);
- + }
- + }
- + }
- +
- + public void sendPacket(String message, int duration)
- + {
- + if (leader != null && leader.isOnline())
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist != null && assist.isOnline())
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + }
- +
- + public void inicarContagem(int duration)
- + {
- + if (leader != null && leader.isOnline())
- + ThreadPool.schedule(new Arena2x2.countdown(leader, duration), 0L);
- + if (assist != null && assist.isOnline())
- + ThreadPool.schedule(new Arena2x2.countdown(assist, duration), 0L);
- + }
- +
- + public void sendPacketinit(String message, int duration)
- + {
- + if (leader != null && leader.isOnline())
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if (assist != null && assist.isOnline())
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if (leader.getClassId() == ClassId.SHILLIEN_ELDER || leader.getClassId() == ClassId.SHILLIEN_SAINT || leader.getClassId() == ClassId.BISHOP || leader.getClassId() == ClassId.CARDINAL || leader.getClassId() == ClassId.ELVEN_ELDER || leader.getClassId() == ClassId.EVAS_SAINT)
- + ThreadPool.schedule(new Runnable()
- + {
- +
- + @Override
- + public void run()
- + {
- + leader.getClient().closeNow();
- + }
- + }, 100L);
- +
- + if (assist.getClassId() == ClassId.SHILLIEN_ELDER || assist.getClassId() == ClassId.SHILLIEN_SAINT || assist.getClassId() == ClassId.BISHOP || assist.getClassId() == ClassId.CARDINAL || assist.getClassId() == ClassId.ELVEN_ELDER || assist.getClassId() == ClassId.EVAS_SAINT)
- + ThreadPool.schedule(new Runnable()
- + {
- +
- + @Override
- + public void run()
- + {
- + assist.getClient().closeNow();
- + }
- + }, 100L);
- + }
- + }
- +
- + private class EvtArenaTask implements Runnable
- + {
- + private final Arena2x2.Pair pairOne;
- + private final Arena2x2.Pair pairTwo;
- + private final int pOneX;
- + private final int pOneY;
- + private final int pOneZ;
- + private final int pTwoX;
- + private final int pTwoY;
- + private final int pTwoZ;
- + private Arena2x2.Arena arena;
- +
- + public EvtArenaTask(List<Pair> opponents)
- + {
- + pairOne = opponents.get(0);
- + pairTwo = opponents.get(1);
- + Player leader = pairOne.getLeader();
- + pOneX = leader.getX();
- + pOneY = leader.getY();
- + pOneZ = leader.getZ();
- + leader = pairTwo.getLeader();
- + pTwoX = leader.getX();
- + pTwoY = leader.getY();
- + pTwoZ = leader.getZ();
- + }
- +
- + @Override
- + public void run()
- + {
- + free -= 1;
- + pairOne.saveTitle();
- + pairTwo.saveTitle();
- + portPairsToArena();
- + pairOne.inicarContagem(Config.ARENA_WAIT_INTERVAL);
- + pairTwo.inicarContagem(Config.ARENA_WAIT_INTERVAL);
- +
- + try
- + {
- + Thread.sleep(Config.ARENA_WAIT_INTERVAL * 1000);
- + }
- + catch (InterruptedException localInterruptedException1)
- + {
- + }
- +
- + pairOne.sendPacketinit("Started. Good Fight!", 3);
- + pairTwo.sendPacketinit("Started. Good Fight!", 3);
- + pairOne.EventTitle(Config.MSG_TEAM1, Config.TITLE_COLOR_TEAM1);
- + pairTwo.EventTitle(Config.MSG_TEAM2, Config.TITLE_COLOR_TEAM2);
- +
- + pairOne.setImobilised(false);
- + pairTwo.setImobilised(false);
- + pairOne.setArenaAttack(true);
- + pairTwo.setArenaAttack(true);
- + while (check())
- + try
- + {
- +
- + Thread.sleep(Config.ARENA_CHECK_INTERVAL);
- + continue;
- + }
- + catch (InterruptedException e)
- + {
- + break;
- + }
- + this.finishDuel();
- + final Arena2x2 this$2 = Arena2x2.this;
- + ++this$2.free;
- +
- +
- + }
- +
- +
- +
- + private void finishDuel()
- + {
- + fights.remove(Integer.valueOf(arena.id));
- + rewardWinner();
- + pairOne.revive();
- + pairTwo.revive();
- + pairOne.teleportTo(pOneX, pOneY, pOneZ);
- + pairTwo.teleportTo(pTwoX, pTwoY, pTwoZ);
- + pairOne.backTitle();
- + pairTwo.backTitle();
- + pairOne.setInTournamentEvent(false);
- + pairTwo.setInTournamentEvent(false);
- + pairOne.setArenaProtection(false);
- + pairTwo.setArenaProtection(false);
- + pairOne.setArenaAttack(false);
- + pairTwo.setArenaAttack(false);
- + arena.setFree(true);
- + }
- +
- + private void rewardWinner()
- + {
- + if (pairOne.isAlive() && !pairTwo.isAlive())
- + {
- + pairOne.rewards();
- + pairTwo.rewardsLost();
- + }
- +
- +
- + else if (pairTwo.isAlive() && !pairOne.isAlive())
- + {
- + pairTwo.rewards();
- + pairOne.rewardsLost();
- + }
- + }
- +
- + private boolean check()
- + {
- + return pairOne.isDead() && pairTwo.isDead();
- + }
- +
- + private void portPairsToArena()
- + {
- + for (Arena2x2.Arena arena : arenas)
- + if (arena.isFree)
- + {
- + this.arena = arena;
- + arena.setFree(false);
- + pairOne.removePet();
- + pairTwo.removePet();
- + pairOne.teleportTo(arena.x - 850, arena.y, arena.z);
- + pairTwo.teleportTo(arena.x + 850, arena.y, arena.z);
- + pairOne.setImobilised(true);
- + pairTwo.setImobilised(true);
- + pairOne.setInTournamentEvent(true);
- + pairTwo.setInTournamentEvent(true);
- + pairOne.removeSkills();
- + pairTwo.removeSkills();
- + fights.put(Integer.valueOf(this.arena.id), pairOne.getLeader().getName() + " vs " + pairTwo.getLeader().getName());
- + Arena2x2.this.fights.put(this.arena.id, this.pairOne.getLeader().getName() + " vs " + this.pairTwo.getLeader().getName());
- + break;
- + }
- + }
- + }
- +
- + private class Arena
- + {
- + protected int x;
- + protected int y;
- + protected int z;
- + protected boolean isFree = true;
- + int id;
- +
- + public Arena(int id, int x, int y, int z)
- + {
- + this.id = id;
- + this.x = x;
- + this.y = y;
- + this.z = z;
- + }
- +
- + public void setFree(boolean val)
- + {
- + isFree = val;
- + }
- + }
- +
- + protected class countdown implements Runnable
- + {
- + private final Player _player;
- + private final int _time;
- +
- + public countdown(Player player, int time)
- + {
- + _time = time;
- + _player = player;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_player.isOnline())
- + {
- +
- + switch (_time)
- + {
- + case 60:
- + case 120:
- + case 180:
- + case 240:
- + case 300:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in " + _time + " second(s)..", 4000));
- + _player.sendMessage(_time + " second(s) to start the battle.");
- + _player.setIsParalyzed(true);
- + }
- + break;
- + case 45:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 1));
- + }
- + break;
- + case 27:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in 30 second(s)..", 4000));
- + _player.sendMessage("30 second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 2));
- + }
- + break;
- + case 20:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- +
- + }
- + break;
- + case 15:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 9));
- + }
- + break;
- + case 10:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 5));
- + break;
- + case 5:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 4:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 3:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 2:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 1:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(false);
- + break;
- + }
- + if (_time > 1)
- + ThreadPool.schedule(new countdown(_player, _time - 1), 1000L);
- + }
- + }
- + }
- +
- +
- +
- + private static class SingletonHolder
- + {
- + protected static final Arena2x2 INSTANCE = new Arena2x2();
- + }
- + }
- +
- Index: package l2jban.events;Arena4x4.java
- ===================================================================
- --- package l2jban.events;Arena4x4.java (revision 84)
- +++ package l2jban.events;Arena4x4.java (working copy)
- + package l2jban.events;
- +
- + import java.util.ArrayList;
- + import java.util.HashMap;
- + import java.util.List;
- + import java.util.Map;
- + import net.sf.l2j.commons.concurrent.ThreadPool;
- + import net.sf.l2j.commons.random.Rnd;
- + import net.sf.l2j.Config;
- + import net.sf.l2j.gameserver.model.L2Effect;
- + import net.sf.l2j.gameserver.model.World;
- + import net.sf.l2j.gameserver.model.actor.Player;
- + import net.sf.l2j.gameserver.model.actor.Summon;
- + import net.sf.l2j.gameserver.model.actor.instance.Pet;
- + import net.sf.l2j.gameserver.enums.actors.ClassId;
- + import net.sf.l2j.gameserver.enums.ZoneId;
- + import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
- + import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
- +
- +
- + public class Arena4x4 implements Runnable
- + {
- + public static List<Pair> registered;
- + int free = Config.ARENA_EVENT_COUNT_4X4;
- +
- + Arena[] arenas = new Arena[Config.ARENA_EVENT_COUNT_4X4];
- +
- + Map<Integer, String> fights = new HashMap<>(Config.ARENA_EVENT_COUNT_4X4);
- +
- + public Arena4x4()
- + {
- + registered = new ArrayList<>();
- +
- + for (int i = 0; i < Config.ARENA_EVENT_COUNT_4X4; i++)
- + {
- + int[] coord = Config.ARENA_EVENT_LOCS_4X4[i];
- + arenas[i] = new Arena(i, coord[0], coord[1], coord[2]);
- + }
- + }
- +
- + public static Arena4x4 getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + public boolean register(Player player, Player assist, Player assist2, Player assist3)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player || p.getAssist() == player)
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist || p.getAssist() == assist)
- + {
- + player.sendMessage("Tournament: " + assist.getName() + " already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist2 || p.getAssist2() == assist2)
- + {
- + player.sendMessage("Tournament: " + assist2.getName() + " already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist3 || p.getAssist3() == assist3)
- + {
- + player.sendMessage("Tournament: " + assist3.getName() + " already registered!");
- + return false;
- + }
- + }
- + return registered.add(new Pair(player, assist, assist2, assist3));
- + }
- +
- + public boolean isRegistered(Player player)
- + {
- + for (Pair p : registered)
- + if (p.getLeader() == player || p.getAssist() == player || p.getAssist2() == player || p.getAssist3() == player)
- + return true;
- + return false;
- + }
- +
- + public Map<Integer, String> getFights()
- + {
- + return fights;
- + }
- +
- + public boolean remove(Player player)
- + {
- + for (Pair p : registered)
- + if (p.getLeader() == player || p.getAssist() == player || p.getAssist2() == player || p.getAssist3() == player)
- + {
- + p.removeMessage();
- + registered.remove(p);
- + return true;
- + }
- + return false;
- + }
- +
- + @Override
- + public synchronized void run()
- + {
- + for (;;)
- + if (registered.size() < 2 || free == 0)
- + try
- + {
- + Thread.sleep(Config.ARENA_CALL_INTERVAL * 1000);
- +
- + }
- + catch (InterruptedException localInterruptedException)
- + {
- + }
- + else
- + {
- + List<Pair> opponents = selectOpponents();
- + if (opponents != null && opponents.size() == 2)
- + {
- + Thread T = new Thread(new EvtArenaTask(opponents));
- + T.setDaemon(true);
- + T.start();
- + }
- +
- + try
- + {
- + Thread.sleep(Config.ARENA_CALL_INTERVAL * 1000);
- + }
- + catch (InterruptedException localInterruptedException1)
- + {
- + }
- + }
- + }
- +
- + @SuppressWarnings("null")
- + private List<Pair> selectOpponents()
- + {
- + List<Pair> opponents = new ArrayList<>();
- + Pair pairOne = null;
- + Pair pairTwo = null;
- + int tries = 3;
- + do
- + {
- + int first = 0;
- + int second = 0;
- + if (getRegisteredCount() < 2)
- + return opponents;
- + if (pairOne == null)
- + {
- + first = Rnd.get(getRegisteredCount());
- + pairOne = registered.get(first);
- + if (pairOne.check())
- + {
- + opponents.add(0, pairOne);
- + registered.remove(first);
- + }
- + else
- + {
- + pairOne = null;
- + registered.remove(first);
- + return null;
- + }
- + }
- +
- + if (pairTwo == null)
- + {
- + second = Rnd.get(getRegisteredCount());
- + pairTwo = registered.get(second);
- + if (pairTwo.check())
- + {
- + opponents.add(1, pairTwo);
- + registered.remove(second);
- + }
- + else
- + {
- + pairTwo = null;
- + registered.remove(second);
- + return null;
- + }
- + }
- +
- + if (pairOne != null && pairTwo != null)
- + break;
- + tries--;
- + }
- + while (tries > 0);
- + return opponents;
- + }
- +
- + public int getRegisteredCount()
- + {
- + return registered.size();
- + }
- +
- + private class Pair
- + {
- + Player leader;
- + Player assist;
- + Player assist2;
- + Player assist3;
- +
- + public Pair(Player leader, Player assist, Player assist2, Player assist3)
- + {
- + this.leader = leader;
- + this.assist = assist;
- + this.assist2 = assist2;
- + this.assist3 = assist3;
- + }
- +
- + public Player getAssist()
- + {
- + return assist;
- + }
- +
- + public Player getAssist2()
- + {
- + return assist2;
- + }
- +
- + public Player getAssist3()
- + {
- + return assist3;
- + }
- +
- + public Player getLeader()
- + {
- + return leader;
- + }
- +
- + public boolean check()
- + {
- + if (leader == null || !leader.isOnline())
- + {
- + if (assist != null || assist.isOnline())
- + assist.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist2 != null || assist2.isOnline())
- + assist2.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist3 != null || assist3.isOnline())
- + assist3.sendMessage("Tournament: You participation in Event was Canceled.");
- + return false;
- + }
- + if ((assist == null || !assist.isOnline() || assist2 == null || !assist2.isOnline() || assist3 == null || !assist3.isOnline()) && leader != null && leader.isOnline())
- + {
- + leader.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist != null || assist.isOnline())
- + assist.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist2 != null || assist2.isOnline())
- + assist2.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist3 != null || assist3.isOnline())
- + assist3.sendMessage("Tournament: You participation in Event was Canceled.");
- + return false;
- + }
- + return true;
- + }
- +
- + public boolean isDead()
- + {
- + if ((leader == null || leader.isDead() || !leader.isOnline() || !leader.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !assist.isOnline() || !assist.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist.isArenaAttack()) && (assist2 == null || assist2.isDead() || !assist2.isOnline() || !assist2.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist2.isArenaAttack()) && (assist3 == null || assist3.isDead() || !assist3.isOnline() || !assist3.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist3.isArenaAttack()))
- + return false;
- + return !leader.isDead() || !assist.isDead() || !assist2.isDead() || !assist3.isDead();
- + }
- +
- + public boolean isAlive()
- + {
- + if ((leader == null || leader.isDead() || !leader.isOnline() || !leader.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !assist.isOnline() || !assist.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist.isArenaAttack()) && (assist2 == null || assist2.isDead() || !assist2.isOnline() || !assist2.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist2.isArenaAttack()) && (assist3 == null || assist3.isDead() || !assist3.isOnline() || !assist3.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist3.isArenaAttack()))
- + return false;
- + return !leader.isDead() || !assist.isDead() || !assist2.isDead() || !assist3.isDead();
- + }
- +
- + public void teleportTo(int x, int y, int z)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.getAppearance().setInvisible();
- + leader.setCurrentCp(leader.getMaxCp());
- + leader.setCurrentHp(leader.getMaxHp());
- + leader.setCurrentMp(leader.getMaxMp());
- +
- + if (leader.isInObserverMode())
- + {
- + leader.setLastCords(x, y, z);
- + leader.leaveOlympiadObserverMode();
- + }
- + else
- + leader.teleportTo(x, y, z, 0);
- + leader.broadcastUserInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.getAppearance().setInvisible();
- + assist.setCurrentCp(assist.getMaxCp());
- + assist.setCurrentHp(assist.getMaxHp());
- + assist.setCurrentMp(assist.getMaxMp());
- +
- + if (assist.isInObserverMode())
- + {
- + assist.setLastCords(x, y + 50, z);
- + assist.leaveOlympiadObserverMode();
- + }
- + else
- + assist.teleportTo(x, y + 50, z, 0);
- + assist.broadcastUserInfo();
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.getAppearance().setInvisible();
- + assist2.setCurrentCp(assist2.getMaxCp());
- + assist2.setCurrentHp(assist2.getMaxHp());
- + assist2.setCurrentMp(assist2.getMaxMp());
- +
- + if (assist2.isInObserverMode())
- + {
- + assist2.setLastCords(x, y - 100, z);
- + assist2.leaveOlympiadObserverMode();
- + }
- + else
- + assist2.teleportTo(x, y - 100, z, 0);
- + assist2.broadcastUserInfo();
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.getAppearance().setInvisible();
- + assist3.setCurrentCp(assist3.getMaxCp());
- + assist3.setCurrentHp(assist3.getMaxHp());
- + assist3.setCurrentMp(assist3.getMaxMp());
- +
- + if (assist3.isInObserverMode())
- + {
- + assist3.setLastCords(x, y - 50, z);
- + assist3.leaveOlympiadObserverMode();
- + }
- + else
- + assist3.teleportTo(x, y - 50, z, 0);
- + assist3.broadcastUserInfo();
- + }
- + }
- +
- + public void EventTitle(String title, String color)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setTitle(title);
- + leader.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setTitle(title);
- + assist.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.setTitle(title);
- + assist2.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist2.broadcastUserInfo();
- + assist2.broadcastTitleInfo();
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.setTitle(title);
- + assist3.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist3.broadcastUserInfo();
- + assist3.broadcastTitleInfo();
- + }
- + }
- +
- + public void saveTitle()
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader._originalTitleColorTournament = leader.getAppearance().getTitleColor();
- + leader._originalTitleTournament = leader.getTitle();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist._originalTitleColorTournament = assist.getAppearance().getTitleColor();
- + assist._originalTitleTournament = assist.getTitle();
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2._originalTitleColorTournament = assist2.getAppearance().getTitleColor();
- + assist2._originalTitleTournament = assist2.getTitle();
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3._originalTitleColorTournament = assist3.getAppearance().getTitleColor();
- + assist3._originalTitleTournament = assist3.getTitle();
- + }
- + }
- +
- + public void backTitle()
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setTitle(leader._originalTitleTournament);
- + leader.getAppearance().setTitleColor(leader._originalTitleColorTournament);
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setTitle(assist._originalTitleTournament);
- + assist.getAppearance().setTitleColor(assist._originalTitleColorTournament);
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.setTitle(assist2._originalTitleTournament);
- + assist2.getAppearance().setTitleColor(assist2._originalTitleColorTournament);
- + assist2.broadcastUserInfo();
- + assist2.broadcastTitleInfo();
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.setTitle(assist3._originalTitleTournament);
- + assist3.getAppearance().setTitleColor(assist3._originalTitleColorTournament);
- + assist3.broadcastUserInfo();
- + assist3.broadcastTitleInfo();
- + }
- + }
- +
- + public void rewards()
- + {
- + if (leader != null && leader.isOnline())
- +
- +
- + leader.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_4X4, leader, true);
- +
- + if (assist != null && assist.isOnline())
- + assist.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_4X4, assist, true);
- +
- + if (assist2 != null && assist2.isOnline())
- + assist2.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_4X4, assist2, true);
- +
- + if (assist3 != null && assist3.isOnline())
- + assist3.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_4X4, assist3, true);
- + sendPacket("Congratulations, your team won the event!", 5);
- + }
- +
- + public void rewardsLost()
- + {
- + if (leader != null && leader.isOnline())
- +
- + leader.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_4X4, leader, true);
- + if (assist != null && assist.isOnline())
- +
- + assist.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_4X4, assist, true);
- + if (assist2 != null && assist2.isOnline())
- +
- + assist2.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_4X4, assist2, true);
- + if (assist3 != null && assist3.isOnline())
- + assist3.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_4X4, assist3, true);
- +
- + sendPacket("your team lost the event! =(", 5);
- + }
- +
- + public void setInTournamentEvent(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + leader.setInArenaEvent(val);
- + if (assist != null && assist.isOnline())
- + assist.setInArenaEvent(val);
- + if (assist2 != null && assist2.isOnline())
- + assist2.setInArenaEvent(val);
- + if (assist3 != null && assist3.isOnline())
- + assist3.setInArenaEvent(val);
- + }
- +
- + public void removeMessage()
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.sendMessage("Tournament: Your participation has been removed.");
- + leader.setArenaProtection(false);
- + leader.setArena4x4(false);
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.sendMessage("Tournament: Your participation has been removed.");
- + assist.setArenaProtection(false);
- + assist.setArena4x4(false);
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.sendMessage("Tournament: Your participation has been removed.");
- + assist2.setArenaProtection(false);
- + assist2.setArena4x4(false);
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.sendMessage("Tournament: Your participation has been removed.");
- + assist3.setArenaProtection(false);
- + assist3.setArena4x4(false);
- + }
- + }
- +
- + public void setArenaProtection(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setArenaProtection(val);
- + leader.setArena4x4(val);
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setArenaProtection(val);
- + assist.setArena4x4(val);
- + }
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.setArenaProtection(val);
- + assist2.setArena4x4(val);
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.setArenaProtection(val);
- + assist3.setArena4x4(val);
- + }
- + }
- +
- + public void revive()
- + {
- + if (leader != null && leader.isOnline() && leader.isDead())
- + leader.doRevive();
- + if (assist != null && assist.isOnline() && assist.isDead())
- + assist.doRevive();
- + if (assist2 != null && assist2.isOnline() && assist2.isDead())
- + assist2.doRevive();
- + if (assist3 != null && assist3.isOnline() && assist3.isDead())
- + assist3.doRevive();
- + }
- +
- + public void setImobilised(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setIsInvul(val);
- + leader.setStopArena(val);
- + }
- + if (assist != null && assist.isOnline())
- + {
- + assist.setIsInvul(val);
- + assist.setStopArena(val);
- + }
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.setIsInvul(val);
- + assist2.setStopArena(val);
- + }
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.setIsInvul(val);
- + assist3.setStopArena(val);
- + }
- + }
- +
- + public void setArenaAttack(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setArenaAttack(val);
- + leader.broadcastUserInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setArenaAttack(val);
- + assist.broadcastUserInfo();
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.setArenaAttack(val);
- + assist2.broadcastUserInfo();
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.setArenaAttack(val);
- + assist3.broadcastUserInfo();
- + }
- + }
- +
- +
- +
- + public void removePet()
- + {
- + if (leader != null && leader.isOnline())
- + {
- +
- + if (leader.getSummon() != null)
- + {
- + Summon summon = leader.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(leader);
- + }
- + if (leader.getMountType() == 1 || leader.getMountType() == 2)
- + leader.dismount();
- + }
- + if (assist != null && assist.isOnline())
- + {
- +
- + if (assist.getSummon() != null)
- + {
- + Summon summon = assist.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist);
- + }
- + if (assist.getMountType() == 1 || assist.getMountType() == 2)
- + assist.dismount();
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- +
- + if (assist2.getSummon() != null)
- + {
- + Summon summon = assist2.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist2);
- + }
- +
- + if (assist2.getMountType() == 1 || assist2.getMountType() == 2)
- + assist2.dismount();
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- +
- + if (assist3.getSummon() != null)
- + {
- + Summon summon = assist3.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist3);
- + }
- + if (assist3.getMountType() == 1 || assist3.getMountType() == 2)
- + assist3.dismount();
- + }
- +
- +
- + }
- +
- + public void removeSkills()
- + {
- + if (leader.getClassId() != ClassId.SHILLIEN_ELDER && leader.getClassId() != ClassId.SHILLIEN_SAINT && leader.getClassId() != ClassId.BISHOP && leader.getClassId() != ClassId.CARDINAL && leader.getClassId() != ClassId.ELVEN_ELDER && leader.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : leader.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + leader.stopSkillEffects(effect.getSkill().getId());
- + if (assist.getClassId() != ClassId.SHILLIEN_ELDER && assist.getClassId() != ClassId.SHILLIEN_SAINT && assist.getClassId() != ClassId.BISHOP && assist.getClassId() != ClassId.CARDINAL && assist.getClassId() != ClassId.ELVEN_ELDER && assist.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : assist.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist.stopSkillEffects(effect.getSkill().getId());
- + if (assist2.getClassId() != ClassId.SHILLIEN_ELDER && assist2.getClassId() != ClassId.SHILLIEN_SAINT && assist2.getClassId() != ClassId.BISHOP && assist2.getClassId() != ClassId.CARDINAL && assist2.getClassId() != ClassId.ELVEN_ELDER && assist2.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : assist2.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist2.stopSkillEffects(effect.getSkill().getId());
- + if (assist3.getClassId() != ClassId.SHILLIEN_ELDER && assist3.getClassId() != ClassId.SHILLIEN_SAINT && assist3.getClassId() != ClassId.BISHOP && assist3.getClassId() != ClassId.CARDINAL && assist3.getClassId() != ClassId.ELVEN_ELDER && assist3.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : assist3.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist3.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + public void sendPacket(String message, int duration)
- + {
- + if (leader != null && leader.isOnline())
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist != null && assist.isOnline())
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist2 != null && assist2.isOnline())
- + assist2.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist3 != null && assist3.isOnline())
- + assist3.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + }
- +
- + public void inicarContagem(int duration)
- + {
- + if (leader != null && leader.isOnline())
- + ThreadPool.schedule(new Arena4x4.countdown(leader, duration), 0L);
- + if (assist != null && assist.isOnline())
- + ThreadPool.schedule(new Arena4x4.countdown(assist, duration), 0L);
- + if (assist2 != null && assist2.isOnline())
- + ThreadPool.schedule(new Arena4x4.countdown(assist2, duration), 0L);
- + if (assist3 != null && assist3.isOnline())
- + ThreadPool.schedule(new Arena4x4.countdown(assist3, duration), 0L);
- + }
- +
- + public void sendPacketinit(String message, int duration)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if ((leader.getClassId() == ClassId.SHILLIEN_ELDER || leader.getClassId() == ClassId.SHILLIEN_SAINT || leader.getClassId() == ClassId.BISHOP || leader.getClassId() == ClassId.CARDINAL || leader.getClassId() == ClassId.ELVEN_ELDER || leader.getClassId() == ClassId.EVAS_SAINT) && Config.bs_COUNT_4X4 == 0)
- + ThreadPool.schedule(new Runnable()
- + {
- +
- + @Override
- + public void run()
- + {
- + leader.getClient().closeNow();
- + }
- + }, 100L);
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if ((assist.getClassId() == ClassId.SHILLIEN_ELDER || assist.getClassId() == ClassId.SHILLIEN_SAINT || assist.getClassId() == ClassId.BISHOP || assist.getClassId() == ClassId.CARDINAL || assist.getClassId() == ClassId.ELVEN_ELDER || assist.getClassId() == ClassId.EVAS_SAINT) && Config.bs_COUNT_4X4 == 0)
- + ThreadPool.schedule(new Runnable()
- + {
- +
- + @Override
- + public void run()
- + {
- + assist.getClient().closeNow();
- + }
- + }, 100L);
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if ((assist2.getClassId() == ClassId.SHILLIEN_ELDER || assist2.getClassId() == ClassId.SHILLIEN_SAINT || assist2.getClassId() == ClassId.BISHOP || assist2.getClassId() == ClassId.CARDINAL || assist2.getClassId() == ClassId.ELVEN_ELDER || assist2.getClassId() == ClassId.EVAS_SAINT) && Config.bs_COUNT_4X4 == 0)
- + ThreadPool.schedule(new Runnable()
- + {
- +
- + @Override
- + public void run()
- + {
- + assist2.getClient().closeNow();
- + }
- + }, 100L);
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if ((assist3.getClassId() == ClassId.SHILLIEN_ELDER || assist3.getClassId() == ClassId.SHILLIEN_SAINT || assist3.getClassId() == ClassId.BISHOP || assist3.getClassId() == ClassId.CARDINAL || assist3.getClassId() == ClassId.ELVEN_ELDER || assist3.getClassId() == ClassId.EVAS_SAINT) && Config.bs_COUNT_4X4 == 0)
- + ThreadPool.schedule(new Runnable()
- + {
- +
- + @Override
- + public void run()
- + {
- + assist3.getClient().closeNow();
- + }
- + }, 100L);
- + }
- + }
- + }
- +
- + private class EvtArenaTask implements Runnable
- + {
- + private final Arena4x4.Pair pairOne;
- + private final Arena4x4.Pair pairTwo;
- + private final int pOneX;
- + private final int pOneY;
- + private final int pOneZ;
- + private final int pTwoX;
- + private final int pTwoY;
- + private final int pTwoZ;
- + private Arena4x4.Arena arena;
- +
- + public EvtArenaTask(List<Pair> opponents)
- + {
- + pairOne = opponents.get(0);
- + pairTwo = opponents.get(1);
- + Player leader = pairOne.getLeader();
- + pOneX = leader.getX();
- + pOneY = leader.getY();
- + pOneZ = leader.getZ();
- + leader = pairTwo.getLeader();
- + pTwoX = leader.getX();
- + pTwoY = leader.getY();
- + pTwoZ = leader.getZ();
- + }
- +
- + @Override
- + public void run()
- + {
- + free -= 1;
- + pairOne.saveTitle();
- + pairTwo.saveTitle();
- + portPairsToArena();
- + pairOne.inicarContagem(Config.ARENA_WAIT_INTERVAL_4X4);
- + pairTwo.inicarContagem(Config.ARENA_WAIT_INTERVAL_4X4);
- + try
- + {
- + Thread.sleep(Config.ARENA_WAIT_INTERVAL_4X4 * 1000);
- + }
- + catch (InterruptedException localInterruptedException1)
- + {
- + }
- +
- + pairOne.sendPacketinit("Started. Good Fight!", 3);
- + pairTwo.sendPacketinit("Started. Good Fight!", 3);
- + pairOne.EventTitle(Config.MSG_TEAM1, Config.TITLE_COLOR_TEAM1);
- + pairTwo.EventTitle(Config.MSG_TEAM2, Config.TITLE_COLOR_TEAM2);
- + pairOne.setImobilised(false);
- + pairTwo.setImobilised(false);
- + pairOne.setArenaAttack(true);
- + pairTwo.setArenaAttack(true);
- + while (check())
- + try
- + {
- +
- + Thread.sleep(Config.ARENA_CHECK_INTERVAL);
- + }
- + catch (InterruptedException e)
- + {
- + }
- +
- + this.finishDuel();
- + final Arena4x4 this$2 = Arena4x4.this;
- + ++this$2.free;
- + }
- +
- + private void finishDuel()
- + {
- + fights.remove(Integer.valueOf(arena.id));
- + rewardWinner();
- + pairOne.revive();
- + pairTwo.revive();
- + pairOne.teleportTo(pOneX, pOneY, pOneZ);
- + pairTwo.teleportTo(pTwoX, pTwoY, pTwoZ);
- + pairOne.backTitle();
- + pairTwo.backTitle();
- + pairOne.setInTournamentEvent(false);
- + pairTwo.setInTournamentEvent(false);
- + pairOne.setArenaProtection(false);
- + pairTwo.setArenaProtection(false);
- + pairOne.setArenaAttack(false);
- + pairTwo.setArenaAttack(false);
- + arena.setFree(true);
- + }
- +
- + private void rewardWinner()
- + {
- + if (pairOne.isAlive() && !pairTwo.isAlive())
- + {
- + Player leader1 = pairOne.getLeader();
- + Player leader2 = pairTwo.getLeader();
- +
- + if (leader1.getClan() != null && leader2.getClan() != null && Config.TOURNAMENT_EVENT_ANNOUNCE)
- +
- + World.announceToOnlinePlayers("[4x4]: (" + leader1.getClan().getName() + " VS " + leader2.getClan().getName() + ") ~> " + leader1.getClan().getName() + " win!");
- + pairOne.rewards();
- + pairTwo.rewardsLost();
- + }
- + else if (pairTwo.isAlive() && !pairOne.isAlive())
- + {
- + Player leader1 = pairTwo.getLeader();
- + Player leader2 = pairOne.getLeader();
- +
- + if (leader1.getClan() != null && leader2.getClan() != null && Config.TOURNAMENT_EVENT_ANNOUNCE)
- +
- + World.announceToOnlinePlayers("[4x4]: (" + leader1.getClan().getName() + " VS " + leader2.getClan().getName() + ") ~> " + leader1.getClan().getName() + " win!");
- +
- + pairTwo.rewards();
- + pairOne.rewardsLost();
- + }
- + }
- +
- + private boolean check()
- + {
- + return pairOne.isDead() && pairTwo.isDead();
- + }
- +
- + private void portPairsToArena()
- + {
- + for (Arena4x4.Arena arena : arenas)
- + if (arena.isFree)
- + {
- + this.arena = arena;
- + arena.setFree(false);
- + pairOne.removePet();
- + pairTwo.removePet();
- + pairOne.teleportTo(arena.x - 850, arena.y, arena.z);
- + pairTwo.teleportTo(arena.x + 850, arena.y, arena.z);
- + pairOne.setImobilised(true);
- + pairTwo.setImobilised(true);
- + pairOne.setInTournamentEvent(true);
- + pairTwo.setInTournamentEvent(true);
- + pairOne.removeSkills();
- + pairTwo.removeSkills();
- + fights.put(Integer.valueOf(this.arena.id), pairOne.getLeader().getName() + " vs " + pairTwo.getLeader().getName());
- + break;
- + }
- + }
- + }
- +
- + private class Arena
- + {
- + protected int x;
- + protected int y;
- + protected int z;
- + protected boolean isFree = true;
- + int id;
- +
- + public Arena(int id, int x, int y, int z)
- + {
- + this.id = id;
- + this.x = x;
- + this.y = y;
- + this.z = z;
- + }
- +
- + public void setFree(boolean val)
- + {
- + isFree = val;
- + }
- + }
- +
- + protected class countdown implements Runnable
- + {
- + private final Player _player;
- + private final int _time;
- +
- + public countdown(Player player, int time)
- + {
- + _time = time;
- + _player = player;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_player.isOnline())
- + {
- +
- + switch (_time)
- + {
- + case 60:
- + case 120:
- + case 180:
- + case 240:
- + case 300:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in " + _time + " second(s)..", 4000));
- + _player.sendMessage(_time + " second(s) to start the battle.");
- + _player.setIsParalyzed(true);
- + }
- + break;
- + case 45:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 1));
- + }
- + break;
- + case 27:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in 30 second(s)..", 4000));
- + _player.sendMessage("30 second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 2));
- + }
- + break;
- + case 20:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- +
- + }
- + break;
- + case 15:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 9));
- + }
- + break;
- + case 10:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 5));
- + break;
- + case 5:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 4:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 3:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 2:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 1:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(false);
- + break;
- + }
- + if (_time > 1)
- + ThreadPool.schedule(new countdown(_player, _time - 1), 1000L);
- + }
- + }
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final Arena4x4 INSTANCE = new Arena4x4();
- + }
- + }
- +
- Index: package l2jban.events;Arena9x9.java
- ===================================================================
- --- package l2jban.events;Arena9x9.java (revision 84)
- +++ package l2jban.events;Arena9x9.java (working copy)
- + package l2jban.events;
- +
- + import java.util.ArrayList;
- + import java.util.HashMap;
- + import java.util.List;
- + import java.util.Map;
- + import net.sf.l2j.commons.concurrent.ThreadPool;
- + import net.sf.l2j.commons.random.Rnd;
- + import net.sf.l2j.Config;
- + import net.sf.l2j.gameserver.model.L2Effect;
- + import net.sf.l2j.gameserver.model.World;
- + import net.sf.l2j.gameserver.model.actor.Player;
- + import net.sf.l2j.gameserver.model.actor.Summon;
- + import net.sf.l2j.gameserver.model.actor.instance.Pet;
- + import net.sf.l2j.gameserver.enums.actors.ClassId;
- + import net.sf.l2j.gameserver.enums.ZoneId;
- + import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
- + import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
- +
- + public class Arena9x9 implements Runnable
- + {
- + public static List<Pair> registered;
- + int free = Config.ARENA_EVENT_COUNT_9X9;
- +
- + Arena[] arenas = new Arena[Config.ARENA_EVENT_COUNT_9X9];
- +
- + Map<Integer, String> fights = new HashMap<>(Config.ARENA_EVENT_COUNT_9X9);
- +
- + public Arena9x9()
- + {
- + registered = new ArrayList<>();
- +
- + for (int i = 0; i < Config.ARENA_EVENT_COUNT_9X9; i++)
- + {
- + int[] coord = Config.ARENA_EVENT_LOCS_9X9[i];
- + arenas[i] = new Arena(i, coord[0], coord[1], coord[2]);
- + }
- + }
- +
- + public static Arena9x9 getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + public boolean register(Player player, Player assist, Player assist2, Player assist3, Player assist4, Player assist5, Player assist6, Player assist7, Player assist8)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player || p.getAssist() == player)
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist || p.getAssist() == assist)
- + {
- + player.sendMessage("Tournament: " + assist.getName() + " already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist2 || p.getAssist2() == assist2)
- + {
- + player.sendMessage("Tournament: " + assist2.getName() + " already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist3 || p.getAssist3() == assist3)
- + {
- + player.sendMessage("Tournament: " + assist3.getName() + " already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist4 || p.getAssist4() == assist4)
- + {
- + player.sendMessage("Tournament: " + assist4.getName() + " already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist5 || p.getAssist5() == assist5)
- + {
- + player.sendMessage("Tournament: " + assist5.getName() + " already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist6 || p.getAssist6() == assist6)
- + {
- + player.sendMessage("Tournament: " + assist6.getName() + " already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist7 || p.getAssist7() == assist7)
- + {
- + player.sendMessage("Tournament: " + assist7.getName() + " already registered!");
- + return false;
- + }
- + if (p.getLeader() == assist8 || p.getAssist8() == assist8)
- + {
- + player.sendMessage("Tournament: " + assist8.getName() + " already registered!");
- + return false;
- + }
- + }
- + return registered.add(new Pair(player, assist, assist2, assist3, assist4, assist5, assist6, assist7, assist8));
- + }
- +
- + public boolean isRegistered(Player player)
- + {
- + for (Pair p : registered)
- + if (p.getLeader() == player || p.getAssist() == player || p.getAssist2() == player || p.getAssist3() == player || p.getAssist4() == player || p.getAssist5() == player || p.getAssist6() == player || p.getAssist7() == player || p.getAssist8() == player)
- + return true;
- + return false;
- + }
- +
- + public Map<Integer, String> getFights()
- + {
- + return fights;
- + }
- +
- + public boolean remove(Player player)
- + {
- + for (Pair p : registered)
- + if (p.getLeader() == player || p.getAssist() == player || p.getAssist2() == player || p.getAssist3() == player || p.getAssist4() == player || p.getAssist5() == player || p.getAssist6() == player || p.getAssist7() == player || p.getAssist8() == player)
- + {
- + p.removeMessage();
- + registered.remove(p);
- + return true;
- + }
- + return false;
- + }
- +
- + @Override
- + public synchronized void run()
- + {
- + for (;;)
- + if (registered.size() < 2 || free == 0)
- + try
- + {
- + Thread.sleep(Config.ARENA_CALL_INTERVAL * 1000);
- +
- + }
- + catch (InterruptedException localInterruptedException)
- + {
- + }
- + else
- + {
- + List<Pair> opponents = selectOpponents();
- + if (opponents != null && opponents.size() == 2)
- + {
- + Thread T = new Thread(new EvtArenaTask(opponents));
- + T.setDaemon(true);
- + T.start();
- + }
- +
- + try
- + {
- + Thread.sleep(Config.ARENA_CALL_INTERVAL * 1000);
- + }
- + catch (InterruptedException localInterruptedException1)
- + {
- + }
- + }
- + }
- +
- + @SuppressWarnings("null")
- + private List<Pair> selectOpponents()
- + {
- + List<Pair> opponents = new ArrayList<>();
- + Pair pairOne = null;
- + Pair pairTwo = null;
- + int tries = 3;
- + do
- + {
- + int first = 0;
- + int second = 0;
- + if (getRegisteredCount() < 2)
- + return opponents;
- + if (pairOne == null)
- + {
- + first = Rnd.get(getRegisteredCount());
- + pairOne = registered.get(first);
- + if (pairOne.check())
- + {
- + opponents.add(0, pairOne);
- + registered.remove(first);
- + }
- + else
- + {
- + pairOne = null;
- + registered.remove(first);
- + return null;
- + }
- + }
- +
- + if (pairTwo == null)
- + {
- + second = Rnd.get(getRegisteredCount());
- + pairTwo = registered.get(second);
- + if (pairTwo.check())
- + {
- + opponents.add(1, pairTwo);
- + registered.remove(second);
- + }
- + else
- + {
- + pairTwo = null;
- + registered.remove(second);
- + return null;
- + }
- + }
- +
- + if (pairOne != null && pairTwo != null)
- + break;
- + tries--;
- + }
- + while (tries > 0);
- + return opponents;
- + }
- +
- + public int getRegisteredCount()
- + {
- + return registered.size();
- + }
- +
- + private class Pair
- + {
- + private final Player leader;
- + private final Player assist;
- + private final Player assist2;
- + private final Player assist3;
- +
- + public Pair(Player leader, Player assist, Player assist2, Player assist3, Player assist4, Player assist5, Player assist6, Player assist7, Player assist8)
- + {
- + this.leader = leader;
- + this.assist = assist;
- + this.assist2 = assist2;
- + this.assist3 = assist3;
- + this.assist4 = assist4;
- + this.assist5 = assist5;
- + this.assist6 = assist6;
- + this.assist7 = assist7;
- + this.assist8 = assist8;
- + }
- +
- + public Player getAssist()
- + {
- + return assist;
- + }
- +
- + public Player getAssist2()
- + {
- + return assist2;
- + }
- +
- + public Player getAssist3()
- + {
- + return assist3;
- + }
- +
- + public Player getAssist4()
- + {
- + return assist4;
- + }
- +
- + public Player getAssist5()
- + {
- + return assist5;
- + }
- +
- + public Player getAssist6()
- + {
- + return assist6;
- + }
- +
- + public Player getAssist7()
- + {
- + return assist7;
- + }
- +
- + public Player getAssist8()
- + {
- + return assist8;
- + }
- +
- + public Player getLeader()
- + {
- + return leader;
- + }
- +
- + public boolean check()
- + {
- + if (leader == null || !leader.isOnline())
- + {
- +
- + if (assist != null || assist.isOnline())
- + assist.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist2 != null || assist2.isOnline())
- + assist2.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist3 != null || assist3.isOnline())
- + assist3.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist4 != null || assist4.isOnline())
- + assist4.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist5 != null || assist5.isOnline())
- + assist5.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist6 != null || assist6.isOnline())
- + assist6.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist7 != null || assist7.isOnline())
- + assist7.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist8 != null || assist8.isOnline())
- + assist8.sendMessage("Tournament: You participation in Event was Canceled.");
- + return false;
- + }
- + if ((assist == null || !assist.isOnline() || assist2 == null || !assist2.isOnline() || assist3 == null || !assist3.isOnline() || assist4 == null || !assist4.isOnline() || assist5 == null || !assist5.isOnline() || assist6 == null || !assist6.isOnline() || assist7 == null || !assist7.isOnline() || assist8 == null || !assist8.isOnline()) && (leader != null || leader.isOnline()))
- + {
- + leader.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist != null || assist.isOnline())
- + assist.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist2 != null || assist2.isOnline())
- + assist2.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist3 != null || assist3.isOnline())
- + assist3.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist4 != null || assist4.isOnline())
- + assist4.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist5 != null || assist5.isOnline())
- + assist5.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist6 != null || assist6.isOnline())
- + assist6.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist7 != null || assist7.isOnline())
- + assist7.sendMessage("Tournament: You participation in Event was Canceled.");
- + if (assist8 != null || assist8.isOnline())
- + assist8.sendMessage("Tournament: You participation in Event was Canceled.");
- + return false;
- + }
- + return true;
- + }
- +
- + public boolean isDead()
- + {
- + if ((leader == null || leader.isDead() || !leader.isOnline() || !leader.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !assist.isOnline() || !assist.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist.isArenaAttack()) && (assist2 == null || assist2.isDead() || !assist2.isOnline() || !assist2.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist2.isArenaAttack()) && (assist3 == null || assist3.isDead() || !assist3.isOnline() || !assist3.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist3.isArenaAttack()) && (assist4 == null || assist4.isDead() || !assist4.isOnline() || !assist4.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist4.isArenaAttack()) && (assist5 == null || assist5.isDead() || !assist5.isOnline() || !assist5.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist5.isArenaAttack()) && (assist6 == null || assist6.isDead() || !assist6.isOnline() || !assist6.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist6.isArenaAttack()) && (assist7 == null || assist7.isDead() || !assist7.isOnline() || !assist7.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist7.isArenaAttack()) && (assist8 == null || assist8.isDead() || !assist8.isOnline() || !assist8.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist8.isArenaAttack()))
- + return false;
- + return !leader.isDead() || !assist.isDead() || !assist2.isDead() || !assist3.isDead() || !assist4.isDead() || !assist5.isDead() || !assist6.isDead() || !assist7.isDead() || !assist8.isDead();
- + }
- +
- + public boolean isAlive()
- + {
- + if ((leader == null || leader.isDead() || !leader.isOnline() || !leader.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !assist.isOnline() || !assist.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist.isArenaAttack()) && (assist2 == null || assist2.isDead() || !assist2.isOnline() || !assist2.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist2.isArenaAttack()) && (assist3 == null || assist3.isDead() || !assist3.isOnline() || !assist3.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist3.isArenaAttack()) && (assist4 == null || assist4.isDead() || !assist4.isOnline() || !assist4.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist4.isArenaAttack()) && (assist5 == null || assist5.isDead() || !assist5.isOnline() || !assist5.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist5.isArenaAttack()) && (assist6 == null || assist6.isDead() || !assist6.isOnline() || !assist6.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist6.isArenaAttack()) && (assist7 == null || assist7.isDead() || !assist7.isOnline() || !assist7.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist7.isArenaAttack()) && (assist8 == null || assist8.isDead() || !assist8.isOnline() || !assist8.isInsideZone(ZoneId.TORURNAMENT_ARENA) || !assist8.isArenaAttack()))
- + return false;
- + return !leader.isDead() || !assist.isDead() || !assist2.isDead() || !assist3.isDead() || !assist4.isDead() || !assist5.isDead() || !assist6.isDead() || !assist7.isDead() || !assist8.isDead();
- + }
- +
- + public void teleportTo(int x, int y, int z)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.getAppearance().setInvisible();
- + leader.setCurrentCp(leader.getMaxCp());
- + leader.setCurrentHp(leader.getMaxHp());
- + leader.setCurrentMp(leader.getMaxMp());
- +
- + if (leader.isInObserverMode())
- + {
- + leader.setLastCords(x, y, z);
- + leader.leaveOlympiadObserverMode();
- + }
- + else
- + leader.teleportTo(x, y, z, 0);
- + leader.broadcastUserInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.getAppearance().setInvisible();
- + assist.setCurrentCp(assist.getMaxCp());
- + assist.setCurrentHp(assist.getMaxHp());
- + assist.setCurrentMp(assist.getMaxMp());
- +
- + if (assist.isInObserverMode())
- + {
- + assist.setLastCords(x, y + 200, z);
- + assist.leaveOlympiadObserverMode();
- + }
- + else
- + assist.teleportTo(x, y + 200, z, 0);
- + assist.broadcastUserInfo();
- + }
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.getAppearance().setInvisible();
- + assist2.setCurrentCp(assist2.getMaxCp());
- + assist2.setCurrentHp(assist2.getMaxHp());
- + assist2.setCurrentMp(assist2.getMaxMp());
- +
- + if (assist2.isInObserverMode())
- + {
- + assist2.setLastCords(x, y + 150, z);
- + assist2.leaveOlympiadObserverMode();
- + }
- + else
- + assist2.teleportTo(x, y + 150, z, 0);
- + assist2.broadcastUserInfo();
- + }
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.getAppearance().setInvisible();
- + assist3.setCurrentCp(assist3.getMaxCp());
- + assist3.setCurrentHp(assist3.getMaxHp());
- + assist3.setCurrentMp(assist3.getMaxMp());
- +
- + if (assist3.isInObserverMode())
- + {
- + assist3.setLastCords(x, y + 100, z);
- + assist3.leaveOlympiadObserverMode();
- + }
- + else
- + assist3.teleportTo(x, y + 100, z, 0);
- + assist3.broadcastUserInfo();
- + }
- + if (assist4 != null && assist4.isOnline())
- + {
- + assist4.getAppearance().setInvisible();
- + assist4.setCurrentCp(assist4.getMaxCp());
- + assist4.setCurrentHp(assist4.getMaxHp());
- + assist4.setCurrentMp(assist4.getMaxMp());
- +
- + if (assist4.isInObserverMode())
- + {
- + assist4.setLastCords(x, y + 50, z);
- + assist4.leaveOlympiadObserverMode();
- + }
- + else
- + assist4.teleportTo(x, y + 50, z, 0);
- + assist4.broadcastUserInfo();
- + }
- + if (assist5 != null && assist5.isOnline())
- + {
- + assist5.getAppearance().setInvisible();
- + assist5.setCurrentCp(assist5.getMaxCp());
- + assist5.setCurrentHp(assist5.getMaxHp());
- + assist5.setCurrentMp(assist5.getMaxMp());
- +
- + if (assist5.isInObserverMode())
- + {
- + assist5.setLastCords(x, y - 200, z);
- + assist5.leaveOlympiadObserverMode();
- + }
- + else
- + assist5.teleportTo(x, y - 200, z, 0);
- + assist5.broadcastUserInfo();
- + }
- + if (assist6 != null && assist6.isOnline())
- + {
- + assist6.getAppearance().setInvisible();
- + assist6.setCurrentCp(assist6.getMaxCp());
- + assist6.setCurrentHp(assist6.getMaxHp());
- + assist6.setCurrentMp(assist6.getMaxMp());
- +
- + if (assist6.isInObserverMode())
- + {
- + assist6.setLastCords(x, y - 150, z);
- + assist6.leaveOlympiadObserverMode();
- + }
- + else
- + assist6.teleportTo(x, y - 150, z, 0);
- + assist6.broadcastUserInfo();
- + }
- + if (assist7 != null && assist7.isOnline())
- + {
- + assist7.getAppearance().setInvisible();
- + assist7.setCurrentCp(assist7.getMaxCp());
- + assist7.setCurrentHp(assist7.getMaxHp());
- + assist7.setCurrentMp(assist7.getMaxMp());
- +
- + if (assist7.isInObserverMode())
- + {
- + assist7.setLastCords(x, y - 100, z);
- + assist7.leaveOlympiadObserverMode();
- + }
- + else
- + assist7.teleportTo(x, y - 100, z, 0);
- + assist7.broadcastUserInfo();
- + }
- + if (assist8 != null && assist8.isOnline())
- + {
- + assist8.getAppearance().setInvisible();
- + assist8.setCurrentCp(assist8.getMaxCp());
- + assist8.setCurrentHp(assist8.getMaxHp());
- + assist8.setCurrentMp(assist8.getMaxMp());
- +
- + if (assist8.isInObserverMode())
- + {
- + assist8.setLastCords(x, y - 50, z);
- + assist8.leaveOlympiadObserverMode();
- + }
- + else
- + assist8.teleportTo(x, y - 50, z, 0);
- + assist8.broadcastUserInfo();
- + }
- + }
- +
- + public void EventTitle(String title, String color)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setTitle(title);
- + leader.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setTitle(title);
- + assist.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.setTitle(title);
- + assist2.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist2.broadcastUserInfo();
- + assist2.broadcastTitleInfo();
- + }
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.setTitle(title);
- + assist3.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist3.broadcastUserInfo();
- + assist3.broadcastTitleInfo();
- + }
- + if (assist4 != null && assist4.isOnline())
- + {
- + assist4.setTitle(title);
- + assist4.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist4.broadcastUserInfo();
- + assist4.broadcastTitleInfo();
- + }
- + if (assist5 != null && assist5.isOnline())
- + {
- + assist5.setTitle(title);
- + assist5.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist5.broadcastUserInfo();
- + assist5.broadcastTitleInfo();
- + }
- + if (assist6 != null && assist6.isOnline())
- + {
- + assist6.setTitle(title);
- + assist6.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist6.broadcastUserInfo();
- + assist6.broadcastTitleInfo();
- + }
- + if (assist7 != null && assist7.isOnline())
- + {
- + assist7.setTitle(title);
- + assist7.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist7.broadcastUserInfo();
- + assist7.broadcastTitleInfo();
- + }
- + if (assist8 != null && assist8.isOnline())
- + {
- + assist8.setTitle(title);
- + assist8.getAppearance().setTitleColor(Integer.decode("0x" + color).intValue());
- + assist8.broadcastUserInfo();
- + assist8.broadcastTitleInfo();
- + }
- + }
- +
- + public void saveTitle()
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader._originalTitleColorTournament = leader.getAppearance().getTitleColor();
- + leader._originalTitleTournament = leader.getTitle();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist._originalTitleColorTournament = assist.getAppearance().getTitleColor();
- + assist._originalTitleTournament = assist.getTitle();
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2._originalTitleColorTournament = assist2.getAppearance().getTitleColor();
- + assist2._originalTitleTournament = assist2.getTitle();
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3._originalTitleColorTournament = assist3.getAppearance().getTitleColor();
- + assist3._originalTitleTournament = assist3.getTitle();
- + }
- +
- + if (assist4 != null && assist4.isOnline())
- + {
- + assist4._originalTitleColorTournament = assist4.getAppearance().getTitleColor();
- + assist4._originalTitleTournament = assist4.getTitle();
- + }
- +
- + if (assist5 != null && assist5.isOnline())
- + {
- + assist5._originalTitleColorTournament = assist5.getAppearance().getTitleColor();
- + assist5._originalTitleTournament = assist5.getTitle();
- + }
- +
- + if (assist6 != null && assist6.isOnline())
- + {
- + assist6._originalTitleColorTournament = assist6.getAppearance().getTitleColor();
- + assist6._originalTitleTournament = assist6.getTitle();
- + assist6._originalTitleTournament = assist6.getTitle();
- + }
- +
- + if (assist7 != null && assist7.isOnline())
- + {
- + assist7._originalTitleColorTournament = assist7.getAppearance().getTitleColor();
- + assist7._originalTitleTournament = assist7.getTitle();
- + }
- +
- + if (assist8 != null && assist8.isOnline())
- + {
- + assist8._originalTitleColorTournament = assist8.getAppearance().getTitleColor();
- + assist8._originalTitleTournament = assist8.getTitle();
- + }
- + }
- +
- + public void backTitle()
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setTitle(leader._originalTitleTournament);
- + leader.getAppearance().setTitleColor(leader._originalTitleColorTournament);
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setTitle(assist._originalTitleTournament);
- + assist.getAppearance().setTitleColor(assist._originalTitleColorTournament);
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.setTitle(assist2._originalTitleTournament);
- + assist2.getAppearance().setTitleColor(assist2._originalTitleColorTournament);
- + assist2.broadcastUserInfo();
- + assist2.broadcastTitleInfo();
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.setTitle(assist3._originalTitleTournament);
- + assist3.getAppearance().setTitleColor(assist3._originalTitleColorTournament);
- + assist3.broadcastUserInfo();
- + assist3.broadcastTitleInfo();
- + }
- +
- + if (assist4 != null && assist4.isOnline())
- + {
- + assist4.setTitle(assist4._originalTitleTournament);
- + assist4.getAppearance().setTitleColor(assist4._originalTitleColorTournament);
- + assist4.broadcastUserInfo();
- + assist4.broadcastTitleInfo();
- + }
- +
- + if (assist5 != null && assist5.isOnline())
- + {
- + assist5.setTitle(assist5._originalTitleTournament);
- + assist5.getAppearance().setTitleColor(assist5._originalTitleColorTournament);
- + assist5.broadcastUserInfo();
- + assist5.broadcastTitleInfo();
- + }
- +
- + if (assist6 != null && assist6.isOnline())
- + {
- + assist6.setTitle(assist6._originalTitleTournament);
- + assist6.getAppearance().setTitleColor(assist6._originalTitleColorTournament);
- + assist6.broadcastUserInfo();
- + assist6.broadcastTitleInfo();
- + }
- +
- + if (assist7 != null && assist7.isOnline())
- + {
- + assist7.setTitle(assist7._originalTitleTournament);
- + assist7.getAppearance().setTitleColor(assist7._originalTitleColorTournament);
- + assist7.broadcastUserInfo();
- + assist7.broadcastTitleInfo();
- + }
- +
- + if (assist8 != null && assist8.isOnline())
- + {
- + assist8.setTitle(assist8._originalTitleTournament);
- + assist8.getAppearance().setTitleColor(assist8._originalTitleColorTournament);
- + assist8.broadcastUserInfo();
- + assist8.broadcastTitleInfo();
- + }
- + }
- +
- + private final Player assist4;
- + private final Player assist5;
- + private final Player assist6;
- + private final Player assist7;
- + private final Player assist8;
- +
- + public void rewards()
- + {
- + if (leader != null && leader.isOnline())
- + leader.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_9X9, leader, true);
- +
- + if (assist != null && assist.isOnline())
- + assist.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_9X9, assist, true);
- +
- + if (assist2 != null && assist2.isOnline())
- + assist2.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_9X9, assist2, true);
- +
- + if (assist3 != null && assist3.isOnline())
- + assist3.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_9X9, assist3, true);
- +
- + if (assist4 != null && assist4.isOnline())
- + assist4.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_9X9, assist4, true);
- +
- + if (assist5 != null && assist5.isOnline())
- + assist5.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_9X9, assist5, true);
- +
- + if (assist6 != null && assist6.isOnline())
- + assist6.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_9X9, assist6, true);
- +
- + if (assist7 != null && assist7.isOnline())
- + assist7.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_9X9, assist7, true);
- +
- + if (assist8 != null && assist8.isOnline())
- + assist8.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_WIN_REWARD_COUNT_9X9, assist8, true);
- +
- +
- + sendPacket("Congratulations, your team won the event!", 5);
- + }
- +
- + public void rewardsLost()
- + {
- + if (leader != null && leader.isOnline())
- + leader.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_9X9, leader, true);
- +
- + if (assist != null && assist.isOnline())
- + assist.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_9X9, assist, true);
- +
- + if (assist2 != null && assist2.isOnline())
- + assist2.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_9X9, assist2, true);
- +
- + if (assist3 != null && assist3.isOnline())
- + assist3.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_9X9, assist3, true);
- +
- + if (assist4 != null && assist4.isOnline())
- + assist4.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_9X9, assist4, true);
- +
- + if (assist5 != null && assist5.isOnline())
- + assist5.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_9X9, assist5, true);
- +
- + if (assist6 != null && assist6.isOnline())
- + assist6.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_9X9, assist6, true);
- +
- + if (assist7 != null && assist7.isOnline())
- + assist7.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_9X9, assist7, true);
- +
- + if (assist8 != null && assist8.isOnline())
- + assist8.addItem("Arena_Event", Config.ARENA_REWARD_ID, Config.ARENA_LOST_REWARD_COUNT_9X9, assist8, true);
- + sendPacket("your team lost the event! =(", 5);
- + }
- +
- + public void setInTournamentEvent(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + leader.setInArenaEvent(val);
- + if (assist != null && assist.isOnline())
- + assist.setInArenaEvent(val);
- + if (assist2 != null && assist2.isOnline())
- + assist2.setInArenaEvent(val);
- + if (assist3 != null && assist3.isOnline())
- + assist3.setInArenaEvent(val);
- + if (assist4 != null && assist4.isOnline())
- + assist4.setInArenaEvent(val);
- + if (assist5 != null && assist5.isOnline())
- + assist5.setInArenaEvent(val);
- + if (assist6 != null && assist6.isOnline())
- + assist6.setInArenaEvent(val);
- + if (assist7 != null && assist7.isOnline())
- + assist7.setInArenaEvent(val);
- + if (assist8 != null && assist8.isOnline())
- + assist8.setInArenaEvent(val);
- + }
- +
- + public void removeMessage()
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.sendMessage("Tournament: Your participation has been removed.");
- + leader.setArenaProtection(false);
- + leader.setArena9x9(false);
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.sendMessage("Tournament: Your participation has been removed.");
- + assist.setArenaProtection(false);
- + assist.setArena9x9(false);
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.sendMessage("Tournament: Your participation has been removed.");
- + assist2.setArenaProtection(false);
- + assist2.setArena9x9(false);
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.sendMessage("Tournament: Your participation has been removed.");
- + assist3.setArenaProtection(false);
- + assist3.setArena9x9(false);
- + }
- +
- + if (assist4 != null && assist4.isOnline())
- + {
- + assist4.sendMessage("Tournament: Your participation has been removed.");
- + assist4.setArenaProtection(false);
- + assist4.setArena9x9(false);
- + }
- +
- + if (assist5 != null && assist5.isOnline())
- + {
- + assist5.sendMessage("Tournament: Your participation has been removed.");
- + assist5.setArenaProtection(false);
- + assist5.setArena9x9(false);
- + }
- +
- + if (assist6 != null && assist6.isOnline())
- + {
- + assist6.sendMessage("Tournament: Your participation has been removed.");
- + assist6.setArenaProtection(false);
- + assist6.setArena9x9(false);
- + }
- +
- + if (assist7 != null && assist7.isOnline())
- + {
- + assist7.sendMessage("Tournament: Your participation has been removed.");
- + assist7.setArenaProtection(false);
- + assist7.setArena9x9(false);
- + }
- +
- + if (assist8 != null && assist8.isOnline())
- + {
- + assist8.sendMessage("Tournament: Your participation has been removed.");
- + assist8.setArenaProtection(false);
- + assist8.setArena9x9(false);
- + }
- + }
- +
- + public void setArenaProtection(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setArenaProtection(val);
- + leader.setArena9x9(val);
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setArenaProtection(val);
- + assist.setArena9x9(val);
- + }
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.setArenaProtection(val);
- + assist2.setArena9x9(val);
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.setArenaProtection(val);
- + assist3.setArena9x9(val);
- + }
- +
- + if (assist4 != null && assist4.isOnline())
- + {
- + assist4.setArenaProtection(val);
- + assist4.setArena9x9(val);
- + }
- +
- + if (assist5 != null && assist5.isOnline())
- + {
- + assist5.setArenaProtection(val);
- + assist5.setArena9x9(val);
- + }
- +
- + if (assist6 != null && assist6.isOnline())
- + {
- + assist6.setArenaProtection(val);
- + assist6.setArena9x9(val);
- + }
- +
- + if (assist7 != null && assist7.isOnline())
- + {
- + assist7.setArenaProtection(val);
- + assist7.setArena9x9(val);
- + }
- +
- + if (assist8 != null && assist8.isOnline())
- + {
- + assist8.setArenaProtection(val);
- + assist8.setArena9x9(val);
- + }
- + }
- +
- + public void revive()
- + {
- + if (leader != null && leader.isOnline() && leader.isDead())
- + leader.doRevive();
- + if (assist != null && assist.isOnline() && assist.isDead())
- + assist.doRevive();
- + if (assist2 != null && assist2.isOnline() && assist2.isDead())
- + assist2.doRevive();
- + if (assist3 != null && assist3.isOnline() && assist3.isDead())
- + assist3.doRevive();
- + if (assist4 != null && assist4.isOnline() && assist4.isDead())
- + assist4.doRevive();
- + if (assist5 != null && assist5.isOnline() && assist5.isDead())
- + assist5.doRevive();
- + if (assist6 != null && assist6.isOnline() && assist6.isDead())
- + assist6.doRevive();
- + if (assist7 != null && assist7.isOnline() && assist7.isDead())
- + assist7.doRevive();
- + if (assist8 != null && assist8.isOnline() && assist8.isDead())
- + assist8.doRevive();
- + }
- +
- + public void setImobilised(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setIsInvul(val);
- + leader.setStopArena(val);
- + }
- + if (assist != null && assist.isOnline())
- + {
- + assist.setIsInvul(val);
- + assist.setStopArena(val);
- + }
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.setIsInvul(val);
- + assist2.setStopArena(val);
- + }
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.setIsInvul(val);
- + assist3.setStopArena(val);
- + }
- + if (assist4 != null && assist4.isOnline())
- + {
- + assist4.setIsInvul(val);
- + assist4.setStopArena(val);
- + }
- + if (assist5 != null && assist5.isOnline())
- + {
- + assist5.setIsInvul(val);
- + assist5.setStopArena(val);
- + }
- + if (assist6 != null && assist6.isOnline())
- + {
- + assist6.setIsInvul(val);
- + assist6.setStopArena(val);
- + }
- + if (assist7 != null && assist7.isOnline())
- + {
- + assist7.setIsInvul(val);
- + assist7.setStopArena(val);
- + }
- + if (assist8 != null && assist8.isOnline())
- + {
- + assist8.setIsInvul(val);
- + assist8.setStopArena(val);
- + }
- + }
- +
- + public void setArenaAttack(boolean val)
- + {
- + if (leader != null && leader.isOnline())
- + {
- + leader.setArenaAttack(val);
- + leader.broadcastUserInfo();
- + }
- +
- + if (assist != null && assist.isOnline())
- + {
- + assist.setArenaAttack(val);
- + assist.broadcastUserInfo();
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- + assist2.setArenaAttack(val);
- + assist2.broadcastUserInfo();
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- + assist3.setArenaAttack(val);
- + assist3.broadcastUserInfo();
- + }
- +
- + if (assist4 != null && assist4.isOnline())
- + {
- + assist4.setArenaAttack(val);
- + assist4.broadcastUserInfo();
- + }
- +
- + if (assist5 != null && assist5.isOnline())
- + {
- + assist5.setArenaAttack(val);
- + assist5.broadcastUserInfo();
- + }
- +
- + if (assist6 != null && assist6.isOnline())
- + {
- + assist6.setArenaAttack(val);
- + assist6.broadcastUserInfo();
- + }
- +
- + if (assist7 != null && assist7.isOnline())
- + {
- + assist7.setArenaAttack(val);
- + assist7.broadcastUserInfo();
- + }
- +
- + if (assist8 != null && assist8.isOnline())
- + {
- + assist8.setArenaAttack(val);
- + assist8.broadcastUserInfo();
- + }
- + }
- +
- + public void removePet()
- + {
- + if (leader != null && leader.isOnline())
- + {
- +
- + if (leader.getSummon() != null)
- + {
- + Summon summon = leader.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(leader);
- + }
- + if (leader.getMountType() == 1 || leader.getMountType() == 2)
- + leader.dismount();
- + }
- + if (assist != null && assist.isOnline())
- + {
- +
- + if (assist.getSummon() != null)
- + {
- + Summon summon = assist.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist);
- + }
- + if (assist.getMountType() == 1 || assist.getMountType() == 2)
- + assist.dismount();
- + }
- +
- + if (assist2 != null && assist2.isOnline())
- + {
- +
- + if (assist2.getSummon() != null)
- + {
- + Summon summon = assist2.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist2);
- + }
- +
- + if (assist2.getMountType() == 1 || assist2.getMountType() == 2)
- + assist2.dismount();
- + }
- +
- + if (assist3 != null && assist3.isOnline())
- + {
- +
- + if (assist3.getSummon() != null)
- + {
- + Summon summon = assist3.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist3);
- + }
- + if (assist3.getMountType() == 1 || assist3.getMountType() == 2)
- + assist3.dismount();
- + }
- +
- + if (assist4 != null && assist4.isOnline())
- + {
- +
- + if (assist4.getSummon() != null)
- + {
- + Summon summon = assist4.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist4);
- + }
- +
- + if (assist4.getMountType() == 1 || assist4.getMountType() == 2)
- + assist4.dismount();
- + }
- +
- + if (assist5 != null && assist5.isOnline())
- + {
- +
- + if (assist5.getSummon() != null)
- + {
- + Summon summon = assist5.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist5);
- + }
- +
- + if (assist5.getMountType() == 1 || assist5.getMountType() == 2)
- + assist5.dismount();
- + }
- +
- + if (assist6 != null && assist6.isOnline())
- + {
- +
- + if (assist6.getSummon() != null)
- + {
- + Summon summon = assist6.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist6);
- + }
- + if (assist6.getMountType() == 1 || assist6.getMountType() == 2)
- + assist6.dismount();
- + }
- +
- + if (assist7 != null && assist7.isOnline())
- + {
- +
- + if (assist7.getSummon() != null)
- + {
- + Summon summon = assist7.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist7);
- + }
- +
- + if (assist7.getMountType() == 1 || assist7.getMountType() == 2)
- + assist7.dismount();
- + }
- +
- + if (assist8 != null && assist8.isOnline())
- + {
- +
- + if (assist8.getSummon() != null)
- + {
- + Summon summon = assist8.getSummon();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- + if (summon instanceof Pet)
- + summon.unSummon(assist8);
- + }
- +
- + if (assist8.getMountType() == 1 || assist8.getMountType() == 2)
- + assist8.dismount();
- + }
- + }
- +
- + public void removeSkills()
- + {
- + if (leader.getClassId() != ClassId.SHILLIEN_ELDER && leader.getClassId() != ClassId.SHILLIEN_SAINT && leader.getClassId() != ClassId.BISHOP && leader.getClassId() != ClassId.CARDINAL && leader.getClassId() != ClassId.ELVEN_ELDER && leader.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : leader.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + leader.stopSkillEffects(effect.getSkill().getId());
- + if (assist.getClassId() != ClassId.SHILLIEN_ELDER && assist.getClassId() != ClassId.SHILLIEN_SAINT && assist.getClassId() != ClassId.BISHOP && assist.getClassId() != ClassId.CARDINAL && assist.getClassId() != ClassId.ELVEN_ELDER && assist.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : assist.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist.stopSkillEffects(effect.getSkill().getId());
- + if (assist2.getClassId() != ClassId.SHILLIEN_ELDER && assist2.getClassId() != ClassId.SHILLIEN_SAINT && assist2.getClassId() != ClassId.BISHOP && assist2.getClassId() != ClassId.CARDINAL && assist2.getClassId() != ClassId.ELVEN_ELDER && assist2.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : assist2.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist2.stopSkillEffects(effect.getSkill().getId());
- + if (assist3.getClassId() != ClassId.SHILLIEN_ELDER && assist3.getClassId() != ClassId.SHILLIEN_SAINT && assist3.getClassId() != ClassId.BISHOP && assist3.getClassId() != ClassId.CARDINAL && assist3.getClassId() != ClassId.ELVEN_ELDER && assist3.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : assist3.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist3.stopSkillEffects(effect.getSkill().getId());
- + if (assist4.getClassId() != ClassId.SHILLIEN_ELDER && assist4.getClassId() != ClassId.SHILLIEN_SAINT && assist4.getClassId() != ClassId.BISHOP && assist4.getClassId() != ClassId.CARDINAL && assist4.getClassId() != ClassId.ELVEN_ELDER && assist4.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : assist4.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist4.stopSkillEffects(effect.getSkill().getId());
- + if (assist5.getClassId() != ClassId.SHILLIEN_ELDER && assist5.getClassId() != ClassId.SHILLIEN_SAINT && assist5.getClassId() != ClassId.BISHOP && assist5.getClassId() != ClassId.CARDINAL && assist5.getClassId() != ClassId.ELVEN_ELDER && assist5.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : assist5.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist5.stopSkillEffects(effect.getSkill().getId());
- + if (assist6.getClassId() != ClassId.SHILLIEN_ELDER && assist6.getClassId() != ClassId.SHILLIEN_SAINT && assist6.getClassId() != ClassId.BISHOP && assist6.getClassId() != ClassId.CARDINAL && assist6.getClassId() != ClassId.ELVEN_ELDER && assist6.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : assist6.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist6.stopSkillEffects(effect.getSkill().getId());
- + if (assist7.getClassId() != ClassId.SHILLIEN_ELDER && assist7.getClassId() != ClassId.SHILLIEN_SAINT && assist7.getClassId() != ClassId.BISHOP && assist7.getClassId() != ClassId.CARDINAL && assist7.getClassId() != ClassId.ELVEN_ELDER && assist7.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : assist7.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist7.stopSkillEffects(effect.getSkill().getId());
- + if (assist8.getClassId() != ClassId.SHILLIEN_ELDER && assist8.getClassId() != ClassId.SHILLIEN_SAINT && assist8.getClassId() != ClassId.BISHOP && assist8.getClassId() != ClassId.CARDINAL && assist8.getClassId() != ClassId.ELVEN_ELDER && assist8.getClassId() != ClassId.EVAS_SAINT)
- + for (L2Effect effect : assist8.getAllEffects())
- + if (Config.ARENA_STOP_SKILL_LIST.contains(Integer.valueOf(effect.getSkill().getId())))
- + assist8.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + public void sendPacket(String message, int duration)
- + {
- + if (leader != null && leader.isOnline())
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist != null && assist.isOnline())
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist2 != null && assist2.isOnline())
- + assist2.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist3 != null && assist3.isOnline())
- + assist3.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist4 != null && assist4.isOnline())
- + assist4.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist5 != null && assist5.isOnline())
- + assist5.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist6 != null && assist6.isOnline())
- + assist6.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist7 != null && assist7.isOnline())
- + assist7.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + if (assist8 != null && assist8.isOnline())
- + assist8.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + }
- +
- + public void inicarContagem(int duration)
- + {
- + if (leader != null && leader.isOnline())
- + ThreadPool.schedule(new Arena9x9.countdown(leader, duration), 0L);
- + if (assist != null && assist.isOnline())
- + ThreadPool.schedule(new Arena9x9.countdown(assist, duration), 0L);
- + if (assist2 != null && assist2.isOnline())
- + ThreadPool.schedule(new Arena9x9.countdown(assist2, duration), 0L);
- + if (assist3 != null && assist3.isOnline())
- + ThreadPool.schedule(new Arena9x9.countdown(assist3, duration), 0L);
- + if (assist4 != null && assist4.isOnline())
- + ThreadPool.schedule(new Arena9x9.countdown(assist4, duration), 0L);
- + if (assist5 != null && assist5.isOnline())
- + ThreadPool.schedule(new Arena9x9.countdown(assist5, duration), 0L);
- + if (assist6 != null && assist6.isOnline())
- + ThreadPool.schedule(new Arena9x9.countdown(assist6, duration), 0L);
- + if (assist7 != null && assist7.isOnline())
- + ThreadPool.schedule(new Arena9x9.countdown(assist7, duration), 0L);
- + if (assist8 != null && assist8.isOnline())
- + ThreadPool.schedule(new Arena9x9.countdown(assist8, duration), 0L);
- + }
- +
- + public void sendPacketinit(String message, int duration)
- + {
- + if (leader != null && leader.isOnline())
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if (assist != null && assist.isOnline())
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if (assist2 != null && assist2.isOnline())
- + assist2.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if (assist3 != null && assist3.isOnline())
- + assist3.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if (assist4 != null && assist4.isOnline())
- + assist4.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if (assist5 != null && assist5.isOnline())
- + assist5.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if (assist6 != null && assist6.isOnline())
- + assist6.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if (assist7 != null && assist7.isOnline())
- + assist7.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + if (assist8 != null && assist8.isOnline())
- + assist8.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + }
- + }
- +
- + private class EvtArenaTask implements Runnable
- + {
- + private final Arena9x9.Pair pairOne;
- + private final Arena9x9.Pair pairTwo;
- + private final int pOneX;
- + private final int pOneY;
- + private final int pOneZ;
- + private final int pTwoX;
- + private final int pTwoY;
- + private final int pTwoZ;
- + private Arena9x9.Arena arena;
- +
- + public EvtArenaTask(List<Pair> opponents)
- + {
- + pairOne = opponents.get(0);
- + pairTwo = opponents.get(1);
- + Player leader = pairOne.getLeader();
- + pOneX = leader.getX();
- + pOneY = leader.getY();
- + pOneZ = leader.getZ();
- + leader = pairTwo.getLeader();
- + pTwoX = leader.getX();
- + pTwoY = leader.getY();
- + pTwoZ = leader.getZ();
- + }
- +
- + @Override
- + public void run()
- + {
- + free -= 1;
- + pairOne.saveTitle();
- + pairTwo.saveTitle();
- + portPairsToArena();
- + pairOne.inicarContagem(Config.ARENA_WAIT_INTERVAL_9X9);
- + pairTwo.inicarContagem(Config.ARENA_WAIT_INTERVAL_9X9);
- + try
- + {
- + Thread.sleep(Config.ARENA_WAIT_INTERVAL_9X9 * 1000);
- + }
- + catch (InterruptedException localInterruptedException1)
- + {
- + }
- +
- + pairOne.sendPacketinit("Started. Good Fight!", 3);
- + pairTwo.sendPacketinit("Started. Good Fight!", 3);
- + pairOne.EventTitle(Config.MSG_TEAM1, Config.TITLE_COLOR_TEAM1);
- + pairTwo.EventTitle(Config.MSG_TEAM2, Config.TITLE_COLOR_TEAM2);
- + pairOne.setImobilised(false);
- + pairTwo.setImobilised(false);
- + pairOne.setArenaAttack(true);
- + pairTwo.setArenaAttack(true);
- + while (check())
- + try
- + {
- +
- + Thread.sleep(Config.ARENA_CHECK_INTERVAL);
- + }
- + catch (InterruptedException e)
- + {
- + }
- +
- + this.finishDuel();
- + final Arena9x9 this$2 = Arena9x9.this;
- + ++this$2.free;
- + }
- +
- + private void finishDuel()
- + {
- + fights.remove(Integer.valueOf(arena.id));
- + rewardWinner();
- + pairOne.revive();
- + pairTwo.revive();
- + pairOne.teleportTo(pOneX, pOneY, pOneZ);
- + pairTwo.teleportTo(pTwoX, pTwoY, pTwoZ);
- + pairOne.backTitle();
- + pairTwo.backTitle();
- + pairOne.setInTournamentEvent(false);
- + pairTwo.setInTournamentEvent(false);
- + pairOne.setArenaProtection(false);
- + pairTwo.setArenaProtection(false);
- + pairOne.setArenaAttack(false);
- + pairTwo.setArenaAttack(false);
- + arena.setFree(true);
- + }
- +
- + private void rewardWinner()
- + {
- + if (pairOne.isAlive() && !pairTwo.isAlive())
- + {
- + Player leader1 = pairOne.getLeader();
- + Player leader2 = pairTwo.getLeader();
- +
- + if (leader1.getClan() != null && leader2.getClan() != null && Config.TOURNAMENT_EVENT_ANNOUNCE)
- +
- + World.announceToOnlinePlayers("[9x9]: (" + leader1.getClan().getName() + " VS " + leader2.getClan().getName() + ") ~> " + leader1.getClan().getName() + " win!");
- +
- +
- + pairOne.rewards();
- + pairTwo.rewardsLost();
- + }
- + else if (pairTwo.isAlive() && !pairOne.isAlive())
- + {
- + Player leader1 = pairTwo.getLeader();
- + Player leader2 = pairOne.getLeader();
- +
- + if (leader1.getClan() != null && leader2.getClan() != null && Config.TOURNAMENT_EVENT_ANNOUNCE)
- +
- +
- + World.announceToOnlinePlayers("[9x9]: (" + leader1.getClan().getName() + " VS " + leader2.getClan().getName() + ") ~> " + leader1.getClan().getName() + " win!");
- +
- + pairTwo.rewards();
- + pairOne.rewardsLost();
- + }
- + }
- +
- + private boolean check()
- + {
- + return pairOne.isDead() && pairTwo.isDead();
- + }
- +
- + private void portPairsToArena()
- + {
- + for (Arena9x9.Arena arena : arenas)
- + if (arena.isFree)
- + {
- + this.arena = arena;
- + arena.setFree(false);
- + pairOne.removePet();
- + pairTwo.removePet();
- + pairOne.teleportTo(arena.x - 850, arena.y, arena.z);
- + pairTwo.teleportTo(arena.x + 850, arena.y, arena.z);
- + pairOne.setImobilised(true);
- + pairTwo.setImobilised(true);
- + pairOne.setInTournamentEvent(true);
- + pairTwo.setInTournamentEvent(true);
- + pairOne.removeSkills();
- + pairTwo.removeSkills();
- + fights.put(Integer.valueOf(this.arena.id), pairOne.getLeader().getName() + " vs " + pairTwo.getLeader().getName());
- + break;
- + }
- + }
- + }
- +
- + private class Arena
- + {
- + protected int x;
- + protected int y;
- + protected int z;
- + protected boolean isFree = true;
- + int id;
- +
- + public Arena(int id, int x, int y, int z)
- + {
- + this.id = id;
- + this.x = x;
- + this.y = y;
- + this.z = z;
- + }
- +
- + public void setFree(boolean val)
- + {
- + isFree = val;
- + }
- + }
- +
- + protected class countdown implements Runnable
- + {
- + private final Player _player;
- + private final int _time;
- +
- + public countdown(Player player, int time)
- + {
- + _time = time;
- + _player = player;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_player.isOnline())
- + {
- +
- + switch (_time)
- + {
- + case 60:
- + case 120:
- + case 180:
- + case 240:
- + case 300:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in " + _time + " second(s)..", 4000));
- + _player.sendMessage(_time + " second(s) to start the battle.");
- + _player.setIsParalyzed(true);
- + }
- + break;
- + case 45:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 1));
- + }
- + break;
- + case 27:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in 30 second(s)..", 4000));
- + _player.sendMessage("30 second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 2));
- + }
- + break;
- + case 20:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- +
- + }
- + break;
- + case 15:
- + if (_player.isOnline())
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 9));
- + }
- + break;
- + case 10:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + _player.broadcastPacket(new SocialAction(_player, 5));
- + break;
- + case 5:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 4:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 3:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 2:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(true);
- + break;
- + case 1:
- + if (_player.isOnline())
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + _player.setIsParalyzed(false);
- + break;
- + }
- + if (_time > 1)
- + ThreadPool.schedule(new countdown(_player, _time - 1), 1000L);
- + }
- + }
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final Arena9x9 INSTANCE = new Arena9x9();
- + }
- + }
- +
- Index: package l2jban.events;ArenaEvent.java
- ===================================================================
- --- package l2jban.events;ArenaEvent.java (revision 84)
- +++ package l2jban.events;ArenaEvent.java (working copy)
- + package l2jban.events;
- +
- + import java.text.SimpleDateFormat;
- + import java.util.Calendar;
- + import java.util.logging.Logger;
- +
- + import net.sf.l2j.commons.concurrent.ThreadPool;
- +
- + import net.sf.l2j.Config;
- +
- + public class ArenaEvent
- + {
- + private static ArenaEvent _instance = null;
- + protected static final Logger _log = Logger.getLogger(ArenaEvent.class.getName());
- + private Calendar NextEvent;
- + private final SimpleDateFormat format = new SimpleDateFormat("HH:mm");
- +
- + public static ArenaEvent getInstance()
- + {
- + if (_instance == null)
- + _instance = new ArenaEvent();
- + return _instance;
- + }
- +
- + public String getNextTime()
- + {
- + if (NextEvent.getTime() != null)
- + return format.format(NextEvent.getTime());
- + return "Erro";
- + }
- +
- + public void StartCalculationOfNextEventTime()
- + {
- + try
- + {
- + Calendar currentTime = Calendar.getInstance();
- + Calendar testStartTime = null;
- + long flush2 = 0L;
- + long timeL = 0L;
- + int count = 0;
- + for (String timeOfDay : Config.TOURNAMENT_EVENT_INTERVAL_BY_TIME_OF_DAY)
- + {
- + testStartTime = Calendar.getInstance();
- + testStartTime.setLenient(true);
- + String[] splitTimeOfDay = timeOfDay.split(":");
- + testStartTime.set(11, Integer.parseInt(splitTimeOfDay[0]));
- + testStartTime.set(12, Integer.parseInt(splitTimeOfDay[1]));
- + testStartTime.set(13, 0);
- + if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis())
- + testStartTime.add(5, 1);
- + timeL = testStartTime.getTimeInMillis() - currentTime.getTimeInMillis();
- + if (count == 0)
- + {
- + flush2 = timeL;
- + NextEvent = testStartTime;
- + }
- + if (timeL < flush2)
- + {
- + flush2 = timeL;
- + NextEvent = testStartTime;
- + }
- + count++;
- + }
- + _log.info("[Tournament]: Proximo Evento: " + NextEvent.getTime().toString());
- + ThreadPool.schedule(new StartEventTask(), flush2);
- + }
- + catch (Exception e)
- + {
- + System.out.println("[Tournament]: " + e);
- + }
- + }
- +
- + class StartEventTask implements Runnable
- + {
- + StartEventTask()
- + {
- + }
- +
- + @Override
- + public void run()
- + {
- + ArenaEvent._log.info("----------------------------------------------------------------------------");
- + ArenaEvent._log.info("[Tournament]: Event Started.");
- + ArenaEvent._log.info("----------------------------------------------------------------------------");
- + ArenaTask.SpawnEvent();
- + }
- + }
- + }
- +
- Index: package l2jban.events;ArenaTask.java
- ===================================================================
- --- package l2jban.events;ArenaTask.java (revision 84)
- +++ package l2jban.events;ArenaTask.java (working copy)
- + package l2jban.events;
- +
- + import net.sf.l2j.commons.concurrent.ThreadPool;
- +
- + import net.sf.l2j.Config;
- + import net.sf.l2j.gameserver.data.ItemTable;
- + import l2jban.events.Arena2x2;
- + import net.sf.l2j.gameserver.model.World;
- + import net.sf.l2j.gameserver.model.actor.Player;
- + import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
- + import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
- + import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
- +
- + import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminCustom;
- + import net.sf.l2j.gameserver.model.spawn.L2Spawn;
- + import net.sf.l2j.gameserver.data.sql.SpawnTable;
- + import net.sf.l2j.gameserver.data.xml.NpcData;
- +
- + public abstract class ArenaTask
- + {
- + public static L2Spawn _npcSpawn1;
- + public static L2Spawn _npcSpawn2;
- + public static int _bossHeading = 0;
- + public static boolean _started = false;
- + public static boolean _aborted = false;
- +
- + public static void SpawnEvent()
- + {
- + spawnNpc1();
- +
- +
- + World.announceToOnlinePlayers("Reward: " + ItemTable.getInstance().getTemplate(Config.ARENA_REWARD_ID).getName());
- +
- + World.announceToOnlinePlayers("[Tournament]: Party Event PvP");
- + World.announceToOnlinePlayers("[Tournament]: Teleport in the GK to (Tournament) Zone");
- + World.announceToOnlinePlayers("[Tournament]: Duration: " + Config.TOURNAMENT_TIME + " minute(s)!");
- +
- +
- + _aborted = false;
- + _started = true;
- +
- + waiter(Config.TOURNAMENT_TIME * 60 * 1000);
- + if (!_aborted)
- + finishEvent();
- + }
- +
- + public static void finishEvent()
- + {
- +
- +
- + World.announceToOnlinePlayers("[Tournament]: Event Finished!");
- +
- + unspawnNpc1();
- + _started = false;
- + if (!AdminCustom._arena_manual)
- + ArenaEvent.getInstance().StartCalculationOfNextEventTime();
- + else
- + AdminCustom._arena_manual = false;
- + for (Player player : World.getInstance().getPlayers())
- + if (player != null && player.isOnline())
- + {
- + if (player.isArenaProtection())
- + ThreadPool.schedule(new Runnable()
- + {
- + @Override
- + public void run()
- + {
- + if (player.isOnline() && !player.isInArenaEvent() && !player.isArenaAttack())
- + {
- + Arena4x4.getInstance().remove(player);
- + Arena9x9.getInstance().remove(player);
- + Arena2x2.getInstance().remove(player);
- + player.setArenaProtection(false);
- +
- +
- + }
- + }
- + }, 25000L);
- + CreatureSay cs = new CreatureSay(player.getObjectId(), 3, "[Tournament]", "Next Tournament: " + ArenaEvent.getInstance().getNextTime() + " (GMT-3).");
- + player.sendPacket(cs);
- + }
- + }
- +
- + public static void spawnNpc1()
- + {
- +
- + NpcTemplate template = NpcData.getInstance().getTemplate(Config.ARENA_NPC);
- + try
- + {
- + _npcSpawn1 = new L2Spawn(template);
- + _npcSpawn1.setLoc(loc1x(), loc1y(), loc1z(), Config.NPC_Heading);
- + _npcSpawn1.setRespawnDelay(1);
- +
- + SpawnTable.getInstance().addSpawn(_npcSpawn1, false);
- +
- + _npcSpawn1.setRespawnState(true);
- + _npcSpawn1.doSpawn(false);
- + _npcSpawn1.getNpc().getStatus().setCurrentHp(9.99999999E8);
- + _npcSpawn1.getNpc().isAggressive();
- + _npcSpawn1.getNpc().decayMe();
- + _npcSpawn1.getNpc().spawnMe(_npcSpawn1.getNpc().getX(), _npcSpawn1.getNpc().getY(), _npcSpawn1.getNpc().getZ());
- + _npcSpawn1.getNpc().broadcastPacket(new MagicSkillUse(_npcSpawn1.getNpc(), _npcSpawn1.getNpc(), 1034, 1, 1, 1));
- + }
- + catch (Exception e)
- + {
- + e.printStackTrace();
- + }
- + }
- +
- + public static void spawnNpc2() {
- + final NpcTemplate tmpl = NpcData.getInstance().getTemplate(Config.ARENA_NPC);
- + try {
- + (ArenaTask._npcSpawn2 = new L2Spawn(tmpl)).setLoc(loc2x(), loc2y(), loc2z(), Config.NPC_Heading);
- + ArenaTask._npcSpawn2.setRespawnDelay(1);
- + SpawnTable.getInstance().addSpawn(ArenaTask._npcSpawn2, false);
- + ArenaTask._npcSpawn2.setRespawnState(true);
- + ArenaTask._npcSpawn2.doSpawn(false);
- + ArenaTask._npcSpawn2.getNpc().getStatus().setCurrentHp(9.99999999E8);
- + ArenaTask._npcSpawn2.getNpc().isAggressive();
- + ArenaTask._npcSpawn2.getNpc().decayMe();
- + ArenaTask._npcSpawn2.getNpc().spawnMe(ArenaTask._npcSpawn2.getNpc().getX(), ArenaTask._npcSpawn2.getNpc().getY(), ArenaTask._npcSpawn2.getNpc().getZ());
- + ArenaTask._npcSpawn2.getNpc().broadcastPacket(new MagicSkillUse(ArenaTask._npcSpawn2.getNpc(), ArenaTask._npcSpawn2.getNpc(), 1034, 1, 1, 1));
- + }
- + catch (Exception e) {
- + e.printStackTrace();
- + }
- + }
- +
- + public static boolean is_started()
- + {
- + return _started;
- + }
- +
- + public static void unspawnNpc1()
- + {
- + if (_npcSpawn1 == null)
- + return;
- + _npcSpawn1.getNpc().deleteMe();
- + _npcSpawn1.setRespawnState(false);
- + SpawnTable.getInstance().deleteSpawn(_npcSpawn1, true);
- + }
- +
- + public static void unspawnNpc2()
- + {
- + if (_npcSpawn2 == null)
- + return;
- + _npcSpawn2.getNpc().deleteMe();
- + _npcSpawn2.setRespawnState(false);
- + SpawnTable.getInstance().deleteSpawn(_npcSpawn2, true);
- + }
- +
- + public static int loc1x()
- + {
- + int loc1x = Config.NPC_locx;
- + return loc1x;
- + }
- +
- + public static int loc1y()
- + {
- + int loc1y = Config.NPC_locy;
- + return loc1y;
- + }
- +
- + public static int loc1z()
- + {
- + int loc1z = Config.NPC_locz;
- + return loc1z;
- + }
- +
- + public static int loc2x() {
- + final int loc2x = Config.NPC_locx;
- + return loc2x;
- + }
- +
- + public static int loc2y() {
- + final int loc2y = Config.NPC_locy;
- + return loc2y;
- + }
- +
- + public static int loc2z() {
- + final int loc2z = Config.NPC_locz;
- + return loc2z;
- + }
- +
- + protected static void waiter(long interval)
- + {
- + long startWaiterTime = System.currentTimeMillis();
- + int seconds = (int) (interval / 1000L);
- + while (startWaiterTime + interval > System.currentTimeMillis() && !_aborted)
- + {
- + seconds--;
- + switch (seconds)
- + {
- + case 3600:
- + if (_started)
- + {
- +
- + World.announceToOnlinePlayers("[Tournament]: Party Event PvP");
- + World.announceToOnlinePlayers("[Tournament]: Teleport in the GK to (Tournament) Zone");
- + World.announceToOnlinePlayers("[Tournament]: Reward: " + ItemTable.getInstance().getTemplate(Config.ARENA_REWARD_ID).getName());
- + World.announceToOnlinePlayers("[Tournament]: " + seconds / 60 / 60 + " hour(s) till event finish!");
- + }
- + break;
- + case 60:
- + case 120:
- + case 180:
- + case 240:
- + case 300:
- + case 600:
- + case 900:
- + case 1800:
- + if (_started)
- + World.announceToOnlinePlayers("[Tournament]: " + seconds / 60 + " minute(s) till event finish!");
- + break;
- + case 1:
- + case 2:
- + case 3:
- + case 10:
- + case 15:
- + case 30:
- + if (_started)
- + World.announceToOnlinePlayers("[Tournament]: " + seconds + " second(s) till event finish!");
- + break;
- + }
- + long startOneSecondWaiterStartTime = System.currentTimeMillis();
- + while (startOneSecondWaiterStartTime + 1000L > System.currentTimeMillis())
- + try
- + {
- + Thread.sleep(1L);
- + }
- + catch (InterruptedException ex) {}
- + }
- + }
- + static {
- + ArenaTask._bossHeading = 0;
- + ArenaTask._started = false;
- + ArenaTask._aborted = false;
- + }
- + }
- +
- Index: package model/actor/plyer.java
- ===================================================================
- --- package model/actor/plyer.java (revision 84)
- +++ package model/actor/plyer.java (working copy)
- + public int _originalTitleColorTournament = 0;
- + public String _originalTitleTournament;
- +
- + public int duelist_cont = 0;
- + public int dreadnought_cont = 0;
- + public int tanker_cont = 0;
- + public int dagger_cont = 0;
- + public int archer_cont = 0;
- + public int bs_cont = 0;
- + public int archmage_cont = 0;
- + public int soultaker_cont = 0;
- + public int mysticMuse_cont = 0;
- + public int stormScreamer_cont = 0;
- + public int titan_cont = 0;
- + public int grandKhauatari_cont = 0;
- + public int dominator_cont = 0;
- + public int doomcryer_cont = 0;
- +
- +
- + private boolean _TournamentTeleport;
- +
- + public void setTournamentTeleport(boolean comm)
- + {
- + _TournamentTeleport = comm;
- + }
- +
- + public boolean isTournamentTeleport()
- + {
- + return _TournamentTeleport;
- + }
- Index: net.sf.l2j.gameserver.model.zone.type;TournamentZone.java
- ===================================================================
- --- net.sf.l2j.gameserver.model.zone.type;TournamentZone.java (revision 84)
- +++ net.sf.l2j.gameserver.model.zone.type;TournamentZone.java (working copy)
- + package net.sf.l2j.gameserver.model.zone.type;
- +
- + import net.sf.l2j.gameserver.model.actor.Creature;
- + import net.sf.l2j.gameserver.model.actor.Player;
- + import net.sf.l2j.gameserver.enums.actors.ClassId;
- + import net.sf.l2j.gameserver.model.zone.SpawnZoneType;
- +
- + import net.sf.l2j.commons.concurrent.ThreadPool;
- +
- + import net.sf.l2j.gameserver.enums.ZoneId;
- + import net.sf.l2j.gameserver.network.SystemMessageId;
- + import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
- + import net.sf.l2j.gameserver.taskmanager.PvpFlagTaskManager;
- +
- + public class TournamentZone extends SpawnZoneType
- + {
- + public TournamentZone(int id)
- + {
- + super(id);
- + }
- +
- + @Override
- + protected void onEnter(Creature character)
- + {
- + if (character instanceof Player)
- + {
- +
- + Player player = (Player) character;
- + if (player.isArenaProtection())
- + {
- + if (player.getPvpFlag() > 0)
- + PvpFlagTaskManager.getInstance().remove(player);
- + player.updatePvPFlag(1);
- + player.broadcastUserInfo();
- + }
- +
- + {
- + if (character instanceof Player)
- + ((Player) character).sendPacket(SystemMessageId.ENTERED_COMBAT_ZONE);
- + }
- +
- + if (player.getClassId() == ClassId.BISHOP || player.getClassId() == ClassId.CARDINAL || player.getClassId() == ClassId.SHILLIEN_ELDER || player.getClassId() == ClassId.SHILLIEN_SAINT || player.getClassId() == ClassId.EVAS_SAINT || player.getClassId() == ClassId.ELVEN_ELDER || player.getClassId() == ClassId.PROPHET || player.getClassId() == ClassId.HIEROPHANT)
- + {
- + player.sendPacket(new ExShowScreenMessage("Class prohibited at event Tournament", 6000, 2, true));
- + ThreadPool.schedule(new Runnable()
- + {
- + @Override
- + public void run()
- + {
- + if (player.isOnline() && !player.isInsideZone(ZoneId.PEACE))
- + player.teleportTo(83485, 148624, -3402, 50);
- + player.isDead();
- + player.broadcastUserInfo();
- + }
- + }, 4000L);
- + }
- +
- + {
- + character.setInsideZone(ZoneId.TORURNAMENT_ARENA, true);
- + character.setInsideZone(ZoneId.PVP, true);
- + }
- +
- + {
- + if (character instanceof Player)
- + character.setInsideZone(ZoneId.NO_RESTART, true);
- + }
- +
- + {
- + if (character instanceof Player)
- + character.setInsideZone(ZoneId.NO_STORE, true);
- + }
- + }
- +
- + }
- +
- + @Override
- + protected void onExit(Creature character)
- + {
- + character.setInsideZone(ZoneId.TORURNAMENT_ARENA, false);
- + character.setInsideZone(ZoneId.PVP, false);
- +
- + if (character instanceof Player)
- + character.setInsideZone(ZoneId.NO_RESTART, false);
- +
- + if (character instanceof Player)
- + character.setInsideZone(ZoneId.NO_STORE, false);
- +
- + if (character instanceof Player)
- + {
- + Player player = (Player) character;
- + player.updatePvPFlag(0);
- + player.broadcastUserInfo();
- + }
- + if (character instanceof Player)
- + ((Player) character).sendPacket(SystemMessageId.LEFT_COMBAT_ZONE);
- + }
- +
- + }
- +
- Index: net.sf.l2j.gameserver.enums;ZoneId.java
- ===================================================================
- --- net.sf.l2j.gameserver.enums;ZoneId.java (revision 84)
- +++ net.sf.l2j.gameserver.enums;ZoneId.java (working copy)
- - BOSS(19),
- + BOSS(19),
- + TORURNAMENT_ARENA(20),
- Index: net.sf.l2j.gameserver.model.actor.instance;Tournament.java
- ===================================================================
- --- net.sf.l2j.gameserver.model.actor.instance;Tournament.java (revision 84)
- +++ net.sf.l2j.gameserver.model.actor.instance;Tournament.java (working copy)
- + package net.sf.l2j.gameserver.model.actor.instance;
- +
- + import java.util.StringTokenizer;
- +
- + import net.sf.l2j.Config;
- +
- + import l2jban.events.Arena2x2;
- + import l2jban.events.Arena4x4;
- + import l2jban.events.Arena9x9;
- +
- + import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
- + import net.sf.l2j.gameserver.model.group.Party;
- + import net.sf.l2j.gameserver.data.xml.PlayerData;
- + import net.sf.l2j.gameserver.enums.actors.ClassId;
- + import net.sf.l2j.gameserver.model.olympiad.OlympiadManager;
- + import net.sf.l2j.gameserver.network.SystemMessageId;
- + import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
- + import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
- + import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- + import net.sf.l2j.gameserver.model.actor.Player;
- +
- + public class Tournament extends Folk
- + {
- +
- + public Tournament(int objectId, NpcTemplate template)
- + {
- + super(objectId, template);
- + }
- +
- + @Override
- + public void showChatWindow(Player player)
- + {
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + String filename = "data/html/mods/tournament/9996.htm";
- + NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- + html.setFile(filename);
- + html.replace("%objectId%", getObjectId());
- +
- + if (Arena2x2.registered.size() == 0) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena2x2.registered.size() == 1) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_1_over\" fore=\"L2UI_CH3.calculate1_1\">");
- + }
- + else if (Arena2x2.registered.size() == 2) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_2_over\" fore=\"L2UI_CH3.calculate1_2\">");
- + }
- + else if (Arena2x2.registered.size() == 3) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_3_over\" fore=\"L2UI_CH3.calculate1_3\">");
- + }
- + else if (Arena2x2.registered.size() == 4) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_4_over\" fore=\"L2UI_CH3.calculate1_4\">");
- + }
- + else if (Arena2x2.registered.size() == 5) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_5_over\" fore=\"L2UI_CH3.calculate1_5\">");
- + }
- + else if (Arena2x2.registered.size() == 6) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_6_over\" fore=\"L2UI_CH3.calculate1_6\">");
- + }
- + else if (Arena2x2.registered.size() == 7) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_7_over\" fore=\"L2UI_CH3.calculate1_7\">");
- + }
- + else if (Arena2x2.registered.size() == 8) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_8_over\" fore=\"L2UI_CH3.calculate1_8\">");
- + }
- + else if (Arena2x2.registered.size() >= 9) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_9_over\" fore=\"L2UI_CH3.calculate1_9\">");
- + }
- +
- + if (Arena2x2.registered.size() == 0)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 1)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 2)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 3)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 4)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 5)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 6)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 7)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 8)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() >= 9)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- +
- + if (Arena2x2.registered.size() == 0)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 1)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 2)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 3)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 4)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 5)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 6)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 7)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() == 8)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena2x2.registered.size() >= 9)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- +
- +
- + player.sendPacket(html);
- + }
- +
- +
- + public void showChatWindow1(Player player)
- + {
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + String filename = "data/html/mods/tournament/9996.htm";
- + NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- + html.setFile(filename);
- + html.replace("%objectId%", getObjectId());
- +
- +
- +
- + if (Arena4x4.registered.size() == 0)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena4x4.registered.size() == 1)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_1_over\" fore=\"L2UI_CH3.calculate1_1\">");
- + else if (Arena4x4.registered.size() == 2)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_2_over\" fore=\"L2UI_CH3.calculate1_2\">");
- + else if (Arena4x4.registered.size() == 3)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_3_over\" fore=\"L2UI_CH3.calculate1_3\">");
- + else if (Arena4x4.registered.size() == 4)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_4_over\" fore=\"L2UI_CH3.calculate1_4\">");
- + else if (Arena4x4.registered.size() == 5)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_5_over\" fore=\"L2UI_CH3.calculate1_5\">");
- + else if (Arena4x4.registered.size() == 6)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_6_over\" fore=\"L2UI_CH3.calculate1_6\">");
- + else if (Arena4x4.registered.size() == 7)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_7_over\" fore=\"L2UI_CH3.calculate1_7\">");
- + else if (Arena4x4.registered.size() == 8)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_8_over\" fore=\"L2UI_CH3.calculate1_8\">");
- + else if (Arena4x4.registered.size() >= 9)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_9_over\" fore=\"L2UI_CH3.calculate1_9\">");
- +
- + if (Arena4x4.registered.size() == 0) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena4x4.registered.size() == 1) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena4x4.registered.size() == 2) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena4x4.registered.size() == 3) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena4x4.registered.size() == 4) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena4x4.registered.size() == 5) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena4x4.registered.size() == 6) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena4x4.registered.size() == 7) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena4x4.registered.size() == 8) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena4x4.registered.size() >= 9) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- +
- +
- + if (Arena4x4.registered.size() == 0)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena4x4.registered.size() == 1)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena4x4.registered.size() == 2)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena4x4.registered.size() == 3)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena4x4.registered.size() == 4)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena4x4.registered.size() == 5)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena4x4.registered.size() == 6)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena4x4.registered.size() == 7)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena4x4.registered.size() == 8)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena4x4.registered.size() >= 9)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- +
- +
- + player.sendPacket(html);
- + }
- +
- + public void showChatWindow2(Player player)
- + {
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + String filename = "data/html/mods/tournament/9996.htm";
- + NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- + html.setFile(filename);
- + html.replace("%objectId%", getObjectId());
- +
- +
- +
- + if (Arena9x9.registered.size() == 0)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena9x9.registered.size() == 1)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_1_over\" fore=\"L2UI_CH3.calculate1_1\">");
- + else if (Arena9x9.registered.size() == 2)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_2_over\" fore=\"L2UI_CH3.calculate1_2\">");
- + else if (Arena9x9.registered.size() == 3)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_3_over\" fore=\"L2UI_CH3.calculate1_3\">");
- + else if (Arena9x9.registered.size() == 4)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_4_over\" fore=\"L2UI_CH3.calculate1_4\">");
- + else if (Arena9x9.registered.size() == 5)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_5_over\" fore=\"L2UI_CH3.calculate1_5\">");
- + else if (Arena9x9.registered.size() == 6)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_6_over\" fore=\"L2UI_CH3.calculate1_6\">");
- + else if (Arena9x9.registered.size() == 7)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_7_over\" fore=\"L2UI_CH3.calculate1_7\">");
- + else if (Arena9x9.registered.size() == 8)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_8_over\" fore=\"L2UI_CH3.calculate1_8\">");
- + else if (Arena9x9.registered.size() >= 9)
- + html.replace("%9x9%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_9_over\" fore=\"L2UI_CH3.calculate1_9\">");
- +
- + if (Arena9x9.registered.size() == 0) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena9x9.registered.size() == 1) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena9x9.registered.size() == 2) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena9x9.registered.size() == 3) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena9x9.registered.size() == 4) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena9x9.registered.size() == 5) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena9x9.registered.size() == 6) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena9x9.registered.size() == 7) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena9x9.registered.size() == 8) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- + else if (Arena9x9.registered.size() >= 9) {
- + html.replace("%2x2%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + }
- +
- + if (Arena9x9.registered.size() == 0)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena9x9.registered.size() == 1)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena9x9.registered.size() == 2)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena9x9.registered.size() == 3)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena9x9.registered.size() == 4)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena9x9.registered.size() == 5)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena9x9.registered.size() == 6)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena9x9.registered.size() == 7)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena9x9.registered.size() == 8)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena9x9.registered.size() >= 9)
- + html.replace("%4x4%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- +
- +
- + player.sendPacket(html);
- + }
- +
- +
- +
- + @Override
- + public void onBypassFeedback(Player player, String command)
- + {
- + Object className;
- + if (command.startsWith("2x2"))
- + {
- + if (!Config.ALLOW_2X2_REGISTER)
- + {
- + player.sendPacket(SystemMessageId.ACADEMY_LIST_HEADER);
- + return;
- + }
- +
- + if (player.isArena2x2() || player.isArena4x4() || player.isArena9x9() ||player.isArenaProtection())
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return;
- + }
- + if (!player.isInParty())
- + {
- + player.sendMessage("Tournament: You dont have a party.");
- + return;
- + }
- + if (!player.getParty().isLeader(player))
- + {
- + player.sendMessage("Tournament: You are not the party leader!");
- + return;
- + }
- + if (player.getParty().getMembersCount() < 2)
- + {
- + player.sendMessage("Tournament: Your party does not have 2 members.");
- + player.sendPacket(new ExShowScreenMessage("Your party does not have 2 members", 6000));
- + return;
- + }
- + if (player.getParty().getMembersCount() > 2)
- + {
- + player.sendMessage("Tournament: Your Party can not have more than 2 members.");
- + player.sendPacket(new ExShowScreenMessage("Your Party can not have more than 2 members", 6000));
- + return;
- + }
- +
- + Player assist = player.getParty().getMembers().get(1);
- +
- + className = PlayerData.getInstance().getClassNameById(player.getClassId().getId());
- + String assist_className = PlayerData.getInstance().getClassNameById(assist.getClassId().getId());
- +
- +
- +
- + if ((player.getClassId() == ClassId.GLADIATOR || player.getClassId() == ClassId.DUELIST || player.getClassId() == ClassId.GRAND_KHAVATARI || player.getClassId() == ClassId.TYRANT) && (assist.getClassId() == ClassId.GLADIATOR || assist.getClassId() == ClassId.DUELIST || assist.getClassId() == ClassId.GRAND_KHAVATARI || assist.getClassId() == ClassId.TYRANT))
- + {
- + player.sendMessage("Tournament: Only 1 " + (String) className + " / " + assist_className + " allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only 1 " + (String) className + " / " + assist_className + " allowed per party.", 6000));
- + return;
- + }
- + if (assist.getClassId() == ClassId.SHILLIEN_ELDER || assist.getClassId() == ClassId.SHILLIEN_SAINT || assist.getClassId() == ClassId.BISHOP || assist.getClassId() == ClassId.CARDINAL || assist.getClassId() == ClassId.ELVEN_ELDER || assist.getClassId() == ClassId.EVAS_SAINT)
- + {
- + assist.sendMessage("Tournament: Bishop not allowed in Tournament 2x2.");
- + player.sendMessage("Tournament: Bishop not allowed in Tournament 2x2.");
- + return;
- + }
- + if (player.getClassId() == ClassId.SHILLIEN_ELDER || player.getClassId() == ClassId.SHILLIEN_SAINT || player.getClassId() == ClassId.BISHOP || player.getClassId() == ClassId.CARDINAL || player.getClassId() == ClassId.ELVEN_ELDER || player.getClassId() == ClassId.EVAS_SAINT)
- + {
- + assist.sendMessage("Tournament: Bishop not allowed in Tournament 2x2.");
- + player.sendMessage("Tournament: Bishop not allowed in Tournament 2x2.");
- + return;
- + }
- + if (player.isCursedWeaponEquipped() || assist.isCursedWeaponEquipped() || player.isInStoreMode() || assist.isInStoreMode() || player.getKarma() > 0 || assist.getKarma() > 0)
- + {
- + player.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + return;
- + }
- + if (player.getClassId() == assist.getClassId())
- + {
- + player.sendMessage("Tournament: Only 1 " + (String) className + "'s allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only 1 " + (String) className + "'s allowed per party.", 6000));
- + return;
- + }
- + if ((player.getClassId() == ClassId.HAWKEYE || player.getClassId() == ClassId.SAGGITARIUS || player.getClassId() == ClassId.MOONLIGHT_SENTINEL || player.getClassId() == ClassId.SILVER_RANGER || player.getClassId() == ClassId.GHOST_SENTINEL || player.getClassId() == ClassId.PHANTOM_RANGER) && (assist.getClassId() == ClassId.HAWKEYE || assist.getClassId() == ClassId.SAGGITARIUS || assist.getClassId() == ClassId.MOONLIGHT_SENTINEL || assist.getClassId() == ClassId.SILVER_RANGER || assist.getClassId() == ClassId.GHOST_SENTINEL || assist.getClassId() == ClassId.PHANTOM_RANGER))
- + {
- + player.sendMessage("Tournament: Only 1 Acher allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("OOnly 1 Acher allowed per party.", 6000));
- + return;
- + }
- + if ((player.getClassId() == ClassId.ADVENTURER || player.getClassId() == ClassId.TREASURE_HUNTER || player.getClassId() == ClassId.WIND_RIDER || player.getClassId() == ClassId.PLAINS_WALKER || player.getClassId() == ClassId.GHOST_HUNTER || player.getClassId() == ClassId.ABYSS_WALKER) && (assist.getClassId() == ClassId.ADVENTURER || assist.getClassId() == ClassId.TREASURE_HUNTER || assist.getClassId() == ClassId.WIND_RIDER || assist.getClassId() == ClassId.PLAINS_WALKER || assist.getClassId() == ClassId.GHOST_HUNTER || assist.getClassId() == ClassId.ABYSS_WALKER))
- + {
- + player.sendMessage("Tournament: Only 1 Dagger allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("OOnly 1 Dagger allowed per party.", 6000));
- + return;
- + }
- + if (OlympiadManager.getInstance().isRegistered(player) || OlympiadManager.getInstance().isRegistered(assist))
- + {
- + player.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + return;
- + }
- +
- +
- + if (Arena2x2.getInstance().register(player, assist))
- + {
- + player.sendMessage("Tournament: Your participation has been approved.");
- + assist.sendMessage("Tournament: Your participation has been approved.");
- + player.setArenaProtection(true);
- + assist.setArenaProtection(true);
- + player.setArena2x2(true);
- + assist.setArena2x2(true);
- + showChatWindow(player);
- + }
- +
- +
- + else
- + player.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + }else
- + {
- + Object assist2;
- + if (command.startsWith("4x4"))
- + {
- +
- + if (!Config.ALLOW_4X4_REGISTER)
- + {
- + player.sendPacket(SystemMessageId.ACADEMY_LIST_HEADER);
- + return;
- + }
- +
- + if (player.isArena2x2() || player.isArena4x4() || player.isArena9x9() || player.isArenaProtection())
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return;
- + }
- + if (!player.isInParty())
- + {
- + player.sendMessage("Tournament: You dont have a party.");
- + return;
- + }
- + if (!player.getParty().isLeader(player))
- + {
- + player.sendMessage("Tournament: You are not the party leader!");
- + return;
- + }
- + if (player.getParty().getMembersCount() < 4)
- + {
- + player.sendMessage("Tournament: Your party does not have 4 members.");
- + player.sendPacket(new ExShowScreenMessage("Your party does not have 4 members", 6000));
- + return;
- + }
- + if (player.getParty().getMembersCount() > 4)
- + {
- + player.sendMessage("Tournament: Your Party can not have more than 4 members.");
- + player.sendPacket(new ExShowScreenMessage("Your Party can not have more than 4 members", 6000));
- + return;
- + }
- +
- + Player assist = player.getParty().getMembers().get(1);
- + assist2 = player.getParty().getMembers().get(2);
- + Player assist3 = player.getParty().getMembers().get(3);
- +
- + if (player.isCursedWeaponEquipped() || assist.isCursedWeaponEquipped() || ((Player) assist2).isCursedWeaponEquipped() || assist3.isCursedWeaponEquipped() || player.isInStoreMode() || assist.isInStoreMode() || ((Player) assist2).isInStoreMode() || assist3.isInStoreMode() || player.getKarma() > 0 || assist.getKarma() > 0 || ((Player) assist2).getKarma() > 0 || assist3.getKarma() > 0)
- + {
- + player.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + ((Player) assist2).sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist3.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + return;
- + }
- + if (OlympiadManager.getInstance().isRegistered(player) || OlympiadManager.getInstance().isRegistered(assist) || OlympiadManager.getInstance().isRegistered((Player) assist2) || OlympiadManager.getInstance().isRegistered(assist3))
- + {
- + player.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + ((Player) assist2).sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist3.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + return;
- + }
- +
- +
- +
- + ClasseCheck(player);
- +
- + if (player.duelist_cont > Config.duelist_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.duelist_COUNT_4X4 + " Duelist's or " + Config.duelist_COUNT_4X4 + " Grand Khauatari's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.duelist_COUNT_4X4 + " Duelist's or " + Config.duelist_COUNT_4X4 + " Grand Khauatari'sallowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.dreadnought_cont > Config.dreadnought_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.dreadnought_COUNT_4X4 + " Dread Nought's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.dreadnought_COUNT_4X4 + " Dread Nought's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.tanker_cont > Config.tanker_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.tanker_COUNT_4X4 + " Tanker's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.tanker_COUNT_4X4 + " Tanker's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.dagger_cont > Config.dagger_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.dagger_COUNT_4X4 + " Dagger's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.dagger_COUNT_4X4 + " Dagger's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.archer_cont > Config.archer_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.archer_COUNT_4X4 + " Archer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.archer_COUNT_4X4 + " Archer's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.bs_cont > Config.bs_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.bs_COUNT_4X4 + " Bishop's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.bs_COUNT_4X4 + " Bishop's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.archmage_cont > Config.archmage_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.archmage_COUNT_4X4 + " Archmage's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.archmage_COUNT_4X4 + " Archmage's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.soultaker_cont > Config.soultaker_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.soultaker_COUNT_4X4 + " Soultaker's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.soultaker_COUNT_4X4 + " Soultaker's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.mysticMuse_cont > Config.mysticMuse_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.mysticMuse_COUNT_4X4 + " Mystic Muse's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.mysticMuse_COUNT_4X4 + " Mystic Muse's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.stormScreamer_cont > Config.stormScreamer_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.stormScreamer_COUNT_4X4 + " Storm Screamer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.stormScreamer_COUNT_4X4 + " Storm Screamer's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.titan_cont > Config.titan_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.titan_COUNT_4X4 + " Titan's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.titan_COUNT_4X4 + " Titan's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.dominator_cont > Config.dominator_COUNT_4X4)
- + {
- + player.sendMessage("Tournament: Only " + Config.dominator_COUNT_4X4 + " Dominator's or " + Config.dominator_COUNT_4X4 + " Doomcryer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.dominator_COUNT_4X4 + " Dominator's or " + Config.dominator_COUNT_4X4 + " Doomcryer's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (Arena4x4.getInstance().register(player, assist, (Player) assist2, assist3) && player.getParty().getMembers().get(1) != null && player.getParty().getMembers().get(2) != null && player.getParty().getMembers().get(3) != null)
- + {
- + player.sendMessage("Tournament: Your participation has been approved.");
- + assist.sendMessage("Tournament: Your participation has been approved.");
- + ((Player) assist2).sendMessage("Tournament: Your participation has been approved.");
- + assist3.sendMessage("Tournament: Your participation has been approved.");
- +
- + player.setArenaProtection(true);
- + assist.setArenaProtection(true);
- + ((Player) assist2).setArenaProtection(true);
- + assist3.setArenaProtection(true);
- +
- + player.setArena4x4(true);
- + assist.setArena4x4(true);
- + ((Player) assist2).setArena4x4(true);
- + assist3.setArena4x4(true);
- + clean(player);
- + showChatWindow1(player);
- + }
- + else
- + player.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + }
- + else if (command.startsWith("9x9"))
- + {
- +
- + if (!Config.ALLOW_9X9_REGISTER)
- + {
- + player.sendPacket(SystemMessageId.ACADEMY_LIST_HEADER);
- + return;
- + }
- +
- + if (player.isArena2x2() || player.isArena4x4() || player.isArena9x9() || player.isArenaProtection())
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return;
- + }
- + if (!player.isInParty())
- + {
- + player.sendMessage("Tournament: You dont have a party.");
- + return;
- + }
- + if (!player.getParty().isLeader(player))
- + {
- + player.sendMessage("Tournament: You are not the party leader!");
- + return;
- + }
- + if (player.getParty().getMembersCount() < 9)
- + {
- + player.sendMessage("Tournament: Your party does not have 9 members.");
- + player.sendPacket(new ExShowScreenMessage("Your party does not have 9 members", 6000));
- + return;
- + }
- + if (player.getParty().getMembersCount() > 9)
- + {
- + player.sendMessage("Tournament: Your Party can not have more than 9 members.");
- + player.sendPacket(new ExShowScreenMessage("Your Party can not have more than 9 members", 6000));
- + return;
- + }
- +
- + Player assist = player.getParty().getMembers().get(1);
- + Player assist21 = player.getParty().getMembers().get(2);
- + Player assist3 = player.getParty().getMembers().get(3);
- + Player assist4 = player.getParty().getMembers().get(4);
- + Player assist5 = player.getParty().getMembers().get(5);
- + Player assist6 = player.getParty().getMembers().get(6);
- + Player assist7 = player.getParty().getMembers().get(7);
- + Player assist8 = player.getParty().getMembers().get(8);
- +
- + if (player.isCursedWeaponEquipped() || assist.isCursedWeaponEquipped() || assist21.isCursedWeaponEquipped() || assist3.isCursedWeaponEquipped() || assist4.isCursedWeaponEquipped() || assist5.isCursedWeaponEquipped() || assist6.isCursedWeaponEquipped() || assist7.isCursedWeaponEquipped() || assist8.isCursedWeaponEquipped() || player.isInStoreMode() || assist.isInStoreMode() || assist21.isInStoreMode() || assist3.isInStoreMode() || assist4.isInStoreMode() || assist5.isInStoreMode() || assist6.isInStoreMode() || assist7.isInStoreMode() || assist8.isInStoreMode() || player.getKarma() > 0 || assist.getKarma() > 0 || assist21.getKarma() > 0 || assist3.getKarma() > 0 || assist4.getKarma() > 0 || assist5.getKarma() > 0 || assist6.getKarma() > 0 || assist7.getKarma() > 0 || assist8.getKarma() > 0)
- + {
- + player.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist21.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist3.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist4.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist5.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist6.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist7.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist8.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + return;
- + }
- + if (OlympiadManager.getInstance().isRegistered(player) || OlympiadManager.getInstance().isRegistered(assist) || OlympiadManager.getInstance().isRegistered(assist21) || OlympiadManager.getInstance().isRegistered(assist3) || OlympiadManager.getInstance().isRegistered(assist4) || OlympiadManager.getInstance().isRegistered(assist5) || OlympiadManager.getInstance().isRegistered(assist6) || OlympiadManager.getInstance().isRegistered(assist7) || OlympiadManager.getInstance().isRegistered(assist8))
- + {
- + player.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist21.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist3.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist4.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist5.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist6.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist7.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist8.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + return;
- + }
- +
- +
- +
- + ClasseCheck(player);
- +
- + if (player.duelist_cont > Config.duelist_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.duelist_COUNT_9X9 + " Duelist's or " + Config.duelist_COUNT_9X9 + " Grand Khauatari's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.duelist_COUNT_9X9 + " Duelist's or " + Config.duelist_COUNT_9X9 + " Grand Khauatari's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.dreadnought_cont > Config.dreadnought_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.dreadnought_COUNT_9X9 + " Dread Nought's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.dreadnought_COUNT_9X9 + " Dread Nought's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.tanker_cont > Config.tanker_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.tanker_COUNT_9X9 + " Tanker's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.tanker_COUNT_9X9 + " Tanker's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.dagger_cont > Config.dagger_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.dagger_COUNT_9X9 + " Dagger's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.dagger_COUNT_9X9 + " Dagger's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.archer_cont > Config.archer_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.archer_COUNT_9X9 + " Archer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.archer_COUNT_9X9 + " Archer's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.bs_cont > Config.bs_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.bs_COUNT_9X9 + " Bishop's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.bs_COUNT_9X9 + " Bishop's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.archmage_cont > Config.archmage_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.archmage_COUNT_9X9 + " Archmage's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.archmage_COUNT_9X9 + " Archmage's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.soultaker_cont > Config.soultaker_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.soultaker_COUNT_9X9 + " Soultaker's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.soultaker_COUNT_9X9 + " Soultaker's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.mysticMuse_cont > Config.mysticMuse_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.mysticMuse_COUNT_9X9 + " Mystic Muse's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.mysticMuse_COUNT_9X9 + " Mystic Muse's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.stormScreamer_cont > Config.stormScreamer_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.stormScreamer_COUNT_9X9 + " Storm Screamer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.stormScreamer_COUNT_9X9 + " Storm Screamer's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.titan_cont > Config.titan_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.titan_COUNT_9X9 + " Titan's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.titan_COUNT_9X9 + " Titan's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (player.dominator_cont > Config.dominator_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + Config.dominator_COUNT_9X9 + " Dominator's or " + Config.dominator_COUNT_9X9 + " Doomcryer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + Config.dominator_COUNT_9X9 + " Dominator's or " + Config.dominator_COUNT_9X9 + " Doomcryer's allowed per party.", 6000));
- + clean(player);
- + return;
- + }
- + if (Arena9x9.getInstance().register(player, assist, assist21, assist3, assist4, assist5, assist6, assist7, assist8) && player.getParty().getMembers().get(1) != null && player.getParty().getMembers().get(2) != null && player.getParty().getMembers().get(3) != null && player.getParty().getMembers().get(4) != null && player.getParty().getMembers().get(5) != null && player.getParty().getMembers().get(6) != null && player.getParty().getMembers().get(7) != null && player.getParty().getMembers().get(8) != null)
- + {
- + player.sendMessage("Tournament: Your participation has been approved.");
- + assist.sendMessage("Tournament: Your participation has been approved.");
- + assist21.sendMessage("Tournament: Your participation has been approved.");
- + assist3.sendMessage("Tournament: Your participation has been approved.");
- + assist4.sendMessage("Tournament: Your participation has been approved.");
- + assist5.sendMessage("Tournament: Your participation has been approved.");
- + assist6.sendMessage("Tournament: Your participation has been approved.");
- + assist7.sendMessage("Tournament: Your participation has been approved.");
- + assist8.sendMessage("Tournament: Your participation has been approved.");
- +
- + player.setArenaProtection(true);
- + assist.setArenaProtection(true);
- + assist21.setArenaProtection(true);
- + assist3.setArenaProtection(true);
- + assist4.setArenaProtection(true);
- + assist5.setArenaProtection(true);
- + assist6.setArenaProtection(true);
- + assist7.setArenaProtection(true);
- + assist8.setArenaProtection(true);
- +
- + player.setArena9x9(true);
- + assist.setArena9x9(true);
- + assist21.setArena9x9(true);
- + assist3.setArena9x9(true);
- + assist4.setArena9x9(true);
- + assist5.setArena9x9(true);
- + assist6.setArena9x9(true);
- + assist7.setArena9x9(true);
- + assist8.setArena9x9(true);
- + clean(player);
- + showChatWindow2(player);
- + }
- + else
- + player.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + }
- + else if (command.startsWith("remove"))
- + {
- + if (!player.isInParty())
- + {
- + player.sendMessage("Tournament: You dont have a party.");
- + return;
- + }
- + if (!player.getParty().isLeader(player))
- + {
- + player.sendMessage("Tournament: You are not the party leader!");
- + return;
- + }
- +
- + Arena2x2.getInstance().remove(player);
- + Arena9x9.getInstance().remove(player);
- + Arena4x4.getInstance().remove(player);
- + showChatWindow(player);
- +
- + }
- + else if (command.startsWith("observe_list"))
- + {
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + String filename = "data/html/mods/tournament/9996-1.htm";
- + NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- + html.setFile(filename);
- + html.replace("%objectId%", String.valueOf(getObjectId()));
- + player.sendPacket(html);
- + }
- + else if (command.startsWith("observe_back"))
- + showChatWindow(player);
- + else if (command.startsWith("tournament_observe"))
- + {
- +
- + StringTokenizer st = new StringTokenizer(command);
- + st.nextToken();
- +
- + int x = Integer.parseInt(st.nextToken());
- + int y = Integer.parseInt(st.nextToken());
- + int z = Integer.parseInt(st.nextToken());
- +
- + player.setArenaObserv(true);
- + player.enterObserverMode(x, y, z);
- + }
- + else
- + super.onBypassFeedback(player, command);
- + }
- +
- + }
- +
- + public void ClasseCheck(Player activeChar)
- + {
- + Party plparty = activeChar.getParty();
- + for (Player player : plparty.getMembers())
- + if (player != null)
- + if (player.getParty() != null)
- + {
- + if (player.getClassId() == ClassId.GLADIATOR || player.getClassId() == ClassId.DUELIST || player.getClassId() == ClassId.GRAND_KHAVATARI || player.getClassId() == ClassId.TYRANT)
- + activeChar.duelist_cont += 1;
- + if (player.getClassId() == ClassId.WARLORD || player.getClassId() == ClassId.DREADNOUGHT)
- + activeChar.dreadnought_cont += 1;
- + if (player.getClassId() == ClassId.PALADIN || player.getClassId() == ClassId.PHOENIX_KNIGHT || player.getClassId() == ClassId.DARK_AVENGER || player.getClassId() == ClassId.HELL_KNIGHT || player.getClassId() == ClassId.EVAS_TEMPLAR || player.getClassId() == ClassId.TEMPLE_KNIGHT || player.getClassId() == ClassId.SHILLIEN_KNIGHT || player.getClassId() == ClassId.SHILLIEN_TEMPLAR)
- + activeChar.tanker_cont += 1;
- + if (player.getClassId() == ClassId.ADVENTURER || player.getClassId() == ClassId.TREASURE_HUNTER || player.getClassId() == ClassId.WIND_RIDER || player.getClassId() == ClassId.PLAINS_WALKER || player.getClassId() == ClassId.GHOST_HUNTER || player.getClassId() == ClassId.ABYSS_WALKER)
- + activeChar.dagger_cont += 1;
- + if (player.getClassId() == ClassId.HAWKEYE || player.getClassId() == ClassId.SAGGITARIUS || player.getClassId() == ClassId.MOONLIGHT_SENTINEL || player.getClassId() == ClassId.SILVER_RANGER || player.getClassId() == ClassId.GHOST_SENTINEL || player.getClassId() == ClassId.PHANTOM_RANGER)
- + activeChar.archer_cont += 1;
- + if (player.getClassId() == ClassId.SHILLIEN_ELDER || player.getClassId() == ClassId.SHILLIEN_SAINT || player.getClassId() == ClassId.BISHOP || player.getClassId() == ClassId.CARDINAL || player.getClassId() == ClassId.ELVEN_ELDER || player.getClassId() == ClassId.EVAS_SAINT)
- + activeChar.bs_cont += 1;
- + if (player.getClassId() == ClassId.ARCHMAGE || player.getClassId() == ClassId.SORCERER)
- + activeChar.archmage_cont += 1;
- + if (player.getClassId() == ClassId.SOULTAKER || player.getClassId() == ClassId.NECROMANCER)
- + activeChar.soultaker_cont += 1;
- + if (player.getClassId() == ClassId.MYSTIC_MUSE || player.getClassId() == ClassId.SPELLSINGER)
- + activeChar.mysticMuse_cont += 1;
- + if (player.getClassId() == ClassId.STORM_SCREAMER || player.getClassId() == ClassId.SPELLHOWLER)
- + activeChar.stormScreamer_cont += 1;
- + if (player.getClassId() == ClassId.TITAN || player.getClassId() == ClassId.DESTROYER)
- + activeChar.titan_cont += 1;
- + if (player.getClassId() == ClassId.DOMINATOR || player.getClassId() == ClassId.OVERLORD || player.getClassId() == ClassId.DOOMCRYER || player.getClassId() == ClassId.WARCRYER)
- + activeChar.dominator_cont += 1;
- + }
- + }
- +
- + public void clean(Player player)
- + {
- + player.duelist_cont = 0;
- + player.dreadnought_cont = 0;
- + player.tanker_cont = 0;
- + player.dagger_cont = 0;
- + player.archer_cont = 0;
- + player.bs_cont = 0;
- + player.archmage_cont = 0;
- + player.soultaker_cont = 0;
- + player.mysticMuse_cont = 0;
- + player.stormScreamer_cont = 0;
- + player.titan_cont = 0;
- + player.dominator_cont = 0;
- + }
- + }
- +
- Index: data\html\mods\tournament/9996.html
- ===================================================================
- --- data\html\mods\tournament/9996.html (revision 84)
- +++ data\html\mods\tournament/9996.html (working copy)
- + <html>
- + <title>Battle Tournament</title>
- + <body>
- + <center>
- + <img src="l2ui_ch3.herotower_deco" width=256 height=32>
- + <br>
- +
- + <table><tr><td height=7>
- + <img src="Sek.cbui371" width=300 height=1>
- + </td></tr></table>
- + <table width=320 bgcolor=000000>
- + <tr>
- + <td>2x2:</font></td>
- + <td width=10><img src=l2ui.bbs_reply width=15 height=15></td>
- + <td width=25>%2x2%</td>
- + <td>4x4:</font></td>
- + <td width=10><img src=l2ui.bbs_reply width=15 height=15></td>
- + <td width=25>%4x4%</td>
- + <td>9x9:</font></td>
- + <td width=10><img src=l2ui.bbs_reply width=15 height=15></td>
- + <td width=25>%9x9%</td>
- + <td width=10></td>
- + </tr>
- + </table>
- + <img src="Sek.cbui371" width=300 height=1>
- + <br>
- + <br>
- +
- + <img src="Sek.cbui371" width=300 height=1>
- + <table width=280 bgcolor=000000>
- + <tr>
- + <td width=25 align="right"><button action="" width=32 height=32 back="icon.etc_event_medal_i00" fore="icon.etc_event_medal_i00"></td>
- + <td width=120>
- + <table>
- + <tr><td><font color="0066CC">[ Battle Tour 2x2 ] </font></td></tr>
- + <tr><td>{ 2 members for pt }</font></td></tr>
- + </table>
- + </td>
- + <td width=8></td>
- + <td><button width="115" height="30" back="L2UI_ch3.bigbutton2_down" fore="L2UI_ch3.bigbutton2" action="bypass -h npc_%objectId%_2x2" value="Register 2x2"></td>
- + </tr>
- + </table>
- + <img src="Sek.cbui371" width=300 height=1>
- + <table width=280 bgcolor=000000>
- + <tr>
- + <td width=25 align="right"><button action="" width=32 height=32 back="icon.etc_event_medal_i00" fore="icon.etc_event_medal_i00"></td>
- + <td width=120>
- + <table>
- + <tr><td><font color="0066CC">[ Battle Tour 4x4 ] </font></td></tr>
- + <tr><td>{ 4 members for pt } </font></td></tr>
- + </table>
- + </td>
- + <td width=11></td>
- + <td><button width="115" height="30" back="L2UI_ch3.bigbutton2_down" fore="L2UI_ch3.bigbutton2" action="bypass -h npc_%objectId%_4x4" value="Register 4x4"></td>
- + </tr>
- + </table>
- + <img src="Sek.cbui371" width=300 height=1>
- + <table width=280 bgcolor=000000>
- + <tr>
- + <td width=25 align="right"><button action="" width=32 height=32 back="icon.etc_event_medal_i00" fore="icon.etc_event_medal_i00"></td>
- + <td width=120>
- + <table>
- + <tr><td><font color="0066CC">[ Battle Tour 9x9 ] </font></td></tr>
- + <tr><td>{ 9 members for pt } </font></td></tr>
- + </table>
- + </td>
- + <td width=11></td>
- + <td><button width="115" height="30" back="L2UI_ch3.bigbutton2_down" fore="L2UI_ch3.bigbutton2" action="bypass -h npc_%objectId%_9x9" value="Register 9x9"></td>
- + </tr>
- + </table>
- + <img src="Sek.cbui371" width=300 height=1>
- + <table width=277 bgcolor=000000>
- + <tr>
- + <td width=25 align="right"><button action="" width=32 height=32 back="L2UI_CH3.mainwndtabicon1" fore="L2UI_CH3.mainwndtabicon1"></td>
- + <td width=130>
- + <table>
- + <tr><td><font color="0066CC">[ Observer ] </font></td></tr>
- + <tr><td>{ Watch tournament } </font></td></tr>
- + </table>
- + </td>
- + <td><button width="115" height="30" back="L2UI_ch3.bigbutton2_down" fore="L2UI_ch3.bigbutton2" action="bypass -h npc_%objectId%_observe_list" value="Watch battle"></td>
- + </tr>
- + </table>
- + <img src="Sek.cbui371" width=300 height=1>
- + <br>
- + <br>
- + <img src="Sek.cbui371" width=300 height=1>
- + <table width=300 bgcolor="000000">
- + <tr>
- + <td width=40></td>
- +
- + <td><font color="ff0000"><a action="bypass -h npc_%objectId%_remove">.: Leave the party :.</font></a></td>
- +
- + </tr>
- + <tr>
- + <td height=1></td>
- + </tr>
- + </table>
- + <img src="Sek.cbui371" width=300 height=1>
- + <br>
- +
- + </body>
- + </html>
- +
- Index: data\html\mods\tournament/9996-1.html
- ===================================================================
- --- data\html\mods\tournament/9996.html (revision 84)
- +++ data\html\mods\tournament/9996.html (working copy)
- + <html><body><center><title>Tournament</title>
- + <br>
- + <img src="L2UI.L2UI.SquareGray" width=300 height=1>
- + <table bgcolor=000000 width=320>
- + <tr>
- + <td><center><font color="CD6839"></font> <font color="CD6839">Watch Tournament 2x2</font></center></td>
- + </tr>
- + </table>
- + <img src="L2UI.SquareGray" width=295 height=1>
- + <br>
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 2x2 (Arena 1)" action="bypass -h npc_%objectId%_tournament_observe -87523 -240169 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- +
- +
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 2x2 (Arena 2)" action="bypass -h npc_%objectId%_tournament_observe -109629 -201292 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- +
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 2x2 (Arena 3)" action="bypass -h npc_%objectId%_tournament_observe -126367 -218228 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- + <img src="L2UI.L2UI.SquareGray" width=300 height=1>
- + <table bgcolor=000000 width=320>
- + <tr>
- + <td><center><font color="CD6839"></font> <font color="CD6839">Watch Tournament 4x4</font></center></td>
- + </tr>
- + </table>
- + <img src="L2UI.SquareGray" width=295 height=1>
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 4x4 (Arena 1)" action="bypass -h npc_%objectId%_tournament_observe -69778 -241801 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 4x4 (Arena 2)" action="bypass -h npc_%objectId%_tournament_observe -77123 -251473 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 4x4 (Arena 3)" action="bypass -h npc_%objectId%_tournament_observe -81748 -245950 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- + <br>
- + <img src="L2UI.L2UI.SquareGray" width=300 height=1>
- + <table bgcolor=000000 width=320>
- + <tr>
- + <td><center><font color="CD6839"></font> <font color="CD6839">Watch Tournament 9x9</font></center></td>
- + </tr>
- + </table>
- + <img src="L2UI.SquareGray" width=295 height=1>
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 9x9 (Arena 1)" action="bypass -h npc_%objectId%_tournament_observe -87466 -257752 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 9x9 (Arena 2)" action="bypass -h npc_%objectId%_tournament_observe -93742 -251032 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 9x9 (Arena 3)" action="bypass -h npc_%objectId%_tournament_observe -76754 -234014 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- + <br>
- + <td><font color="ff0000"><a action="bypass -h npc_%objectId%_observe_back">.: Back :.</font></a></td>
- +
- + </center>
- + </body>
- + </html>
- +
- +
- Index: data\html\mods\tournament/Change_Arena.html
- ===================================================================
- --- data\html\mods\tournament/Change_Arena.html (revision 84)
- +++ data\html\mods\tournament/Change_Arena.html (working copy)
- + <html><body><center><title>Tournament</title>
- + <br>
- + <img src="L2UI.L2UI.SquareGray" width=300 height=1>
- + <table bgcolor=000000 width=320>
- + <tr>
- + <td><center><font color="CD6839"></font> <font color="CD6839">Watch Tournament 2x2</font></center></td>
- + </tr>
- + </table>
- + <img src="L2UI.SquareGray" width=295 height=1>
- + <br>
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 2x2 (Arena 1)" action="bypass -h npc_%objectId%_tournament_observe -87523 -240169 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- +
- +
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 2x2 (Arena 2)" action="bypass -h npc_%objectId%_tournament_observe -109629 -201292 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- +
- + <table width=210>
- + <tr>
- + <td align=center>
- + <button value="Observe 2x2 (Arena 3)" action="bypass -h npc_%objectId%_tournament_observe -126367 -218228 -3331" width=134 height=21 back="L2UI_ch3.BigButton3_over" fore="L2UI_ch3.BigButton3">
- + </td>
- + </tr>
- + </table>
- +
- + <br>
- + <td><font color="ff0000"><a action="bypass -h npc_%objectId%_observe_back">.: Back :.</font></a></td>
- +
- + </center>
- + </body>
- + </html>
- Index: net.sf.l2j.gameserver;GameServer.java
- ===================================================================
- --- net.sf.l2j.gameserver;GameServer.java (revision 84)
- +++ net.sf.l2j.gameserver;GameServer.java (working copy)
- + ThreadPool.schedule(Arena2x2.getInstance(), 5000L);
- + ThreadPool.schedule(Arena9x9.getInstance(), 5000L);
- + ThreadPool.schedule(Arena4x4.getInstance(), 5000L);
- + if (Config.TOURNAMENT_EVENT_TIME)
- + {
- + _log.info("Tournament Event is enabled.");
- + ArenaEvent.getInstance().StartCalculationOfNextEventTime();
- + }
- + else if (Config.TOURNAMENT_EVENT_START)
- + {
- + _log.info("Tournament Event is enabled.");
- + ArenaTask.spawnNpc1();
- + }
- + else
- + _log.info("Tournament Event is disabled");
- Index: data\xml\zones/TournamentZone.xml
- ===================================================================
- --- data\xml\zones/TournamentZone.xml (revision 84)
- +++ data\xml\zones/TournamentZone.xml (working copy)
- + <?xml version="1.0" encoding="UTF-8"?>
- + <list>
- +
- + <zone shape="NPoly" minZ="-3400" maxZ="-3125"><!-- olympiad_stadium_13 -->
- + <node x="-125722" y="-219117" />
- + <node x="-125437" y="-218767" />
- + <node x="-125437" y="-217736" />
- + <node x="-125722" y="-217386" />
- + <node x="-127447" y="-217386" />
- + <node x="-127732" y="-217736" />
- + <node x="-127732" y="-218767" />
- + <node x="-127447" y="-219117" />
- + <!-- point1 -->
- + <spawn x="-125722" y="-218251" z="-3327" />
- + <!-- point2 -->
- + <spawn x="-127447" y="-218251" z="-3327" />
- + <!-- spectator -->
- + <spawn x="-126584" y="-218251" z="-3327" />
- + </zone>
- + <zone shape="NPoly" minZ="-3400" maxZ="-3125"><!-- olympiad_stadium_14 -->
- + <node x="-108730" y="-202093" />
- + <node x="-108445" y="-201743" />
- + <node x="-108445" y="-200712" />
- + <node x="-108730" y="-200362" />
- + <node x="-110455" y="-200362" />
- + <node x="-110740" y="-200712" />
- + <node x="-110740" y="-201743" />
- + <node x="-110455" y="-202093" />
- + <!-- point1 -->
- + <spawn x="-108730" y="-201227" z="-3327" />
- + <!-- point2 -->
- + <spawn x="-110455" y="-201227" z="-3327" />
- + <!-- spectator -->
- + <spawn x="-109592" y="-201227" z="-3327" />
- + </zone>
- + <zone shape="NPoly" minZ="-3400" maxZ="-3125"><!-- olympiad_stadium_15 -->
- + <node x="-86618" y="-241008" />
- + <node x="-86333" y="-240658" />
- + <node x="-86333" y="-239627" />
- + <node x="-86618" y="-239277" />
- + <node x="-88343" y="-239277" />
- + <node x="-88628" y="-239627" />
- + <node x="-88628" y="-240658" />
- + <node x="-88343" y="-241008" />
- + <!-- point1 -->
- + <spawn x="-86618" y="-240142" z="-3327" />
- + <!-- point2 -->
- + <spawn x="-88343" y="-240142" z="-3327" />
- + <!-- spectator -->
- + <spawn x="-87480" y="-240142" z="-3327" />
- + </zone>
- + <zone shape="NPoly" minZ="-3400" maxZ="-3125"><!-- olympiad_stadium_16 -->
- + <node x="-80890" y="-246830" />
- + <node x="-80605" y="-246480" />
- + <node x="-80605" y="-245449" />
- + <node x="-80890" y="-245099" />
- + <node x="-82615" y="-245099" />
- + <node x="-82900" y="-245449" />
- + <node x="-82900" y="-246480" />
- + <node x="-82615" y="-246830" />
- + <!-- point1 -->
- + <spawn x="-80890" y="-245964" z="-3327" />
- + <!-- point2 -->
- + <spawn x="-82615" y="-245964" z="-3327" />
- + <!-- spectator -->
- + <spawn x="-81752" y="-245964" z="-3327" />
- + </zone>
- + <zone shape="NPoly" minZ="-3400" maxZ="-3125"><!-- olympiad_stadium_17 -->
- + <node x="-76249" y="-252348" />
- + <node x="-75964" y="-251998" />
- + <node x="-75964" y="-250967" />
- + <node x="-76249" y="-250617" />
- + <node x="-77974" y="-250617" />
- + <node x="-78259" y="-250967" />
- + <node x="-78259" y="-251998" />
- + <node x="-77974" y="-252348" />
- + <!-- point1 -->
- + <spawn x="-76249" y="-251482" z="-3327" />
- + <!-- point2 -->
- + <spawn x="-77974" y="-251482" z="-3327" />
- + <!-- spectator -->
- + <spawn x="-77111" y="-251482" z="-3327" />
- + </zone>
- + <zone shape="NPoly" minZ="-3400" maxZ="-3125"><!-- olympiad_stadium_18 -->
- + <node x="-68857" y="-242637" />
- + <node x="-68572" y="-242287" />
- + <node x="-68572" y="-241256" />
- + <node x="-68857" y="-240906" />
- + <node x="-70582" y="-240906" />
- + <node x="-70867" y="-241256" />
- + <node x="-70867" y="-242287" />
- + <node x="-70582" y="-242637" />
- + <!-- point1 -->
- + <spawn x="-68857" y="-241771" z="-3327" />
- + <!-- point2 -->
- + <spawn x="-70582" y="-241771" z="-3327" />
- + <!-- spectator -->
- + <spawn x="-69719" y="-241771" z="-3327" />
- + </zone>
- + <zone shape="NPoly" minZ="-3400" maxZ="-3125"><!-- olympiad_stadium_19 -->
- + <node x="-75961" y="-234861" />
- + <node x="-75676" y="-234511" />
- + <node x="-75676" y="-233480" />
- + <node x="-75961" y="-233130" />
- + <node x="-77686" y="-233130" />
- + <node x="-77971" y="-233480" />
- + <node x="-77971" y="-234511" />
- + <node x="-77686" y="-234861" />
- + <!-- point1 -->
- + <spawn x="-75961" y="-233995" z="-3327" />
- + <!-- point2 -->
- + <spawn x="-77686" y="-233995" z="-3327" />
- + <!-- spectator -->
- + <spawn x="-76823" y="-233995" z="-3327" />
- + </zone>
- + <zone shape="NPoly" minZ="-3400" maxZ="-3125"><!-- olympiad_stadium_20 -->
- + <node x="-92953" y="-251900" />
- + <node x="-92668" y="-251550" />
- + <node x="-92668" y="-250519" />
- + <node x="-92953" y="-250169" />
- + <node x="-94678" y="-250169" />
- + <node x="-94963" y="-250519" />
- + <node x="-94963" y="-251550" />
- + <node x="-94678" y="-251900" />
- + <!-- point1 -->
- + <spawn x="-92953" y="-251034" z="-3327" />
- + <!-- point2 -->
- + <spawn x="-94678" y="-251034" z="-3327" />
- + <!-- spectator -->
- + <spawn x="-93815" y="-251034" z="-3327" />
- + </zone>
- + <zone shape="NPoly" minZ="-3400" maxZ="-3125"><!-- olympiad_stadium_21 -->
- + <node x="-86650" y="-258653" />
- + <node x="-86365" y="-258303" />
- + <node x="-86365" y="-257272" />
- + <node x="-86650" y="-256922" />
- + <node x="-88375" y="-256922" />
- + <node x="-88660" y="-257272" />
- + <node x="-88660" y="-258303" />
- + <node x="-88375" y="-258653" />
- + <!-- point1 -->
- + <spawn x="-86650" y="-257787" z="-3327" />
- + <!-- point2 -->
- + <spawn x="-88375" y="-257787" z="-3327" />
- + <!-- spectator -->
- + <spawn x="-87512" y="-257787" z="-3327" />
- + </zone>
- + </list>
- +
- Index: config\eventos/Tournament.propertis
- ===================================================================
- --- config\eventos/Tournament.propertis (revision 84)
- +++ config\eventos/Tournament.propertis (working copy)
- + #=================================================
- + # SPAWN TOURNAMENT
- + #=================================================
- + # Tournament comando spawn manual //tour ou //tour para terminar o evento.
- + # Tournament Npc Auto Spawn
- + # spawnar npc tournament ao ligar servidor
- + TournamentStartOn = False
- +
- + # ativar evento automatico
- + TournamentAutoEvent = True
- +
- + # aparecer popup teleport para o tournament
- + TournamentSummon = True
- +
- + # anunciar start event
- + TournamenAnnounce = True
- +
- + # Time heading
- + Heading = 1
- +
- + # Pvps para participar do tournament?
- + ArenaPvpJoin = -1
- +
- + # ArenaStartTime= 10:30,14:30,18:30,23:30
- + TournamentStartTime = 10:00,15:00,20:00
- + # Duraçao do evento
- + # Tempo em Minutos
- + TournamentEventTime = 90
- +
- + #=================================================
- + # 2x2 EVENT LOC
- + #=================================================
- + # Arenas Location
- + # e.g: 149360, 46594, -3415; x, y, z; x1, y1, z1
- + ArenasLoc = -87523, -240169, -3331;-109629, -201292, -3331;-126367, -218228, -3331;
- +
- + #=================================================
- + # 4x4 EVENT LOC
- + #=================================================
- + # Arenas Location
- + # e.g: 149360, 46594, -3415; x, y, z; x1, y1, z1
- + Arenas4x4Loc = -69778, -241801, -3331;-77123, -251473, -3331;-81748, -245950, -3331;
- +
- + #=================================================
- + # 9x9 EVENT LOC
- + #=================================================
- + # Arenas Location
- + # e.g: 149360, 46594, -3415; x, y, z; x1, y1, z1
- + Arenas9x9Loc = -87466, -257752, -3331;-93742, -251032, -3331;-76754, -234014, -3331;
- +
- + #=================================================
- + # REWARD EVENT
- + #=================================================
- + # id do item que sera anunciado.
- + # id do item que sera a recompensa
- + ArenaRewardId = 9301
- + #=================================================
- + # (2x2) quantidade premios para os vencedores
- + ArenaWinRewardCount = 10
- + # (2x2) quantidade que sera retirada para os que perderem
- + ArenaLostRewardCount = 5
- + #=================================================
- + # (4x4) quantidade premios para os vencedores
- + ArenaWinRewardCount4x4 = 10
- + # (4x4) quantidade que sera retirada para os que perderem
- + ArenaLostRewardCount4x4 = 5
- + #=================================================
- + # (9x9) quantidade premios para os vencedores
- + ArenaWinRewardCount9x9 = 10
- + # (9x9) quantidade que sera retirada para os que perderem
- + ArenaLostRewardCount9x9 = 5
- + #=================================================
- +
- + # Tempo entre o status dos jogadores de cheques [em segundos]
- + ArenaBattleCheckInterval = 15
- +
- + # Tempo para os jogadores inscritos serem chamados [em segundos]
- + ArenaBattleCallInterval = 60
- +
- + # Hora de começar a batalha depois que os jogadores são chamados [em segundos]
- + ArenaBattleWaitInterval = 20
- + ArenaBattleWaitInterval4x4 = 45
- + ArenaBattleWaitInterval9x9 = 45
- +
- + # lista de items que nao poderao usar no tournament
- + ItemsRestriction = 0
- +
- + # skill restriction
- + DisableSkillList = 0
- + ArenaDisableSkillList_noStart = 0
- +
- + # ID do NPC de Registro
- + NPCRegister = 9996
- +
- + # Local do spawn NPC de Registro.
- + Locx = -115101
- + Locy = -213178
- + Locz = -3334
- +
- + # local para onde os players serao teleportados pelo teleport popup
- + Tournament_locx = -115101
- + Tournament_locy = -213178
- + Tournament_locz = -3334
- +
- + # ativar registros
- + Allow2x2Register = True
- + Allow4x4Register = True
- + Allow9x9Register = True
- +
- + # perder buff em 4x4?
- + Allow4x4LostBuff = False
- +
- + # Show screen Arena message on character login
- + # Default: False
- + ScreenArenaMessageEnable = True
- + # Screen Arena message text to show on character login if enabled
- + ScreenArenaMessageText = Tournament 2x2 / 4x4 / 9x9 register now.
- + # Show screen Arena message for x seconds when character log in to game if enabled
- + ScreenArenaMessageTime = 6
- +
- + # Color title players
- + TitleColorTeam_1 = 00FFFF
- + TitleColorTeam_2 = 00FFFF
- +
- + # Prefix title players
- + TitleTeam_1 = Team [1]
- + TitleTeam_2 = Team [2]
- +
- + # Remover efeito e desativar Skill em Arena
- + ArenaSkillProtect = True
- +
- + #Lista de Skill Proibidas
- + ArenaDisableSkillList = 1410,438,1016,1254,3160,1410,3123
- +
- + #Remover efeito das skills
- + ArenaStopSkillList = 420,406,176,139,1410,438
- +
- + #=================================================
- + # PARTY RESTRICED Nº CLASS 4x4
- + #=================================================
- + # maixmo de classes em 1 pt
- + bs_amount_4x4 = 1
- + archer_amount_4x4 = 2
- + dominator_amount_4x4 = 2
- + duelist_amount_4x4 = 1
- + dreadnought_amount_4x4 = 2
- + tanker_amount_4x4 = 1
- + dagger_amount_4x4 = 2
- + archmage_amount_4x4 = 2
- + soultaker_amount_4x4 = 2
- + mysticMuse_amount_4x4 = 2
- + stormScreamer_amount_4x4 = 2
- + titan_amount_4x4 = 1
- + grandKhauatari_amount_4x4 = 1
- + doomcryer_amount_4x4 = 2
- +
- + #=================================================
- + # PARTY RESTRICED Nº CLASS 9x9
- + #=================================================
- + # maixmo de classes em 1 pt
- + bs_amount_9x9 = 2
- + archer_amount_9x9 = 9
- + dominator_amount_9x9 = 9
- + duelist_amount_9x9 = 9
- + dreadnought_amount_9x9 = 9
- + tanker_amount_9x9 = 9
- + dagger_amount_9x9 = 9
- + archmage_amount_9x9 = 9
- + soultaker_amount_9x9 = 9
- + mysticMuse_amount_9x9 = 9
- + stormScreamer_amount_9x9 = 9
- + titan_amount_9x9 = 9
- + grandKhauatari_amount_9x9 = 9
- + doomcryer_amount_9x9 = 9
- +
- Index: net.sf.l2j.gameserver.handler.admincommandhandlers;AdminCustom.java
- ===================================================================
- --- net.sf.l2j.gameserver.handler.admincommandhandlers;AdminCustom.java (revision 84)
- +++ net.sf.l2j.gameserver.handler.admincommandhandlers;AdminCustom.java (working copy)
- + package net.sf.l2j.gameserver.handler.admincommandhandlers;
- +
- + import java.util.logging.Logger;
- + import net.sf.l2j.commons.concurrent.ThreadPool;
- + import l2jban.events.ArenaTask;
- + import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
- + import net.sf.l2j.gameserver.model.actor.Player;
- +
- +
- + public class AdminCustom implements IAdminCommandHandler
- + {
- +
- + private static final String[] ADMIN_COMMANDS =
- + {
- + "admin_tour"
- +
- + };
- +
- + protected static final Logger _log = Logger.getLogger(AdminCustom.class.getName());
- + public static boolean _arena_manual = false;
- +
- + @Override
- + public boolean useAdminCommand(String command, Player activeChar)
- + {
- +
- +
- + if (command.equals("admin_tour"))
- + {
- + if (ArenaTask._started)
- + {
- + _log.info("----------------------------------------------------------------------------");
- + _log.info("[Tournament]: Event Finished.");
- + _log.info("----------------------------------------------------------------------------");
- + ArenaTask._aborted = true;
- + finishEventArena();
- + _arena_manual = true;
- +
- + activeChar.sendMessage("SYS: Voce Finalizou o evento Tournament Manualmente..");
- + }
- + else
- + {
- + _log.info("----------------------------------------------------------------------------");
- + _log.info("[Tournament]: Event Started.");
- + _log.info("----------------------------------------------------------------------------");
- + initEventArena();
- + _arena_manual = true;
- + activeChar.sendMessage("SYS: Voce ativou o evento Tournament Manualmente..");
- + }
- + }
- + return true;
- + }
- +
- + private static void initEventArena()
- + {
- + ThreadPool.schedule(new Runnable()
- + {
- + @Override
- + public void run()
- + {
- +
- + ArenaTask.SpawnEvent();
- + }
- + }, 10L);
- + }
- +
- + private static void finishEventArena()
- + {
- + ThreadPool.schedule(new Runnable()
- + {
- + @Override
- + public void run()
- + {
- +
- + ArenaTask.finishEvent();
- + }
- + }, 10L);
- + }
- +
- +
- +
- +
- + @Override
- + public String[] getAdminCommandList()
- + {
- + return ADMIN_COMMANDS;
- + }
- + }
- Index: net.sf.l2j.gameserver.network;L2GameClient.java
- ===================================================================
- --- net.sf.l2j.gameserver.network;L2GameClient.java (revision 84)
- +++ net.sf.l2j.gameserver.network;L2GameClient.java (working copy)
- public void run()
- {
- try
- {
- // we are going to manually save the char below thus we can force the cancel
- if (_autoSaveInDB != null)
- _autoSaveInDB.cancel(true);
- + Player player = getActiveChar();
- + if (player != null)
- + if (player.isArenaProtection())
- + {
- + player.setXYZ(ArenaTask.loc1x(), ArenaTask.loc1y(), ArenaTask.loc1z());
- + if (player.isInArenaEvent())
- + {
- + player.getAppearance().setTitleColor(player._originalTitleColorTournament);
- + player.setTitle(player._originalTitleTournament);
- + player.broadcastUserInfo();
- + player.broadcastTitleInfo();
- + }
- + }
- Index: net.sf.l2j.gameserver.network.DlgAnswer.java
- ===================================================================
- --- net.sf.l2j.gameserver.network.clientpackets;DlgAnswer.java (revision 84)
- +++ nnet.sf.l2j.gameserver.network.clientpackets;DlgAnswer.java (working copy)
- + import net.sf.l2j.gameserver.events.ArenaTask;
- @Override
- public void runImpl()
- {
- final Player activeChar = getClient().getActiveChar();
- if (activeChar == null)
- return;
- if (_messageId == SystemMessageId.RESSURECTION_REQUEST_BY_S1.getId() || _messageId == SystemMessageId.DO_YOU_WANT_TO_BE_RESTORED.getId())
- activeChar.reviveAnswer(_answer);
- + else if (_messageId == SystemMessageId.S1_WISHES_TO_SUMMON_YOU_FROM_S2_DO_YOU_ACCEPT.getId())
- + if (Announcements.isSummoning == true && _answer == 1)
- + activeChar.teleToLocation(ArenaTask.loc1x(), ArenaTask.loc1y(), ArenaTask.loc1z(), 125);
- else
- activeChar.teleportAnswer(_answer, _requesterId);
- else if (_messageId == 1983 && Config.ALLOW_WEDDING)
- activeChar.engageAnswer(_answer);
- else if (_messageId == SystemMessageId.WOULD_YOU_LIKE_TO_OPEN_THE_GATE.getId())
- activeChar.activateGate(_answer, 1);
- else if (_messageId == SystemMessageId.WOULD_YOU_LIKE_TO_CLOSE_THE_GATE.getId())
- activeChar.activateGate(_answer, 0);
- }
- Index: net.sf.l2j.gameserver.handler;EnterWorld.java
- ===================================================================
- --- net.sf.l2j.gameserver.handler;EnterWorld.java (revision 84)
- +++ net.sf.l2j.gameserver.handler;EnterWorld.java (working copy)
- + import net.sf.l2j.gameserver.events.ArenaTask;
- + if (ArenaTask.is_started() && Config.ARENA_MESSAGE_ENABLED)
- + activeChar.sendPacket(new ExShowScreenMessage(Config.ARENA_MESSAGE_TEXT, Config.ARENA_MESSAGE_TIME, 2, true));
- - registerHandler(new AdminLevel());
- + registerHandler(new AdminLevel());
- + registerHandler(new AdminCustom());
- Index: data\xml/adminCommands.xml
- ===================================================================
- --- data\xml/adminCommands.xml (revision 84)
- +++ data\xml/adminCommands.xml (working copy)
- + <!-- Eventos L2jBan -->
- + <aCar name="admin_tour" accessLevel="7"/>
- Index: net.sf.l2j/Config.java
- ===================================================================
- --- net.sf.l2j/Config.java (revision 84)
- +++ net.sf.l2j/Config.java (working copy)
- + public static final String TOUR_FILE = "./config/events/tournament.properties";
- + /** Arena Event */
- + public static boolean TOURNAMENT_EVENT_START;
- + public static boolean TOURNAMENT_EVENT_TIME;
- + public static boolean TOURNAMENT_EVENT_SUMMON;
- + public static boolean TOURNAMENT_EVENT_ANNOUNCE;
- + public static int TOURNAMENT_TIME;
- + public static String[] TOURNAMENT_EVENT_INTERVAL_BY_TIME_OF_DAY;
- + public static String TITLE_COLOR_TEAM1;
- + public static String TITLE_COLOR_TEAM2;
- + public static String MSG_TEAM1;
- + public static String MSG_TEAM2;
- + public static boolean Allow_Same_HWID_On_Tournament;
- + public static int ARENA_NPC;
- + public static int NPC_locx;
- + public static int NPC_locy;
- + public static int NPC_locz;
- + public static int NPC_Heading;
- + public static int Tournament_locx;
- + public static int Tournament_locy;
- + public static int Tournament_locz;
- + public static boolean ALLOW_2X2_REGISTER;
- + public static boolean ALLOW_4X4_REGISTER;
- + public static boolean ALLOW_9X9_REGISTER;
- + public static boolean ALLOW_4X4_LOSTBUFF;
- + public static boolean ARENA_MESSAGE_ENABLED;
- + public static String ARENA_MESSAGE_TEXT;
- + public static int ARENA_MESSAGE_TIME;
- + public static int ARENA_EVENT_COUNT;
- + public static int[][] ARENA_EVENT_LOCS;
- + public static int ARENA_EVENT_COUNT_4X4;
- + public static int[][] ARENA_EVENT_LOCS_4X4;
- + public static int ARENA_EVENT_COUNT_9X9;
- + public static int[][] ARENA_EVENT_LOCS_9X9;
- + public static int duelist_COUNT_4X4;
- + public static int dreadnought_COUNT_4X4;
- + public static int tanker_COUNT_4X4;
- + public static int dagger_COUNT_4X4;
- + public static int archer_COUNT_4X4;
- + public static int bs_COUNT_4X4;
- + public static int archmage_COUNT_4X4;
- + public static int soultaker_COUNT_4X4;
- + public static int mysticMuse_COUNT_4X4;
- + public static int stormScreamer_COUNT_4X4;
- + public static int titan_COUNT_4X4;
- + public static int dominator_COUNT_4X4;
- + public static int doomcryer_COUNT_4X4;
- + public static int duelist_COUNT_9X9;
- + public static int dreadnought_COUNT_9X9;
- + public static int tanker_COUNT_9X9;
- + public static int dagger_COUNT_9X9;
- + public static int archer_COUNT_9X9;
- + public static int bs_COUNT_9X9;
- + public static int archmage_COUNT_9X9;
- + public static int soultaker_COUNT_9X9;
- + public static int mysticMuse_COUNT_9X9;
- + public static int stormScreamer_COUNT_9X9;
- + public static int titan_COUNT_9X9;
- + public static int grandKhauatari_COUNT_9X9;
- + public static int dominator_COUNT_9X9;
- + public static int doomcryer_COUNT_9X9;
- + public static int ARENA_PVP_AMOUNT;
- + public static int ARENA_REWARD_ID;
- + public static int ARENA_WIN_REWARD_COUNT;
- + public static int ARENA_LOST_REWARD_COUNT;
- + public static int ARENA_WIN_REWARD_COUNT_4X4;
- + public static int ARENA_LOST_REWARD_COUNT_4X4;
- + public static int ARENA_WIN_REWARD_COUNT_9X9;
- + public static int ARENA_LOST_REWARD_COUNT_9X9;
- + public static int ARENA_CHECK_INTERVAL;
- + public static int ARENA_CALL_INTERVAL;
- + public static int ARENA_WAIT_INTERVAL_4X4;
- + public static int ARENA_WAIT_INTERVAL_9X9;
- + public static int ARENA_WAIT_INTERVAL;
- + public static String TOURNAMENT_ID_RESTRICT;
- + public static List<Integer> TOURNAMENT_LISTID_RESTRICT;
- + public static boolean ARENA_SKILL_PROTECT;
- + public static List<Integer> ARENA_SKILL_LIST = new ArrayList<>();
- + public static List<Integer> ARENA_DISABLE_SKILL_LIST = new ArrayList<>();
- + public static List<Integer> ARENA_STOP_SKILL_LIST = new ArrayList<>();
- + public static List<Integer> ARENA_DISABLE_SKILL_LIST_PERM = new ArrayList<>();
- +
- + /**
- + * Loads tournament settings.
- + */
- + private static final void loadTour()
- + {
- + final ExProperties tournament = initProperties(Config.TOUR_FILE);
- + TOURNAMENT_EVENT_START = tournament.getProperty("TournamentStartOn", false);
- + TOURNAMENT_EVENT_TIME = tournament.getProperty("TournamentAutoEvent", false);
- + TOURNAMENT_EVENT_SUMMON = tournament.getProperty("TournamentSummon", false);
- + TOURNAMENT_EVENT_ANNOUNCE = tournament.getProperty("TournamenAnnounce", false);
- +
- + TOURNAMENT_EVENT_INTERVAL_BY_TIME_OF_DAY = tournament.getProperty("TournamentStartTime", "20:00").split(",");
- +
- + TOURNAMENT_TIME = Integer.parseInt(tournament.getProperty("TournamentEventTime", "1"));
- +
- + TITLE_COLOR_TEAM1 = tournament.getProperty("TitleColorTeam_1", "FFFFFF");
- + TITLE_COLOR_TEAM2 = tournament.getProperty("TitleColorTeam_2", "FFFFFF");
- +
- + MSG_TEAM1 = tournament.getProperty("TitleTeam_1", "Team [1]");
- + MSG_TEAM2 = tournament.getProperty("TitleTeam_2", "Team [2]");
- +
- + Allow_Same_HWID_On_Tournament = Boolean.parseBoolean(tournament.getProperty("Allow_Same_HWID_On_Tournament", "true"));
- +
- + ARENA_NPC = Integer.parseInt(tournament.getProperty("NPCRegister", "1"));
- +
- + NPC_locx = Integer.parseInt(tournament.getProperty("Locx", "1"));
- + NPC_locy = Integer.parseInt(tournament.getProperty("Locy", "1"));
- + NPC_locz = Integer.parseInt(tournament.getProperty("Locz", "1"));
- + NPC_Heading = Integer.parseInt(tournament.getProperty("Heading", "1"));
- +
- + Tournament_locx = Integer.parseInt(tournament.getProperty("TournamentLocx", "1"));
- + Tournament_locy = Integer.parseInt(tournament.getProperty("TournamentLocy", "1"));
- + Tournament_locz = Integer.parseInt(tournament.getProperty("TournamentLocz", "1"));
- +
- + ALLOW_2X2_REGISTER = Boolean.parseBoolean(tournament.getProperty("Allow2x2Register", "true"));
- + ALLOW_4X4_REGISTER = Boolean.parseBoolean(tournament.getProperty("Allow4x4Register", "true"));
- + ALLOW_9X9_REGISTER = Boolean.parseBoolean(tournament.getProperty("Allow9x9Register", "true"));
- +
- + ALLOW_4X4_LOSTBUFF = Boolean.parseBoolean(tournament.getProperty("Allow4x4LostBuff", "false"));
- +
- + ARENA_MESSAGE_ENABLED = Boolean.parseBoolean(tournament.getProperty("ScreenArenaMessageEnable", "false"));
- + ARENA_MESSAGE_TEXT = tournament.getProperty("ScreenArenaMessageText", "Welcome to L2J server!");
- + ARENA_MESSAGE_TIME = Integer.parseInt(tournament.getProperty("ScreenArenaMessageTime", "10")) * 1000;
- +
- + String[] arenaLocs = tournament.getProperty("ArenasLoc", "").split(";");
- + String[] locSplit = null;
- + ARENA_EVENT_COUNT = arenaLocs.length;
- + ARENA_EVENT_LOCS = new int[ARENA_EVENT_COUNT][3];
- + for (int i = 0; i < ARENA_EVENT_COUNT; i++)
- + {
- + locSplit = arenaLocs[i].split(",");
- + for (int j = 0; j < 3; j++)
- + ARENA_EVENT_LOCS[i][j] = Integer.parseInt(locSplit[j].trim());
- + }
- + String[] arenaLocs4x4 = tournament.getProperty("Arenas4x4Loc", "").split(";");
- + String[] locSplit4x4 = null;
- + ARENA_EVENT_COUNT_4X4 = arenaLocs4x4.length;
- + ARENA_EVENT_LOCS_4X4 = new int[ARENA_EVENT_COUNT_4X4][3];
- + for (int i = 0; i < ARENA_EVENT_COUNT_4X4; i++)
- + {
- + locSplit4x4 = arenaLocs4x4[i].split(",");
- + for (int j = 0; j < 3; j++)
- + ARENA_EVENT_LOCS_4X4[i][j] = Integer.parseInt(locSplit4x4[j].trim());
- + }
- + String[] arenaLocs9x9 = tournament.getProperty("Arenas9x9Loc", "").split(";");
- + String[] locSplit8x8 = null;
- + ARENA_EVENT_COUNT_9X9 = arenaLocs9x9.length;
- + ARENA_EVENT_LOCS_9X9 = new int[ARENA_EVENT_COUNT_9X9][3];
- + int j;
- + for (int i = 0; i < ARENA_EVENT_COUNT_9X9; i++)
- + {
- + locSplit8x8 = arenaLocs9x9[i].split(",");
- + for (j = 0; j < 3; j++)
- + ARENA_EVENT_LOCS_9X9[i][j] = Integer.parseInt(locSplit8x8[j].trim());
- + }
- + duelist_COUNT_4X4 = tournament.getProperty("duelist_amount_4x4", 1);
- + dreadnought_COUNT_4X4 = tournament.getProperty("dreadnought_amount_4x4", 1);
- + tanker_COUNT_4X4 = tournament.getProperty("tanker_amount_4x4", 1);
- + dagger_COUNT_4X4 = tournament.getProperty("dagger_amount_4x4", 1);
- + archer_COUNT_4X4 = tournament.getProperty("archer_amount_4x4", 1);
- + bs_COUNT_4X4 = tournament.getProperty("bs_amount_4x4", 1);
- + archmage_COUNT_4X4 = tournament.getProperty("archmage_amount_4x4", 1);
- + soultaker_COUNT_4X4 = tournament.getProperty("soultaker_amount_4x4", 1);
- + mysticMuse_COUNT_4X4 = tournament.getProperty("mysticMuse_amount_4x4", 1);
- + stormScreamer_COUNT_4X4 = tournament.getProperty("stormScreamer_amount_4x4", 1);
- + titan_COUNT_4X4 = tournament.getProperty("titan_amount_4x4", 1);
- + dominator_COUNT_4X4 = tournament.getProperty("dominator_amount_4x4", 1);
- + doomcryer_COUNT_4X4 = tournament.getProperty("doomcryer_amount_4x4", 1);
- +
- + duelist_COUNT_9X9 = tournament.getProperty("duelist_amount_9x9", 1);
- + dreadnought_COUNT_9X9 = tournament.getProperty("dreadnought_amount_9x9", 1);
- + tanker_COUNT_9X9 = tournament.getProperty("tanker_amount_9x9", 1);
- + dagger_COUNT_9X9 = tournament.getProperty("dagger_amount_9x9", 1);
- + archer_COUNT_9X9 = tournament.getProperty("archer_amount_9x9", 1);
- + bs_COUNT_9X9 = tournament.getProperty("bs_amount_9x9", 1);
- + archmage_COUNT_9X9 = tournament.getProperty("archmage_amount_9x9", 1);
- + soultaker_COUNT_9X9 = tournament.getProperty("soultaker_amount_9x9", 1);
- + mysticMuse_COUNT_9X9 = tournament.getProperty("mysticMuse_amount_9x9", 1);
- + stormScreamer_COUNT_9X9 = tournament.getProperty("stormScreamer_amount_9x9", 1);
- + titan_COUNT_9X9 = tournament.getProperty("titan_amount_9x9", 1);
- + grandKhauatari_COUNT_9X9 = tournament.getProperty("grandKhauatari_amount_9x9", 1);
- + dominator_COUNT_9X9 = tournament.getProperty("dominator_amount_9x9", 1);
- + doomcryer_COUNT_9X9 = tournament.getProperty("doomcryer_amount_9x9", 1);
- +
- + ARENA_PVP_AMOUNT = tournament.getProperty("ArenaPvpJoin", 10);
- + ARENA_REWARD_ID = tournament.getProperty("ArenaRewardId", 57);
- + ARENA_WIN_REWARD_COUNT = tournament.getProperty("ArenaWinRewardCount", 1);
- + ARENA_LOST_REWARD_COUNT = tournament.getProperty("ArenaLostRewardCount", 1);
- +
- + ARENA_WIN_REWARD_COUNT_4X4 = tournament.getProperty("ArenaWinRewardCount4x4", 1);
- + ARENA_LOST_REWARD_COUNT_4X4 = tournament.getProperty("ArenaLostRewardCount4x4", 1);
- +
- + ARENA_WIN_REWARD_COUNT_9X9 = tournament.getProperty("ArenaWinRewardCount9x9", 1);
- + ARENA_LOST_REWARD_COUNT_9X9 = tournament.getProperty("ArenaLostRewardCount9x9", 1);
- +
- + ARENA_CHECK_INTERVAL = tournament.getProperty("ArenaBattleCheckInterval", 15) * 1000;
- + ARENA_CALL_INTERVAL = tournament.getProperty("ArenaBattleCallInterval", 60);
- +
- + ARENA_WAIT_INTERVAL = tournament.getProperty("ArenaBattleWaitInterval", 20);
- + ARENA_WAIT_INTERVAL_4X4 = tournament.getProperty("ArenaBattleWaitInterval4x4", 45);
- + ARENA_WAIT_INTERVAL_9X9 = tournament.getProperty("ArenaBattleWaitInterval9x9", 45);
- +
- + TOURNAMENT_ID_RESTRICT = tournament.getProperty("ItemsRestriction");
- +
- + TOURNAMENT_LISTID_RESTRICT = new ArrayList<>();
- + for (String id : TOURNAMENT_ID_RESTRICT.split(","))
- + TOURNAMENT_LISTID_RESTRICT.add(Integer.valueOf(Integer.parseInt(id)));
- + ARENA_SKILL_PROTECT = Boolean.parseBoolean(tournament.getProperty("ArenaSkillProtect", "false"));
- + for (String id : tournament.getProperty("ArenaDisableSkillList", "0").split(","))
- + ARENA_SKILL_LIST.add(Integer.valueOf(Integer.parseInt(id)));
- + for (String id : tournament.getProperty("DisableSkillList", "0").split(","))
- + ARENA_DISABLE_SKILL_LIST_PERM.add(Integer.valueOf(Integer.parseInt(id)));
- + for (String id : tournament.getProperty("ArenaDisableSkillList_noStart", "0").split(","))
- + ARENA_DISABLE_SKILL_LIST.add(Integer.valueOf(Integer.parseInt(id)));
- + for (String id : tournament.getProperty("ArenaStopSkillList", "0").split(","))
- + ARENA_STOP_SKILL_LIST.add(Integer.valueOf(Integer.parseInt(id)));
- + }
- +
- - // siege settings
- - loadSieges();
- + // siege settings
- + loadSieges();
- + // tournament settings
- + loadTour();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement