Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/config/CustomMods/Events/Tournament.ini b/config/CustomMods/Events/Tournament.ini
- new file mode 100644
- index 0000000..d8c3339
- --- /dev/null
- +++ b/config/CustomMods/Events/Tournament.ini
- @@ -0,0 +1,160 @@
- +TournamentStartOn = True
- +TournamentAutoEvent = True
- +TournamenAnnounce = True
- +TournamentSummon = False
- +
- +# ArenaStartTime= 15:30,22:30
- +TournamentStartTime = 14:00,22:18
- +TournamentEventTime = 45
- +
- +TitleColorTeam_1 = 00ff00
- +TitleColorTeam_2 = FFFF00
- +
- +# ID do NPC de Registro
- +NPCRegister = 10006
- +
- +# Local do NPC de Registro.
- +Locx = -20168
- +Locy = -21048
- +Locz = -3024
- +Heading = 32381
- +
- +# Local do NPC de Registro.
- +Locx2 = -21463
- +Locy2 = -21014
- +Locz2 = -3023
- +Heading2 = 776
- +
- +TournamentLocx = -20808
- +TournamentLocy = -21032
- +TournamentLocz = -3024
- +
- +Allow1x1Register = True
- +Allow3x3Register = True
- +Allow5x5Register = True
- +Allow9x9Register = True
- +
- +Allow5x5LostBuff = false
- +
- +ScreenArenaMessageEnable = True
- +ScreenArenaMessageText = Tournament Event
- +ScreenArenaMessageTime = 6
- +
- +Allow_Same_HWID_On_Tournament = True
- +
- +# Arenas Location 1x1
- +# e.g: 149360, 46594, -3415; x, y, z; x1, y1, z1
- +ArenasLoc1x1 = -120280,-225003,-3327;-102487,-209004,-3327;-120247,-207371,-3327;-87512,-224987,-3327;-81737,-213211,-3327;-87472,-207354,-3327;-93802,-218254,-3327;-77112,-218700,-3327;-69719,-209034,-3327;-76824,-201226,-3327;-109880,-218699,-3327;-126584,-218251,-3327;-109592,-201227,-3327;-87480,-240142,-3327;-81752,-245964,-3327;-77111,-251482,-3327;-69719,-241771,-3327;-76823,-233995,-3327;-93815,-251034,-3327;-87512,-257787,-3327;-114536,-213194,-3327;
- +
- +# Arenas Location 3x3
- +# e.g: 149360, 46594, -3415; x, y, z; x1, y1, z1
- +ArenasLoc3x3 = -120280,-225003,-3327;-102487,-209004,-3327;-120247,-207371,-3327;-87512,-224987,-3327;-81737,-213211,-3327;-87472,-207354,-3327;-93802,-218254,-3327;-77112,-218700,-3327;-69719,-209034,-3327;-76824,-201226,-3327;-109880,-218699,-3327;-126584,-218251,-3327;-109592,-201227,-3327;-87480,-240142,-3327;-81752,-245964,-3327;-77111,-251482,-3327;-69719,-241771,-3327;-76823,-233995,-3327;-93815,-251034,-3327;-87512,-257787,-3327;-114536,-213194,-3327;
- +
- +# Arenas Location 5x5
- +# e.g: 149360, 46594, -3415; x, y, z; x1, y1, z1
- +Arenas5x5Loc = -120280,-225003,-3327;-102487,-209004,-3327;-120247,-207371,-3327;-87512,-224987,-3327;-81737,-213211,-3327;-87472,-207354,-3327;-93802,-218254,-3327;-77112,-218700,-3327;-69719,-209034,-3327;-76824,-201226,-3327;-109880,-218699,-3327;-126584,-218251,-3327;-109592,-201227,-3327;-87480,-240142,-3327;-81752,-245964,-3327;-77111,-251482,-3327;-69719,-241771,-3327;-76823,-233995,-3327;-93815,-251034,-3327;-87512,-257787,-3327;-114536,-213194,-3327;
- +
- +# Arenas Location 9x9
- +# e.g: 149360, 46594, -3415; x, y, z; x1, y1, z1
- +Arenas9x9Loc = -120280,-225003,-3327;-102487,-209004,-3327;-120247,-207371,-3327;-87512,-224987,-3327;-81737,-213211,-3327;-87472,-207354,-3327;-93802,-218254,-3327;-77112,-218700,-3327;-69719,-209034,-3327;-76824,-201226,-3327;-109880,-218699,-3327;-126584,-218251,-3327;-109592,-201227,-3327;-87480,-240142,-3327;-81752,-245964,-3327;-77111,-251482,-3327;-69719,-241771,-3327;-76823,-233995,-3327;-93815,-251034,-3327;-87512,-257787,-3327;-114536,-213194,-3327;
- +
- +#===========================
- +# Class amount Arena 5x5 #
- +#===========================
- +bs_amount_5x5 = 0
- +archer_amount_5x5 = 3
- +dominator_amount_5x5 = 1
- +duelist_amount_5x5 = 1
- +dreadnought_amount_5x5 = 1
- +tanker_amount_5x5 = 1
- +dagger_amount_5x5 = 2
- +archmage_amount_5x5 = 3
- +soultaker_amount_5x5 = 3
- +mysticMuse_amount_5x5 = 3
- +stormScreamer_amount_5x5 = 3
- +titan_amount_5x5 = 1
- +grandKhauatari_amount_5x5 = 1
- +doomcryer_amount_5x5 = 1
- +
- +#===========================
- +# Class amount Arena 9x9 #
- +#===========================
- +bs_amount_9x9 = 2
- +archer_amount_9x9 = 9
- +dominator_amount_9x9 = 2
- +duelist_amount_9x9 = 1
- +dreadnought_amount_9x9 = 1
- +tanker_amount_9x9 = 1
- +dagger_amount_9x9 = 2
- +archmage_amount_9x9 = 9
- +soultaker_amount_9x9 = 9
- +mysticMuse_amount_9x9 = 9
- +stormScreamer_amount_9x9 = 9
- +titan_amount_9x9 = 1
- +grandKhauatari_amount_9x9 = 1
- +doomcryer_amount_9x9 = 2
- +
- +# Rate Drop VIP Winners
- +ArenaRateDropVIP = 1
- +# item to give to winners
- +ArenaRewardId = 57
- +
- +# Count of item to give to winners
- +ArenaWinRewardCount1x1 = 3
- +
- +# Count of item to give to losers
- +ArenaLostRewardCount1x1 = 0
- +
- +# Count of item to give to winners
- +ArenaWinRewardCount3x3 = 5
- +
- +# Count of item to give to losers
- +ArenaLostRewardCount3x3 = 0
- +
- +# Count of item to give to winners
- +ArenaWinRewardCount5x5 = 10
- +
- +# Count of item to give to losers
- +ArenaLostRewardCount5x5 = 2
- +
- +# Count of item to give to winners
- +ArenaWinRewardCount9x9 = 15
- +
- +# Count of item to give to losers
- +ArenaLostRewardCount9x9 = 3
- +
- +# Time between check players status [in seconds]
- +ArenaBattleCheckInterval = 5
- +
- +# Time between Call registered players [in seconds]
- +ArenaBattleCallInterval = 2
- +
- +# Time to start battle after players are called [in seconds]
- +ArenaBattleWaitInterval1x1 = 15
- +
- +ArenaBattleWaitInterval3x3 = 15
- +
- +ArenaBattleWaitInterval5x5 = 15
- +
- +ArenaBattleWaitInterval9x9 = 30
- +
- +# Tournament Restriction Items
- +# format: id,id,id
- +ItemsRestriction = 737,3936,3959,8627,8639,6387
- +
- +# Remover efeito e desativar Skill em Arena
- +ArenaSkillProtect = True
- +
- +#Lista de Skill Proibidas
- +ArenaDisableSkillList = 1410,438,1016,1254,3160,1410,3123
- +
- +#desativar skill ao iniciar
- +ArenaDisableSkillList_noStart = 313,420,176,139,406
- +
- +#Remover efeito das skills
- +ArenaStopSkillList = 420,406,176,139,1410,438,313,5105,5104
- +
- +DebugArena = False
- +
- +#Desativar permanentement
- +DisableSkillList = 395,1419,458,457,454,460,459,1423,1424,1426,455,1421,1428,1420,456,1427
- diff --git a/head-src/Dev/Tournament/Arena1x1.java b/head-src/Dev/Tournament/Arena1x1.java
- new file mode 100644
- index 0000000..7b44a28
- --- /dev/null
- +++ b/head-src/Dev/Tournament/Arena1x1.java
- @@ -0,0 +1,684 @@
- +package Dev.Tournament;
- +
- +import com.l2jfrozen.gameserver.model.L2Character;
- +import com.l2jfrozen.gameserver.model.L2Effect;
- +import com.l2jfrozen.gameserver.model.L2Summon;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PetInstance;
- +import com.l2jfrozen.gameserver.model.base.ClassId;
- +import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +import com.l2jfrozen.gameserver.util.Broadcast;
- +import com.l2jfrozen.util.random.Rnd;
- +import java.util.ArrayList;
- +import java.util.HashMap;
- +import java.util.List;
- +import java.util.Map;
- +
- +import Dev.Tournament.properties.ArenaConfig;
- +import Dev.Tournament.properties.ArenaTask;
- +
- +public class Arena1x1 implements Runnable
- +{
- + // list of participants
- + public static List<Pair> registered;
- + // number of Arenas
- + int free = ArenaConfig.ARENA_EVENT_COUNT_1X1;
- + // Arenas
- + Arena[] arenas = new Arena[ArenaConfig.ARENA_EVENT_COUNT_1X1];
- + // list of fights going on
- + Map<Integer, String> fights = new HashMap<>(ArenaConfig.ARENA_EVENT_COUNT_1X1);
- +
- + public Arena1x1()
- + {
- + registered = new ArrayList<>();
- + int[] coord;
- + for (int i = 0; i < ArenaConfig.ARENA_EVENT_COUNT_1X1; i++)
- + {
- + coord = ArenaConfig.ARENA_EVENT_LOCS_1X1[i];
- + arenas[i] = new Arena(i, coord[0], coord[1], coord[2]);
- + }
- + }
- +
- + public static Arena1x1 getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + public boolean register(L2PcInstance player)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player)
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return false;
- + }
- + }
- + return registered.add(new Pair(player));
- + }
- +
- + public boolean isRegistered(L2PcInstance player)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player)
- + {
- + return true;
- + }
- + }
- + return false;
- + }
- +
- + public Map<Integer, String> getFights()
- + {
- + return fights;
- + }
- +
- + public boolean remove(L2PcInstance player)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player)
- + {
- + p.removeMessage();
- + registered.remove(p);
- + return true;
- + }
- + }
- + return false;
- + }
- +
- + @Override
- + public synchronized void run()
- + {
- + boolean load = true;
- +
- + // while server is running
- + while (load)
- + {
- + if (!ArenaTask.is_started())
- + load = false;
- +
- + // if no have participants or arenas are busy wait 1 minute
- + if (registered.size() < 2 || free == 0)
- + {
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CALL_INTERVAL * 1000);
- + }
- + catch (InterruptedException e)
- + {
- + }
- + continue;
- + }
- + List<Pair> opponents = selectOpponents();
- + if (opponents != null && opponents.size() == 2)
- + {
- + Thread T = new Thread(new EvtArenaTask(opponents));
- + T.setDaemon(true);
- + T.start();
- + }
- + // wait 1 minute for not stress server
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CALL_INTERVAL * 1000);
- + }
- + catch (InterruptedException e)
- + {
- + }
- + }
- + }
- +
- + @SuppressWarnings("null")
- + private List<Pair> selectOpponents()
- + {
- + List<Pair> opponents = new ArrayList<>();
- + Pair pairOne = null, pairTwo = null;
- + int tries = 3;
- + do
- + {
- + int first = 0, 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;
- + }
- +
- + }
- + }
- + while ((pairOne == null || pairTwo == null) && --tries > 0);
- + return opponents;
- + }
- +
- + public void clear()
- + {
- + registered.clear();
- + }
- +
- + public static int getRegisteredCount()
- + {
- + return registered.size();
- + }
- +
- + private class Pair
- + {
- + private L2PcInstance leader;
- +
- + public Pair(L2PcInstance leader)
- + {
- + this.leader = leader;
- + }
- +
- + public L2PcInstance getLeader()
- + {
- + return leader;
- + }
- +
- + public boolean check()
- + {
- + if ((!(leader == null || leader.isOnline() == 1)))
- + return false;
- +
- + return true;
- + }
- +
- + public boolean isDead()
- + {
- + if (ArenaConfig.ARENA_PROTECT)
- + {
- + if (leader != null && leader.isOnline() == 1 && leader.isArenaAttack() && !leader.isDead() && !leader.isInsideZone(L2Character.ARENA_EVENT))
- + leader.logout();
- + }
- +
- + if ((leader == null || leader.isDead() || !(leader.isOnline() == 1) || !leader.isInsideZone(L2Character.ARENA_EVENT) || !leader.isArenaAttack()))
- + return false;
- +
- + return !(leader.isDead());
- + }
- +
- + public boolean isAlive()
- + {
- + if ((leader == null || leader.isDead() || !(leader.isOnline() == 1) || !leader.isInsideZone(L2Character.ARENA_EVENT) || !leader.isArenaAttack()))
- + return false;
- +
- + return !(leader.isDead());
- + }
- +
- + public void teleportTo(int x, int y, int z)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!leader.isInJail())
- + leader.teleToLocation(x, y, z);
- +
- + leader.broadcastUserInfo();
- + }
- + }
- +
- + public void EventTitle(String title, String color)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setTitle(title);
- + leader.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- + }
- +
- + public void saveTitle()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader._originalTitleColorTournament = leader.getAppearance().getTitleColor();
- + leader._originalTitleTournament = leader.getTitle();
- + }
- + }
- +
- + public void backTitle()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setTitle(leader._originalTitleTournament);
- + leader.getAppearance().setTitleColor(leader._originalTitleColorTournament);
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- + }
- +
- + public void setArenaInstance()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInstanceId(1); //1x1 Tournament Instance
- + }
- +
- + public void setRealInstance()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInstanceId(0);
- + }
- +
- + public void rewards()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + if (leader.isVip())
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_1X1 * ArenaConfig.ARENA_VIP_DROP_RATE, leader, true);
- + else
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_1X1, leader, true);
- + }
- +
- + sendPacket("Congratulations, your team won the event!", 5);
- + }
- +
- + public void rewardsLost()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + if (leader.isVip())
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_1X1 * ArenaConfig.ARENA_VIP_DROP_RATE, leader, true);
- + else
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_1X1, leader, true);
- + }
- +
- + sendPacket("your team lost the event! =(", 5);
- + }
- +
- + public void setInTournamentEvent(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInArenaEvent(val);
- + }
- +
- + public void removeMessage()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.sendMessage("Tournament: Your participation has been removed.");
- + leader.setArenaProtection(false);
- + leader.setArena1x1(false);
- + }
- + }
- +
- + public void setArenaProtection(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setArenaProtection(val);
- + leader.setArena1x1(val);
- + }
- + }
- +
- + public void revive()
- + {
- + if (leader != null && leader.isOnline() == 1 && leader.isDead())
- + leader.doRevive();
- + }
- +
- + public void setImobilised(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setIsInvul(val);
- + leader.setStopArena(val);
- + }
- + }
- +
- + public void setArenaAttack(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setArenaAttack(val);
- + leader.broadcastUserInfo();
- + }
- + }
- +
- + public void removePet()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (leader.getPet() != null)
- + {
- + L2Summon summon = leader.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(leader);
- + }
- +
- + if (leader.getMountType() == 1 || leader.getMountType() == 2)
- + leader.dismount();
- + }
- + }
- +
- + public void removeSkills()
- + {
- + if (!(leader.getClassId() == ClassId.shillenElder || leader.getClassId() == ClassId.shillienSaint || leader.getClassId() == ClassId.bishop || leader.getClassId() == ClassId.cardinal || leader.getClassId() == ClassId.elder || leader.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : leader.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + leader.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- + }
- +
- + public void sendPacket(String message, int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + }
- +
- + public void inicarContagem(int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(leader, duration), 0);
- + }
- +
- + public void sendPacketinit(String message, int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + }
- + }
- +
- + private class EvtArenaTask implements Runnable
- + {
- + private final Pair pairOne;
- + private final Pair pairTwo;
- + private final int pOneX, pOneY, pOneZ, pTwoX, pTwoY, pTwoZ;
- + private Arena arena;
- +
- + public EvtArenaTask(List<Pair> opponents)
- + {
- + pairOne = opponents.get(0);
- + pairTwo = opponents.get(1);
- + L2PcInstance 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--;
- + pairOne.saveTitle();
- + pairTwo.saveTitle();
- + portPairsToArena();
- + pairOne.inicarContagem(ArenaConfig.ARENA_WAIT_INTERVAL_1X1);
- + pairTwo.inicarContagem(ArenaConfig.ARENA_WAIT_INTERVAL_1X1);
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_WAIT_INTERVAL_1X1 * 1000);
- + }
- + catch (InterruptedException e1)
- + {
- + }
- + pairOne.sendPacketinit("Started. Good Fight!", 3);
- + pairTwo.sendPacketinit("Started. Good Fight!", 3);
- + pairOne.EventTitle(ArenaConfig.MSG_TEAM1, ArenaConfig.TITLE_COLOR_TEAM1);
- + pairTwo.EventTitle(ArenaConfig.MSG_TEAM2, ArenaConfig.TITLE_COLOR_TEAM2);
- + pairOne.setImobilised(false);
- + pairTwo.setImobilised(false);
- + pairOne.setArenaAttack(true);
- + pairTwo.setArenaAttack(true);
- +
- + while (check())
- + {
- + // check players status each seconds
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CHECK_INTERVAL);
- + }
- + catch (InterruptedException e)
- + {
- + break;
- + }
- + }
- + finishDuel();
- + free++;
- + }
- +
- + private void finishDuel()
- + {
- + fights.remove(arena.id);
- + rewardWinner();
- + pairOne.revive();
- + pairTwo.revive();
- + pairOne.teleportTo(pOneX, pOneY, pOneZ);
- + pairTwo.teleportTo(pTwoX, pTwoY, pTwoZ);
- + pairOne.backTitle();
- + pairTwo.backTitle();
- + pairOne.setRealInstance();
- + pairTwo.setRealInstance();
- + pairOne.setInTournamentEvent(false);
- + pairTwo.setInTournamentEvent(false);
- + pairOne.setArenaProtection(false);
- + pairTwo.setArenaProtection(false);
- + pairOne.setArenaAttack(false);
- + pairTwo.setArenaAttack(false);
- + arena.setFree(true);
- + }
- +
- + private void rewardWinner()
- + {
- + L2PcInstance leader1 = pairOne.getLeader();
- + L2PcInstance leader2 = pairTwo.getLeader();
- +
- + if (pairOne.isAlive() && !pairTwo.isAlive())
- + {
- + if (ArenaConfig.TOURNAMENT_EVENT_ANNOUNCE)
- + Broadcast.gameAnnounceToOnlinePlayers("(1X1): (" + leader1.getName() + " VS " + leader2.getName() + ") ~> " + leader1.getName() + " win!");
- +
- + pairOne.rewards();
- + pairTwo.rewardsLost();
- + }
- +
- + if (pairTwo.isAlive() && !pairOne.isAlive())
- + {
- + if (ArenaConfig.TOURNAMENT_EVENT_ANNOUNCE)
- + Broadcast.gameAnnounceToOnlinePlayers("(1X1): (" + leader1.getName() + " VS " + leader2.getName() + ") ~> " + leader2.getName() + " win!");
- +
- + pairTwo.rewards();
- + pairOne.rewardsLost();
- + }
- + }
- +
- + private boolean check()
- + {
- + return (pairOne.isDead() && pairTwo.isDead());
- + }
- +
- + private void portPairsToArena()
- + {
- + for (Arena arena : arenas)
- + {
- + if (arena.isFree)
- + {
- + this.arena = arena;
- + arena.setFree(false);
- + pairOne.removePet();
- + pairTwo.removePet();
- + pairOne.setArenaInstance();
- + pairTwo.setArenaInstance();
- + 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(this.arena.id, pairOne.getLeader().getName() + " vs " + pairTwo.getLeader().getName());
- + break;
- + }
- + }
- + }
- + }
- +
- + private class Arena
- + {
- + protected int x, y, 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 L2PcInstance _player;
- + private int _time;
- +
- + public countdown(L2PcInstance player, int time)
- + {
- + _time = time;
- + _player = player;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_player.isOnline() == 1)
- + {
- +
- + switch (_time)
- + {
- + case 300:
- + case 240:
- + case 180:
- + case 120:
- + case 57:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in 60 second(s)..", 4000));
- + _player.sendMessage("60 second(s) to start the battle.");
- + }
- + break;
- + case 45:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 27:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in 30 second(s)..", 4000));
- + _player.sendMessage("30 second(s) to start the battle.");
- + }
- + break;
- + case 20:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 15:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 10:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 5:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 4:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 3:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 2:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 1:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + }
- + if (_time > 1)
- + {
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(_player, _time - 1), 1000);
- + }
- + }
- + }
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final Arena1x1 INSTANCE = new Arena1x1();
- + }
- +}
- \ No newline at end of file
- diff --git a/head-src/Dev/Tournament/Arena3x3.java b/head-src/Dev/Tournament/Arena3x3.java
- new file mode 100644
- index 0000000..b8ea57a
- --- /dev/null
- +++ b/head-src/Dev/Tournament/Arena3x3.java
- @@ -0,0 +1,988 @@
- +package Dev.Tournament;
- +
- +import com.l2jfrozen.gameserver.model.L2Character;
- +import com.l2jfrozen.gameserver.model.L2Effect;
- +import com.l2jfrozen.gameserver.model.L2Summon;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PetInstance;
- +import com.l2jfrozen.gameserver.model.base.ClassId;
- +import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +import com.l2jfrozen.gameserver.util.Broadcast;
- +import com.l2jfrozen.util.random.Rnd;
- +
- +import java.util.ArrayList;
- +import java.util.HashMap;
- +import java.util.List;
- +import java.util.Map;
- +
- +import Dev.Tournament.properties.ArenaConfig;
- +import Dev.Tournament.properties.ArenaTask;
- +
- +public class Arena3x3 implements Runnable
- +{
- + // list of participants
- + public static List<Pair> registered;
- + // number of Arenas
- + int free = ArenaConfig.ARENA_EVENT_COUNT_3X3;
- + // Arenas
- + Arena[] arenas = new Arena[ArenaConfig.ARENA_EVENT_COUNT_3X3];
- + // list of fights going on
- + Map<Integer, String> fights = new HashMap<>(ArenaConfig.ARENA_EVENT_COUNT_3X3);
- +
- + public Arena3x3()
- + {
- + registered = new ArrayList<>();
- + int[] coord;
- + for (int i = 0; i < ArenaConfig.ARENA_EVENT_COUNT_3X3; i++)
- + {
- + coord = ArenaConfig.ARENA_EVENT_LOCS_3X3[i];
- + arenas[i] = new Arena(i, coord[0], coord[1], coord[2]);
- + }
- + }
- +
- + public static Arena3x3 getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + public boolean register(L2PcInstance player, L2PcInstance assist, L2PcInstance assist2)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player || p.getAssist() == player)
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist || p.getAssist() == assist)
- + {
- + player.sendMessage("Tournament: " + assist.getName() + " already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist2 || p.getAssist2() == assist2)
- + {
- + player.sendMessage("Tournament: " + assist2.getName() + " already registered!");
- + return false;
- + }
- + }
- + return registered.add(new Pair(player, assist, assist2));
- + }
- +
- + public boolean isRegistered(L2PcInstance player)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player || p.getAssist() == player || p.getAssist2() == player)
- + {
- + return true;
- + }
- + }
- + return false;
- + }
- +
- + public Map<Integer, String> getFights()
- + {
- + return fights;
- + }
- +
- + public boolean remove(L2PcInstance player)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player || p.getAssist() == player || p.getAssist2() == player)
- + {
- + p.removeMessage();
- + registered.remove(p);
- + return true;
- + }
- + }
- + return false;
- + }
- +
- + @Override
- + public synchronized void run()
- + {
- + boolean load = true;
- +
- + // while server is running
- + while (load)
- + {
- + if (!ArenaTask.is_started())
- + load = false;
- +
- + // if no have participants or arenas are busy wait 1 minute
- + if (registered.size() < 2 || free == 0)
- + {
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CALL_INTERVAL * 1000);
- + }
- + catch (InterruptedException e)
- + {
- + }
- + continue;
- + }
- + List<Pair> opponents = selectOpponents();
- + if (opponents != null && opponents.size() == 2)
- + {
- + Thread T = new Thread(new EvtArenaTask(opponents));
- + T.setDaemon(true);
- + T.start();
- + }
- + // wait 1 minute for not stress server
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CALL_INTERVAL * 1000);
- + }
- + catch (InterruptedException e)
- + {
- + }
- + }
- + }
- +
- + @SuppressWarnings("null")
- + private List<Pair> selectOpponents()
- + {
- + List<Pair> opponents = new ArrayList<>();
- + Pair pairOne = null, pairTwo = null;
- + int tries = 3;
- + do
- + {
- + int first = 0, 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;
- + }
- +
- + }
- + }
- + while ((pairOne == null || pairTwo == null) && --tries > 0);
- + return opponents;
- + }
- +
- + public void clear()
- + {
- + registered.clear();
- + }
- +
- + public int getRegisteredCount()
- + {
- + return registered.size();
- + }
- +
- + private class Pair
- + {
- + private L2PcInstance leader, assist, assist2;
- +
- + public Pair(L2PcInstance leader, L2PcInstance assist, L2PcInstance assist2)
- + {
- + this.leader = leader;
- + this.assist = assist;
- + this.assist2 = assist2;
- + }
- +
- + public L2PcInstance getAssist()
- + {
- + return assist;
- + }
- +
- + public L2PcInstance getAssist2()
- + {
- + return assist2;
- + }
- +
- + public L2PcInstance getLeader()
- + {
- + return leader;
- + }
- +
- + public boolean check()
- + {
- + if ((leader == null || !(leader.isOnline() == 1)))
- + {
- + if (assist != null || assist.isOnline() == 1)
- + assist.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist2 != null || assist2.isOnline() == 1)
- + assist2.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + return false;
- + }
- +
- + else if (((assist == null || !(assist.isOnline() == 1) || (assist2 == null || !(assist2.isOnline() == 1)) && (leader != null || leader.isOnline() == 1))))
- + {
- + leader.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist != null || assist.isOnline() == 1)
- + assist.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist2 != null || assist2.isOnline() ==1)
- + assist2.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + return false;
- + }
- + return true;
- + }
- +
- + public boolean isDead()
- + {
- + if (ArenaConfig.ARENA_PROTECT)
- + {
- + if (leader != null && leader.isOnline() == 1 && leader.isArenaAttack() && !leader.isDead() && !leader.isInsideZone(L2Character.ARENA_EVENT))
- + leader.logout();
- + if (assist != null && assist.isOnline() == 1 && assist.isArenaAttack() && !assist.isDead() && !assist.isInsideZone(L2Character.ARENA_EVENT))
- + assist.logout();
- + if (assist2 != null && assist2.isOnline() == 1 && assist2.isArenaAttack() && !assist2.isDead() && !assist2.isInsideZone(L2Character.ARENA_EVENT))
- + assist2.logout();
- + }
- +
- + if ((leader == null || leader.isDead() || !(leader.isOnline() == 1) || !leader.isInsideZone(L2Character.ARENA_EVENT) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !(assist.isOnline() == 1) || !assist.isInsideZone(L2Character.ARENA_EVENT) || !assist.isArenaAttack()) && (assist2 == null || assist2.isDead() || !(assist2.isOnline() == 1) || !assist2.isInsideZone(L2Character.ARENA_EVENT)))
- + return false;
- +
- + return !(leader.isDead() && assist.isDead() && assist2.isDead());
- + }
- +
- + public boolean isAlive()
- + {
- + if ((leader == null || leader.isDead() || !(leader.isOnline() == 1) || !leader.isInsideZone(L2Character.ARENA_EVENT) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !(assist.isOnline() == 1) || !assist.isInsideZone(L2Character.ARENA_EVENT) || !assist.isArenaAttack()) && (assist2 == null || assist2.isDead() || !(assist2.isOnline() == 1) || !assist2.isInsideZone(L2Character.ARENA_EVENT)))
- + return false;
- +
- + return !(leader.isDead() && assist.isDead() && assist2.isDead());
- + }
- +
- + public void teleportTo(int x, int y, int z)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!leader.isInJail())
- + leader.teleToLocation(x, y, z);
- +
- + leader.broadcastUserInfo();
- +
- + }
- + if (assist != null && assist.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist.isInJail())
- + assist.teleToLocation(x, y + 200, z);
- +
- + assist.broadcastUserInfo();
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist2.isInJail())
- + assist2.teleToLocation(x, y + 150, z);
- +
- + assist2.broadcastUserInfo();
- + }
- + }
- +
- + public void EventTitle(String title, String color)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setTitle(title);
- + leader.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setTitle(title);
- + assist.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setTitle(title);
- + assist2.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist2.broadcastUserInfo();
- + assist2.broadcastTitleInfo();
- + }
- + }
- +
- + public void saveTitle()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader._originalTitleColorTournament = leader.getAppearance().getTitleColor();
- + leader._originalTitleTournament = leader.getTitle();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist._originalTitleColorTournament = assist.getAppearance().getTitleColor();
- + assist._originalTitleTournament = assist.getTitle();
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2._originalTitleColorTournament = assist2.getAppearance().getTitleColor();
- + assist2._originalTitleTournament = assist2.getTitle();
- + }
- + }
- +
- + public void backTitle()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setTitle(leader._originalTitleTournament);
- + leader.getAppearance().setTitleColor(leader._originalTitleColorTournament);
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setTitle(assist._originalTitleTournament);
- + assist.getAppearance().setTitleColor(assist._originalTitleColorTournament);
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setTitle(assist2._originalTitleTournament);
- + assist2.getAppearance().setTitleColor(assist2._originalTitleColorTournament);
- + assist2.broadcastUserInfo();
- + assist2.broadcastTitleInfo();
- + }
- + }
- +
- + public void setArenaInstance()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInstanceId(2); //3x3 Tournament Instance
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.setInstanceId(2); //3x3 Tournament Instance
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.setInstanceId(2); //3x3 Tournament Instance
- + }
- +
- + public void setRealInstance()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInstanceId(0);
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.setInstanceId(0);
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.setInstanceId(0);
- + }
- +
- + public void rewards()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + if (leader.isVip())
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_3X3 * ArenaConfig.ARENA_VIP_DROP_RATE, leader, true);
- + else
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_3X3, leader, true);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + if (assist.isVip())
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_3X3 * ArenaConfig.ARENA_VIP_DROP_RATE, assist, true);
- + else
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_3X3, assist, true);
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + if (assist2.isVip())
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_3X3 * ArenaConfig.ARENA_VIP_DROP_RATE, assist2, true);
- + else
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_3X3, assist2, true);
- + }
- +
- + sendPacket("Congratulations, your team won the event!", 5);
- + }
- +
- + public void rewardsLost()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + if (leader.isVip())
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_3X3 * ArenaConfig.ARENA_VIP_DROP_RATE, leader, true);
- + else
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_3X3, leader, true);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + if (assist.isVip())
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_3X3 * ArenaConfig.ARENA_VIP_DROP_RATE, assist, true);
- + else
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_3X3, assist, true);
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + if (assist2.isVip())
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_3X3 * ArenaConfig.ARENA_VIP_DROP_RATE, assist2, true);
- + else
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_3X3, assist2, true);
- + }
- +
- + sendPacket("your team lost the event! =(", 5);
- + }
- +
- + public void setInTournamentEvent(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInArenaEvent(val);
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.setInArenaEvent(val);
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.setInArenaEvent(val);
- + }
- +
- + public void removeMessage()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.sendMessage("Tournament: Your participation has been removed.");
- + leader.setArenaProtection(false);
- + leader.setArena3x3(false);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.sendMessage("Tournament: Your participation has been removed.");
- + assist.setArenaProtection(false);
- + assist.setArena3x3(false);
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.sendMessage("Tournament: Your participation has been removed.");
- + assist2.setArenaProtection(false);
- + assist2.setArena3x3(false);
- + }
- + }
- +
- + public void setArenaProtection(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setArenaProtection(val);
- + leader.setArena3x3(val);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setArenaProtection(val);
- + assist.setArena3x3(val);
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setArenaProtection(val);
- + assist2.setArena3x3(val);
- + }
- + }
- +
- + public void revive()
- + {
- + if (leader != null && leader.isOnline() == 1 && leader.isDead())
- + leader.doRevive();
- +
- + if (assist != null && assist.isOnline() == 1 && assist.isDead())
- + assist.doRevive();
- +
- + if (assist2 != null && assist2.isOnline() == 1 && assist2.isDead())
- + assist2.doRevive();
- + }
- +
- + public void setImobilised(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setIsInvul(val);
- + leader.setStopArena(val);
- + }
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setIsInvul(val);
- + assist.setStopArena(val);
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setIsInvul(val);
- + assist2.setStopArena(val);
- + }
- + }
- +
- + public void setArenaAttack(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setArenaAttack(val);
- + leader.broadcastUserInfo();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setArenaAttack(val);
- + assist.broadcastUserInfo();
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setArenaAttack(val);
- + assist2.broadcastUserInfo();
- + }
- + }
- +
- + public void removePet()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (leader.getPet() != null)
- + {
- + L2Summon summon = leader.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(leader);
- + }
- +
- + if (leader.getMountType() == 1 || leader.getMountType() == 2)
- + leader.dismount();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist.getPet() != null)
- + {
- + L2Summon summon = assist.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist);
- + }
- +
- + if (assist.getMountType() == 1 || assist.getMountType() == 2)
- + assist.dismount();
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist2.getPet() != null)
- + {
- + L2Summon summon = assist2.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist2);
- +
- + }
- +
- + if (assist2.getMountType() == 1 || assist2.getMountType() == 2)
- + assist2.dismount();
- + }
- + }
- +
- + public void removeSkills()
- + {
- + if (!(leader.getClassId() == ClassId.shillenElder || leader.getClassId() == ClassId.shillienSaint || leader.getClassId() == ClassId.bishop || leader.getClassId() == ClassId.cardinal || leader.getClassId() == ClassId.elder || leader.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : leader.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + leader.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist.getClassId() == ClassId.shillenElder || assist.getClassId() == ClassId.shillienSaint || assist.getClassId() == ClassId.bishop || assist.getClassId() == ClassId.cardinal || assist.getClassId() == ClassId.elder || assist.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist2.getClassId() == ClassId.shillenElder || assist2.getClassId() == ClassId.shillienSaint || assist2.getClassId() == ClassId.bishop || assist2.getClassId() == ClassId.cardinal || assist2.getClassId() == ClassId.elder || assist2.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist2.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist2.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- + }
- +
- + public void sendPacket(String message, int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- + }
- +
- + public void inicarContagem(int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(leader, duration), 0);
- +
- + if (assist != null && assist.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist, duration), 0);
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist2, duration), 0);
- + }
- +
- + public void sendPacketinit(String message, int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- + }
- + }
- +
- + private class EvtArenaTask implements Runnable
- + {
- + private final Pair pairOne;
- + private final Pair pairTwo;
- + private final int pOneX, pOneY, pOneZ, pTwoX, pTwoY, pTwoZ;
- + private Arena arena;
- +
- + public EvtArenaTask(List<Pair> opponents)
- + {
- + pairOne = opponents.get(0);
- + pairTwo = opponents.get(1);
- + L2PcInstance 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--;
- + pairOne.saveTitle();
- + pairTwo.saveTitle();
- + portPairsToArena();
- + pairOne.inicarContagem(ArenaConfig.ARENA_WAIT_INTERVAL_3X3);
- + pairTwo.inicarContagem(ArenaConfig.ARENA_WAIT_INTERVAL_3X3);
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_WAIT_INTERVAL_3X3 * 1000);
- + }
- + catch (InterruptedException e1)
- + {
- + }
- + pairOne.sendPacketinit("Started. Good Fight!", 3);
- + pairTwo.sendPacketinit("Started. Good Fight!", 3);
- + pairOne.EventTitle(ArenaConfig.MSG_TEAM1, ArenaConfig.TITLE_COLOR_TEAM1);
- + pairTwo.EventTitle(ArenaConfig.MSG_TEAM2, ArenaConfig.TITLE_COLOR_TEAM2);
- + pairOne.setImobilised(false);
- + pairTwo.setImobilised(false);
- + pairOne.setArenaAttack(true);
- + pairTwo.setArenaAttack(true);
- +
- + while (check())
- + {
- + // check players status each seconds
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CHECK_INTERVAL);
- + }
- + catch (InterruptedException e)
- + {
- + break;
- + }
- + }
- + finishDuel();
- + free++;
- + }
- +
- + private void finishDuel()
- + {
- + fights.remove(arena.id);
- + rewardWinner();
- + pairOne.revive();
- + pairTwo.revive();
- + pairOne.teleportTo(pOneX, pOneY, pOneZ);
- + pairTwo.teleportTo(pTwoX, pTwoY, pTwoZ);
- + pairOne.backTitle();
- + pairTwo.backTitle();
- + pairOne.setRealInstance();
- + pairTwo.setRealInstance();
- + 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())
- + {
- + L2PcInstance leader1 = pairOne.getLeader();
- + L2PcInstance leader2 = pairTwo.getLeader();
- +
- + if (leader1.getClan() != null && leader2.getClan() != null && ArenaConfig.TOURNAMENT_EVENT_ANNOUNCE)
- + Broadcast.gameAnnounceToOnlinePlayers("(3X3): (" + leader1.getClan().getName() + " VS " + leader2.getClan().getName() + ") ~> " + leader1.getClan().getName() + " win!");
- +
- + pairOne.rewards();
- + pairTwo.rewardsLost();
- + }
- + else if (pairTwo.isAlive() && !pairOne.isAlive())
- + {
- + L2PcInstance leader1 = pairTwo.getLeader();
- + L2PcInstance leader2 = pairOne.getLeader();
- +
- + if (leader1.getClan() != null && leader2.getClan() != null && ArenaConfig.TOURNAMENT_EVENT_ANNOUNCE)
- + Broadcast.gameAnnounceToOnlinePlayers("(3X3): (" + 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 (Arena arena : arenas)
- + {
- + if (arena.isFree)
- + {
- + this.arena = arena;
- + arena.setFree(false);
- + pairOne.removePet();
- + pairTwo.removePet();
- + pairOne.setArenaInstance();
- + pairTwo.setArenaInstance();
- + 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(this.arena.id, pairOne.getLeader().getName() + " vs " + pairTwo.getLeader().getName());
- + break;
- + }
- + }
- + }
- + }
- +
- + private class Arena
- + {
- + protected int x, y, 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 L2PcInstance _player;
- + private int _time;
- +
- + public countdown(L2PcInstance player, int time)
- + {
- + _time = time;
- + _player = player;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_player.isOnline() == 1)
- + {
- +
- + switch (_time)
- + {
- + case 300:
- + case 240:
- + case 180:
- + case 120:
- + case 57:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in 60 second(s)..", 4000));
- + _player.sendMessage("60 second(s) to start the battle.");
- + }
- + break;
- + case 45:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 27:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in 30 second(s)..", 4000));
- + _player.sendMessage("30 second(s) to start the battle.");
- + }
- + break;
- + case 20:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 15:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 10:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 5:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 4:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 3:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 2:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 1:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + }
- + if (_time > 1)
- + {
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(_player, _time - 1), 1000);
- + }
- + }
- + }
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final Arena3x3 INSTANCE = new Arena3x3();
- + }
- +}
- \ No newline at end of file
- diff --git a/head-src/Dev/Tournament/Arena5x5.java b/head-src/Dev/Tournament/Arena5x5.java
- new file mode 100644
- index 0000000..2c49141
- --- /dev/null
- +++ b/head-src/Dev/Tournament/Arena5x5.java
- @@ -0,0 +1,1286 @@
- +package Dev.Tournament;
- +
- +import com.l2jfrozen.gameserver.model.L2Character;
- +import com.l2jfrozen.gameserver.model.L2Effect;
- +import com.l2jfrozen.gameserver.model.L2Summon;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PetInstance;
- +import com.l2jfrozen.gameserver.model.base.ClassId;
- +import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +import com.l2jfrozen.gameserver.util.Broadcast;
- +import com.l2jfrozen.util.random.Rnd;
- +
- +import java.util.ArrayList;
- +import java.util.HashMap;
- +import java.util.List;
- +import java.util.Map;
- +
- +import Dev.Tournament.properties.ArenaConfig;
- +import Dev.Tournament.properties.ArenaTask;
- +
- +public class Arena5x5 implements Runnable
- +{
- + // list of participants
- + public static List<Pair> registered;
- + // number of Arenas
- + int free = ArenaConfig.ARENA_EVENT_COUNT_5X5;
- + // Arenas
- + Arena[] arenas = new Arena[ArenaConfig.ARENA_EVENT_COUNT_5X5];
- + // list of fights going on
- + Map<Integer, String> fights = new HashMap<>(ArenaConfig.ARENA_EVENT_COUNT_5X5);
- +
- + public Arena5x5()
- + {
- + registered = new ArrayList<>();
- + int[] coord;
- + for (int i = 0; i < ArenaConfig.ARENA_EVENT_COUNT_5X5; i++)
- + {
- + coord = ArenaConfig.ARENA_EVENT_LOCS_5X5[i];
- + arenas[i] = new Arena(i, coord[0], coord[1], coord[2]);
- + }
- + }
- +
- + public static Arena5x5 getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + public boolean register(L2PcInstance player, L2PcInstance assist, L2PcInstance assist2, L2PcInstance assist3, L2PcInstance assist4)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player || p.getAssist() == player)
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist || p.getAssist() == assist)
- + {
- + player.sendMessage("Tournament: " + assist.getName() + " already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist2 || p.getAssist2() == assist2)
- + {
- + player.sendMessage("Tournament: " + assist2.getName() + " already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist3 || p.getAssist3() == assist3)
- + {
- + player.sendMessage("Tournament: " + assist3.getName() + " already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist4 || p.getAssist4() == assist4)
- + {
- + player.sendMessage("Tournament: " + assist4.getName() + " already registered!");
- + return false;
- + }
- + }
- + return registered.add(new Pair(player, assist, assist2, assist3, assist4));
- + }
- +
- + public boolean isRegistered(L2PcInstance player)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player || p.getAssist() == player || p.getAssist2() == player || p.getAssist3() == player || p.getAssist4() == player)
- + {
- + return true;
- + }
- + }
- + return false;
- + }
- +
- + public Map<Integer, String> getFights()
- + {
- + return fights;
- + }
- +
- + public boolean remove(L2PcInstance player)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player || p.getAssist() == player || p.getAssist2() == player || p.getAssist3() == player || p.getAssist4() == player)
- + {
- + p.removeMessage();
- + registered.remove(p);
- + return true;
- + }
- + }
- + return false;
- + }
- +
- + @Override
- + public synchronized void run()
- + {
- + boolean load = true;
- +
- + // while server is running
- + while (load)
- + {
- + if (!ArenaTask.is_started())
- + load = false;
- +
- + // if no have participants or arenas are busy wait 1 minute
- + if (registered.size() < 2 || free == 0)
- + {
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CALL_INTERVAL * 1000);
- + }
- + catch (InterruptedException e)
- + {
- + }
- + continue;
- + }
- + List<Pair> opponents = selectOpponents();
- + if (opponents != null && opponents.size() == 2)
- + {
- + Thread T = new Thread(new EvtArenaTask(opponents));
- + T.setDaemon(true);
- + T.start();
- + }
- + // wait 1 minute for not stress server
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CALL_INTERVAL * 1000);
- + }
- + catch (InterruptedException e)
- + {
- + }
- + }
- + }
- +
- + @SuppressWarnings("null")
- + private List<Pair> selectOpponents()
- + {
- + List<Pair> opponents = new ArrayList<>();
- + Pair pairOne = null, pairTwo = null;
- + int tries = 3;
- + do
- + {
- + int first = 0, 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;
- + }
- +
- + }
- + }
- + while ((pairOne == null || pairTwo == null) && --tries > 0);
- + return opponents;
- + }
- +
- + public void clear()
- + {
- + registered.clear();
- + }
- +
- + public int getRegisteredCount()
- + {
- + return registered.size();
- + }
- +
- + private class Pair
- + {
- + private L2PcInstance leader, assist, assist2, assist3, assist4;
- +
- + public Pair(L2PcInstance leader, L2PcInstance assist, L2PcInstance assist2, L2PcInstance assist3, L2PcInstance assist4)
- + {
- + this.leader = leader;
- + this.assist = assist;
- + this.assist2 = assist2;
- + this.assist3 = assist3;
- + this.assist4 = assist4;
- + }
- +
- + public L2PcInstance getAssist()
- + {
- + return assist;
- + }
- +
- + public L2PcInstance getAssist2()
- + {
- + return assist2;
- + }
- +
- + public L2PcInstance getAssist3()
- + {
- + return assist3;
- + }
- +
- + public L2PcInstance getAssist4()
- + {
- + return assist4;
- + }
- +
- + public L2PcInstance getLeader()
- + {
- + return leader;
- + }
- +
- + public boolean check()
- + {
- + if ((leader == null || !(leader.isOnline() == 1)))
- + {
- + if (assist != null || assist.isOnline() == 1)
- + assist.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist2 != null || assist2.isOnline() == 1)
- + assist2.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist3 != null || assist3.isOnline() == 1)
- + assist3.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist4 != null || assist4.isOnline() == 1)
- + assist4.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + return false;
- + }
- +
- + else if (((assist == null || !(assist.isOnline() == 1)) || (assist2 == null || !(assist2.isOnline() == 1)) || (assist3 == null || !(assist3.isOnline() == 1)) || (assist4 == null || !(assist4.isOnline() == 1)) && (leader != null || leader.isOnline() == 1)))
- + {
- + leader.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist != null || assist.isOnline() == 1)
- + assist.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist2 != null || assist2.isOnline() == 1)
- + assist2.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist3 != null || assist3.isOnline() == 1)
- + assist3.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist4 != null || assist4.isOnline() == 1)
- + assist4.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + return false;
- + }
- + return true;
- + }
- +
- + public boolean isDead()
- + {
- + if (ArenaConfig.ARENA_PROTECT)
- + {
- + if (leader != null && leader.isOnline() == 1 && leader.isArenaAttack() && !leader.isDead() && !leader.isInsideZone(L2Character.ARENA_EVENT))
- + leader.logout();
- + if (assist != null && assist.isOnline() == 1 && assist.isArenaAttack() && !assist.isDead() && !assist.isInsideZone(L2Character.ARENA_EVENT))
- + assist.logout();
- + if (assist2 != null && assist2.isOnline() == 1 && assist2.isArenaAttack() && !assist2.isDead() && !assist2.isInsideZone(L2Character.ARENA_EVENT))
- + assist2.logout();
- + if (assist3 != null && assist3.isOnline() == 1 && assist3.isArenaAttack() && !assist3.isDead() && !assist3.isInsideZone(L2Character.ARENA_EVENT))
- + assist3.logout();
- + if (assist4 != null && assist4.isOnline() == 1 && assist4.isArenaAttack() && !assist4.isDead() && !assist4.isInsideZone(L2Character.ARENA_EVENT))
- + assist4.logout();
- + }
- +
- + if ((leader == null || leader.isDead() || !(leader.isOnline() == 1) || !leader.isInsideZone(L2Character.ARENA_EVENT) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !(assist.isOnline() == 1) || !assist.isInsideZone(L2Character.ARENA_EVENT) || !assist.isArenaAttack()) && (assist2 == null || assist2.isDead() || !(assist2.isOnline() == 1) || !assist2.isInsideZone(L2Character.ARENA_EVENT) || !assist2.isArenaAttack()) && (assist3 == null || assist3.isDead() || !(assist3.isOnline() == 1) || !assist3.isInsideZone(L2Character.ARENA_EVENT) || !assist3.isArenaAttack()) && (assist4 == null || assist4.isDead() || !(assist4.isOnline() == 1) || !assist4.isInsideZone(L2Character.ARENA_EVENT)))
- + return false;
- +
- + return !(leader.isDead() && assist.isDead() && assist2.isDead() && assist3.isDead() && assist4.isDead());
- + }
- +
- + public boolean isAlive()
- + {
- + if ((leader == null || leader.isDead() || !(leader.isOnline() == 1) || !leader.isInsideZone(L2Character.ARENA_EVENT) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !(assist.isOnline() == 1) || !assist.isInsideZone(L2Character.ARENA_EVENT) || !assist.isArenaAttack()) && (assist2 == null || assist2.isDead() || !(assist2.isOnline() == 1) || !assist2.isInsideZone(L2Character.ARENA_EVENT) || !assist2.isArenaAttack()) && (assist3 == null || assist3.isDead() || !(assist3.isOnline() == 1) || !assist3.isInsideZone(L2Character.ARENA_EVENT) || !assist3.isArenaAttack()) && (assist4 == null || assist4.isDead() || !(assist4.isOnline() == 1) || !assist4.isInsideZone(L2Character.ARENA_EVENT)))
- + return false;
- +
- + return !(leader.isDead() && assist.isDead() && assist2.isDead() && assist3.isDead() && assist4.isDead());
- + }
- +
- + public void teleportTo(int x, int y, int z)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!leader.isInJail())
- + leader.teleToLocation(x, y, z);
- +
- + leader.broadcastUserInfo();
- +
- + }
- + if (assist != null && assist.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist.isInJail())
- + assist.teleToLocation(x, y + 200, z);
- +
- + assist.broadcastUserInfo();
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist2.isInJail())
- + assist2.teleToLocation(x, y + 150, z);
- +
- + assist2.broadcastUserInfo();
- + }
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist3.isInJail())
- + assist3.teleToLocation(x, y + 100, z);
- +
- + assist3.broadcastUserInfo();
- + }
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist4.isInJail())
- + assist4.teleToLocation(x, y + 50, z);
- +
- + assist4.broadcastUserInfo();
- + }
- + }
- +
- + public void EventTitle(String title, String color)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setTitle(title);
- + leader.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setTitle(title);
- + assist.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setTitle(title);
- + assist2.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist2.broadcastUserInfo();
- + assist2.broadcastTitleInfo();
- + }
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.setTitle(title);
- + assist3.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist3.broadcastUserInfo();
- + assist3.broadcastTitleInfo();
- + }
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.setTitle(title);
- + assist4.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist4.broadcastUserInfo();
- + assist4.broadcastTitleInfo();
- + }
- + }
- +
- + public void saveTitle()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader._originalTitleColorTournament = leader.getAppearance().getTitleColor();
- + leader._originalTitleTournament = leader.getTitle();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist._originalTitleColorTournament = assist.getAppearance().getTitleColor();
- + assist._originalTitleTournament = assist.getTitle();
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2._originalTitleColorTournament = assist2.getAppearance().getTitleColor();
- + assist2._originalTitleTournament = assist2.getTitle();
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3._originalTitleColorTournament = assist3.getAppearance().getTitleColor();
- + assist3._originalTitleTournament = assist3.getTitle();
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4._originalTitleColorTournament = assist4.getAppearance().getTitleColor();
- + assist4._originalTitleTournament = assist4.getTitle();
- + }
- + }
- +
- + public void backTitle()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setTitle(leader._originalTitleTournament);
- + leader.getAppearance().setTitleColor(leader._originalTitleColorTournament);
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setTitle(assist._originalTitleTournament);
- + assist.getAppearance().setTitleColor(assist._originalTitleColorTournament);
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setTitle(assist2._originalTitleTournament);
- + assist2.getAppearance().setTitleColor(assist2._originalTitleColorTournament);
- + assist2.broadcastUserInfo();
- + assist2.broadcastTitleInfo();
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.setTitle(assist3._originalTitleTournament);
- + assist3.getAppearance().setTitleColor(assist3._originalTitleColorTournament);
- + assist3.broadcastUserInfo();
- + assist3.broadcastTitleInfo();
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.setTitle(assist4._originalTitleTournament);
- + assist4.getAppearance().setTitleColor(assist4._originalTitleColorTournament);
- + assist4.broadcastUserInfo();
- + assist4.broadcastTitleInfo();
- + }
- + }
- +
- + public void setArenaInstance()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInstanceId(3); //3x3 Tournament Instance
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.setInstanceId(3); //3x3 Tournament Instance
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.setInstanceId(3); //3x3 Tournament Instance
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + assist3.setInstanceId(3); //3x3 Tournament Instance
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + assist4.setInstanceId(3); //3x3 Tournament Instance
- + }
- +
- + public void setRealInstance()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInstanceId(0);
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.setInstanceId(0);
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.setInstanceId(0);
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + assist3.setInstanceId(0);
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + assist4.setInstanceId(0);
- + }
- +
- + public void rewards()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + if (leader.isVip())
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_5X5 * ArenaConfig.ARENA_VIP_DROP_RATE, leader, true);
- + else
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_5X5, leader, true);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + if (assist.isVip())
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_5X5 * ArenaConfig.ARENA_VIP_DROP_RATE, assist, true);
- + else
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_5X5, assist, true);
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + if (assist2.isVip())
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_5X5 * ArenaConfig.ARENA_VIP_DROP_RATE, assist2, true);
- + else
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_5X5, assist2, true);
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + if (assist3.isVip())
- + assist3.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_5X5 * ArenaConfig.ARENA_VIP_DROP_RATE, assist3, true);
- + else
- + assist3.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_5X5, assist3, true);
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + if (assist4.isVip())
- + assist4.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_5X5 * ArenaConfig.ARENA_VIP_DROP_RATE, assist4, true);
- + else
- + assist4.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_5X5, assist4, true);
- + }
- +
- + sendPacket("Congratulations, your team won the event!", 5);
- + }
- +
- + public void rewardsLost()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + if (leader.isVip())
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_5X5 * ArenaConfig.ARENA_VIP_DROP_RATE, leader, true);
- + else
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_5X5, leader, true);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + if (assist.isVip())
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_5X5 * ArenaConfig.ARENA_VIP_DROP_RATE, assist, true);
- + else
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_5X5, assist, true);
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + if (assist2.isVip())
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_5X5 * ArenaConfig.ARENA_VIP_DROP_RATE, assist2, true);
- + else
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_5X5, assist2, true);
- + }
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + if (assist3.isVip())
- + assist3.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_5X5 * ArenaConfig.ARENA_VIP_DROP_RATE, assist3, true);
- + else
- + assist3.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_5X5, assist3, true);
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + if (assist4.isVip())
- + assist4.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_5X5 * ArenaConfig.ARENA_VIP_DROP_RATE, assist4, true);
- + else
- + assist4.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_5X5, assist4, true);
- + }
- +
- + sendPacket("your team lost the event! =(", 5);
- + }
- +
- + public void setInTournamentEvent(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInArenaEvent(val);
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.setInArenaEvent(val);
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.setInArenaEvent(val);
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + assist3.setInArenaEvent(val);
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + assist4.setInArenaEvent(val);
- + }
- +
- + public void removeMessage()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.sendMessage("Tournament: Your participation has been removed.");
- + leader.setArenaProtection(false);
- + leader.setArena5x5(false);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.sendMessage("Tournament: Your participation has been removed.");
- + assist.setArenaProtection(false);
- + assist.setArena5x5(false);
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.sendMessage("Tournament: Your participation has been removed.");
- + assist2.setArenaProtection(false);
- + assist2.setArena5x5(false);
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.sendMessage("Tournament: Your participation has been removed.");
- + assist3.setArenaProtection(false);
- + assist3.setArena5x5(false);
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.sendMessage("Tournament: Your participation has been removed.");
- + assist4.setArenaProtection(false);
- + assist4.setArena5x5(false);
- + }
- + }
- +
- + public void setArenaProtection(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setArenaProtection(val);
- + leader.setArena5x5(val);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setArenaProtection(val);
- + assist.setArena5x5(val);
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setArenaProtection(val);
- + assist2.setArena5x5(val);
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.setArenaProtection(val);
- + assist3.setArena5x5(val);
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.setArenaProtection(val);
- + assist4.setArena5x5(val);
- + }
- + }
- +
- + public void revive()
- + {
- + if (leader != null && leader.isOnline() == 1 && leader.isDead())
- + leader.doRevive();
- +
- + if (assist != null && assist.isOnline() == 1 && assist.isDead())
- + assist.doRevive();
- +
- + if (assist2 != null && assist2.isOnline() == 1 && assist2.isDead())
- + assist2.doRevive();
- +
- + if (assist3 != null && assist3.isOnline() == 1 && assist3.isDead())
- + assist3.doRevive();
- +
- + if (assist4 != null && assist4.isOnline() == 1 && assist4.isDead())
- + assist4.doRevive();
- + }
- +
- + public void setImobilised(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setIsInvul(val);
- + leader.setStopArena(val);
- + }
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setIsInvul(val);
- + assist.setStopArena(val);
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setIsInvul(val);
- + assist2.setStopArena(val);
- + }
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.setIsInvul(val);
- + assist3.setStopArena(val);
- + }
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.setIsInvul(val);
- + assist4.setStopArena(val);
- + }
- + }
- +
- + public void setArenaAttack(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setArenaAttack(val);
- + leader.broadcastUserInfo();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setArenaAttack(val);
- + assist.broadcastUserInfo();
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setArenaAttack(val);
- + assist2.broadcastUserInfo();
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.setArenaAttack(val);
- + assist3.broadcastUserInfo();
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.setArenaAttack(val);
- + assist4.broadcastUserInfo();
- + }
- + }
- +
- + public void removePet()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (leader.getPet() != null)
- + {
- + L2Summon summon = leader.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(leader);
- + }
- +
- + if (leader.getMountType() == 1 || leader.getMountType() == 2)
- + leader.dismount();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist.getPet() != null)
- + {
- + L2Summon summon = assist.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist);
- + }
- +
- + if (assist.getMountType() == 1 || assist.getMountType() == 2)
- + assist.dismount();
- +
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist2.getPet() != null)
- + {
- + L2Summon summon = assist2.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist2);
- +
- + }
- +
- + if (assist2.getMountType() == 1 || assist2.getMountType() == 2)
- + assist2.dismount();
- +
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist3.getPet() != null)
- + {
- + L2Summon summon = assist3.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist3);
- + }
- +
- + if (assist3.getMountType() == 1 || assist3.getMountType() == 2)
- + assist3.dismount();
- +
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist4.getPet() != null)
- + {
- + L2Summon summon = assist4.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist4);
- +
- + }
- +
- + if (assist4.getMountType() == 1 || assist4.getMountType() == 2)
- + assist4.dismount();
- +
- + }
- + }
- +
- + public void removeSkills()
- + {
- + if (!(leader.getClassId() == ClassId.shillenElder || leader.getClassId() == ClassId.shillienSaint || leader.getClassId() == ClassId.bishop || leader.getClassId() == ClassId.cardinal || leader.getClassId() == ClassId.elder || leader.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : leader.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + leader.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist.getClassId() == ClassId.shillenElder || assist.getClassId() == ClassId.shillienSaint || assist.getClassId() == ClassId.bishop || assist.getClassId() == ClassId.cardinal || assist.getClassId() == ClassId.elder || assist.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist2.getClassId() == ClassId.shillenElder || assist2.getClassId() == ClassId.shillienSaint || assist2.getClassId() == ClassId.bishop || assist2.getClassId() == ClassId.cardinal || assist2.getClassId() == ClassId.elder || assist2.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist2.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist2.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist3.getClassId() == ClassId.shillenElder || assist3.getClassId() == ClassId.shillienSaint || assist3.getClassId() == ClassId.bishop || assist3.getClassId() == ClassId.cardinal || assist3.getClassId() == ClassId.elder || assist3.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist3.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist3.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist4.getClassId() == ClassId.shillenElder || assist4.getClassId() == ClassId.shillienSaint || assist4.getClassId() == ClassId.bishop || assist4.getClassId() == ClassId.cardinal || assist4.getClassId() == ClassId.elder || assist4.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist4.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist4.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- + }
- +
- + public void sendPacket(String message, int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + assist3.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + assist4.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + }
- +
- + public void inicarContagem(int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(leader, duration), 0);
- +
- + if (assist != null && assist.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist, duration), 0);
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist2, duration), 0);
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist3, duration), 0);
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist4, duration), 0);
- + }
- +
- + public void sendPacketinit(String message, int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + assist3.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + assist4.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + }
- + }
- +
- + private class EvtArenaTask implements Runnable
- + {
- + private final Pair pairOne;
- + private final Pair pairTwo;
- + private final int pOneX, pOneY, pOneZ, pTwoX, pTwoY, pTwoZ;
- + private Arena arena;
- +
- + public EvtArenaTask(List<Pair> opponents)
- + {
- + pairOne = opponents.get(0);
- + pairTwo = opponents.get(1);
- + L2PcInstance 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--;
- + pairOne.saveTitle();
- + pairTwo.saveTitle();
- + portPairsToArena();
- + pairOne.inicarContagem(ArenaConfig.ARENA_WAIT_INTERVAL_5X5);
- + pairTwo.inicarContagem(ArenaConfig.ARENA_WAIT_INTERVAL_5X5);
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_WAIT_INTERVAL_5X5 * 1000);
- + }
- + catch (InterruptedException e1)
- + {
- + }
- + pairOne.sendPacketinit("Started. Good Fight!", 3);
- + pairTwo.sendPacketinit("Started. Good Fight!", 3);
- + pairOne.EventTitle(ArenaConfig.MSG_TEAM1, ArenaConfig.TITLE_COLOR_TEAM1);
- + pairTwo.EventTitle(ArenaConfig.MSG_TEAM2, ArenaConfig.TITLE_COLOR_TEAM2);
- + pairOne.setImobilised(false);
- + pairTwo.setImobilised(false);
- + pairOne.setArenaAttack(true);
- + pairTwo.setArenaAttack(true);
- +
- + while (check())
- + {
- + // check players status each seconds
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CHECK_INTERVAL);
- + }
- + catch (InterruptedException e)
- + {
- + break;
- + }
- + }
- + finishDuel();
- + free++;
- + }
- +
- + private void finishDuel()
- + {
- + fights.remove(arena.id);
- + rewardWinner();
- + pairOne.revive();
- + pairTwo.revive();
- + pairOne.teleportTo(pOneX, pOneY, pOneZ);
- + pairTwo.teleportTo(pTwoX, pTwoY, pTwoZ);
- + pairOne.backTitle();
- + pairTwo.backTitle();
- + pairOne.setRealInstance();
- + pairTwo.setRealInstance();
- + 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())
- + {
- + L2PcInstance leader1 = pairOne.getLeader();
- + L2PcInstance leader2 = pairTwo.getLeader();
- +
- + if (leader1.getClan() != null && leader2.getClan() != null && ArenaConfig.TOURNAMENT_EVENT_ANNOUNCE)
- + Broadcast.gameAnnounceToOnlinePlayers("(5X5):(" + leader1.getClan().getName() + " VS " + leader2.getClan().getName() + ") ~> " + leader1.getClan().getName() + " win!");
- +
- + pairOne.rewards();
- + pairTwo.rewardsLost();
- + }
- + else if (pairTwo.isAlive() && !pairOne.isAlive())
- + {
- + L2PcInstance leader1 = pairTwo.getLeader();
- + L2PcInstance leader2 = pairOne.getLeader();
- +
- + if (leader1.getClan() != null && leader2.getClan() != null && ArenaConfig.TOURNAMENT_EVENT_ANNOUNCE)
- + Broadcast.gameAnnounceToOnlinePlayers("(5X5):(" + 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 (Arena arena : arenas)
- + {
- + if (arena.isFree)
- + {
- + this.arena = arena;
- + arena.setFree(false);
- + pairOne.removePet();
- + pairTwo.removePet();
- + pairOne.setArenaInstance();
- + pairTwo.setArenaInstance();
- + 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(this.arena.id, pairOne.getLeader().getName() + " vs " + pairTwo.getLeader().getName());
- + break;
- + }
- + }
- + }
- + }
- +
- + private class Arena
- + {
- + protected int x, y, 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 L2PcInstance _player;
- + private int _time;
- +
- + public countdown(L2PcInstance player, int time)
- + {
- + _time = time;
- + _player = player;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_player.isOnline() == 1)
- + {
- +
- + switch (_time)
- + {
- + case 300:
- + case 240:
- + case 180:
- + case 120:
- + case 57:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in 60 second(s)..", 4000));
- + _player.sendMessage("60 second(s) to start the battle.");
- + }
- + break;
- + case 45:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 27:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in 30 second(s)..", 4000));
- + _player.sendMessage("30 second(s) to start the battle.");
- + }
- + break;
- + case 20:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 15:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 10:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 5:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 4:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 3:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 2:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 1:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + }
- + if (_time > 1)
- + {
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(_player, _time - 1), 1000);
- + }
- + }
- + }
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final Arena5x5 INSTANCE = new Arena5x5();
- + }
- +}
- \ No newline at end of file
- diff --git a/head-src/Dev/Tournament/Arena9x9.java b/head-src/Dev/Tournament/Arena9x9.java
- new file mode 100644
- index 0000000..ac82b10
- --- /dev/null
- +++ b/head-src/Dev/Tournament/Arena9x9.java
- @@ -0,0 +1,1879 @@
- +package Dev.Tournament;
- +
- +import com.l2jfrozen.gameserver.model.L2Character;
- +import com.l2jfrozen.gameserver.model.L2Effect;
- +import com.l2jfrozen.gameserver.model.L2Summon;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PetInstance;
- +import com.l2jfrozen.gameserver.model.base.ClassId;
- +import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +import com.l2jfrozen.gameserver.util.Broadcast;
- +import com.l2jfrozen.util.random.Rnd;
- +
- +import java.util.ArrayList;
- +import java.util.HashMap;
- +import java.util.List;
- +import java.util.Map;
- +
- +import Dev.Tournament.properties.ArenaConfig;
- +import Dev.Tournament.properties.ArenaTask;
- +
- +public class Arena9x9 implements Runnable
- +{
- + // list of participants
- + public static List<Pair> registered;
- + // number of Arenas
- + int free = ArenaConfig.ARENA_EVENT_COUNT_9X9;
- + // Arenas
- + Arena[] arenas = new Arena[ArenaConfig.ARENA_EVENT_COUNT_9X9];
- + // list of fights going on
- + Map<Integer, String> fights = new HashMap<>(ArenaConfig.ARENA_EVENT_COUNT_9X9);
- +
- + public Arena9x9()
- + {
- + registered = new ArrayList<>();
- + int[] coord;
- + for (int i = 0; i < ArenaConfig.ARENA_EVENT_COUNT_9X9; i++)
- + {
- + coord = ArenaConfig.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(L2PcInstance player, L2PcInstance assist, L2PcInstance assist2, L2PcInstance assist3, L2PcInstance assist4, L2PcInstance assist5, L2PcInstance assist6, L2PcInstance assist7, L2PcInstance assist8)
- + {
- + for (Pair p : registered)
- + {
- + if (p.getLeader() == player || p.getAssist() == player)
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist || p.getAssist() == assist)
- + {
- + player.sendMessage("Tournament: " + assist.getName() + " already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist2 || p.getAssist2() == assist2)
- + {
- + player.sendMessage("Tournament: " + assist2.getName() + " already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist3 || p.getAssist3() == assist3)
- + {
- + player.sendMessage("Tournament: " + assist3.getName() + " already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist4 || p.getAssist4() == assist4)
- + {
- + player.sendMessage("Tournament: " + assist4.getName() + " already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist5 || p.getAssist5() == assist5)
- + {
- + player.sendMessage("Tournament: " + assist5.getName() + " already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist6 || p.getAssist6() == assist6)
- + {
- + player.sendMessage("Tournament: " + assist6.getName() + " already registered!");
- + return false;
- + }
- + else if (p.getLeader() == assist7 || p.getAssist7() == assist7)
- + {
- + player.sendMessage("Tournament: " + assist7.getName() + " already registered!");
- + return false;
- + }
- + else 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(L2PcInstance 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(L2PcInstance 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()
- + {
- + boolean load = true;
- +
- + // while server is running
- + while (load)
- + {
- + if (!ArenaTask.is_started())
- + load = false;
- +
- + // if no have participants or arenas are busy wait 1 minute
- + if (registered.size() < 2 || free == 0)
- + {
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CALL_INTERVAL * 1000);
- + }
- + catch (InterruptedException e)
- + {
- + }
- + continue;
- + }
- + List<Pair> opponents = selectOpponents();
- + if (opponents != null && opponents.size() == 2)
- + {
- + Thread T = new Thread(new EvtArenaTask(opponents));
- + T.setDaemon(true);
- + T.start();
- + }
- + // wait 1 minute for not stress server
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CALL_INTERVAL * 1000);
- + }
- + catch (InterruptedException e)
- + {
- + }
- + }
- + }
- +
- + @SuppressWarnings("null")
- + private List<Pair> selectOpponents()
- + {
- + List<Pair> opponents = new ArrayList<>();
- + Pair pairOne = null, pairTwo = null;
- + int tries = 3;
- + do
- + {
- + int first = 0, 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;
- + }
- +
- + }
- + }
- + while ((pairOne == null || pairTwo == null) && --tries > 0);
- + return opponents;
- + }
- +
- + public void clear()
- + {
- + registered.clear();
- + }
- +
- + public int getRegisteredCount()
- + {
- + return registered.size();
- + }
- +
- + private class Pair
- + {
- + private L2PcInstance leader, assist, assist2, assist3, assist4, assist5, assist6, assist7, assist8;
- +
- + public Pair(L2PcInstance leader, L2PcInstance assist, L2PcInstance assist2, L2PcInstance assist3, L2PcInstance assist4, L2PcInstance assist5, L2PcInstance assist6, L2PcInstance assist7, L2PcInstance 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 L2PcInstance getAssist()
- + {
- + return assist;
- + }
- +
- + public L2PcInstance getAssist2()
- + {
- + return assist2;
- + }
- +
- + public L2PcInstance getAssist3()
- + {
- + return assist3;
- + }
- +
- + public L2PcInstance getAssist4()
- + {
- + return assist4;
- + }
- +
- + public L2PcInstance getAssist5()
- + {
- + return assist5;
- + }
- +
- + public L2PcInstance getAssist6()
- + {
- + return assist6;
- + }
- +
- + public L2PcInstance getAssist7()
- + {
- + return assist7;
- + }
- +
- + public L2PcInstance getAssist8()
- + {
- + return assist8;
- + }
- +
- + public L2PcInstance getLeader()
- + {
- + return leader;
- + }
- +
- + public boolean check()
- + {
- + if ((leader == null || !(leader.isOnline() == 1)))
- + {
- + if (assist != null || assist.isOnline() == 1)
- + assist.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist2 != null || assist2.isOnline() == 1)
- + assist2.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist3 != null || assist3.isOnline() == 1)
- + assist3.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist4 != null || assist4.isOnline() == 1)
- + assist4.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist5 != null || assist5.isOnline() == 1)
- + assist5.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist6 != null || assist6.isOnline() == 1)
- + assist6.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist7 != null || assist7.isOnline() == 1)
- + assist7.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist8 != null || assist8.isOnline() == 1)
- + assist8.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + return false;
- + }
- + else if (((assist == null || !(assist.isOnline() == 1)) || (assist2 == null || !(assist2.isOnline() == 1)) || (assist3 == null || !(assist3.isOnline() == 1)) || (assist4 == null || !(assist4.isOnline() == 1)) || (assist5 == null || !(assist5.isOnline() == 1)) || (assist6 == null || !(assist6.isOnline() == 1)) || (assist7 == null || !(assist7.isOnline() == 1)) || (assist8 == null || !(assist8.isOnline() == 1))) && (leader != null || leader.isOnline() == 1))
- + {
- + leader.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist != null || assist.isOnline() == 1)
- + assist.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist2 != null || assist2.isOnline() == 1)
- + assist2.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist3 != null || assist3.isOnline() == 1)
- + assist3.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist4 != null || assist4.isOnline() == 1)
- + assist4.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist5 != null || assist5.isOnline() == 1)
- + assist5.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist6 != null || assist6.isOnline() == 1)
- + assist6.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist7 != null || assist7.isOnline() == 1)
- + assist7.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + if (assist8 != null || assist8.isOnline() == 1)
- + assist8.sendMessage("Tournament: You participation in Event was Canceled.");
- +
- + return false;
- + }
- + return true;
- + }
- +
- + public boolean isDead()
- + {
- + if (ArenaConfig.ARENA_PROTECT)
- + {
- + if (leader != null && leader.isOnline() == 1 && leader.isArenaAttack() && !leader.isDead() && !leader.isInsideZone(L2Character.ARENA_EVENT))
- + leader.logout();
- + if (assist != null && assist.isOnline() == 1 && assist.isArenaAttack() && !assist.isDead() && !assist.isInsideZone(L2Character.ARENA_EVENT))
- + assist.logout();
- + if (assist2 != null && assist2.isOnline() == 1 && assist2.isArenaAttack() && !assist2.isDead() && !assist2.isInsideZone(L2Character.ARENA_EVENT))
- + assist2.logout();
- + if (assist3 != null && assist3.isOnline() == 1 && assist3.isArenaAttack() && !assist3.isDead() && !assist3.isInsideZone(L2Character.ARENA_EVENT))
- + assist3.logout();
- + if (assist4 != null && assist4.isOnline() == 1 && assist4.isArenaAttack() && !assist4.isDead() && !assist4.isInsideZone(L2Character.ARENA_EVENT))
- + assist4.logout();
- + if (assist5 != null && assist5.isOnline() == 1 && assist5.isArenaAttack() && !assist5.isDead() && !assist5.isInsideZone(L2Character.ARENA_EVENT))
- + assist5.logout();
- + if (assist6 != null && assist6.isOnline() == 1 && assist6.isArenaAttack() && !assist6.isDead() && !assist6.isInsideZone(L2Character.ARENA_EVENT))
- + assist6.logout();
- + if (assist7 != null && assist7.isOnline() == 1 && assist7.isArenaAttack() && !assist7.isDead() && !assist7.isInsideZone(L2Character.ARENA_EVENT))
- + assist7.logout();
- + if (assist8 != null && assist8.isOnline() == 1 && assist8.isArenaAttack() && !assist8.isDead() && !assist8.isInsideZone(L2Character.ARENA_EVENT))
- + assist8.logout();
- + }
- +
- + if ((leader == null || leader.isDead() || !(leader.isOnline() == 1) || !leader.isInsideZone(L2Character.ARENA_EVENT) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !(assist.isOnline() == 1) || !assist.isInsideZone(L2Character.ARENA_EVENT) || !assist.isArenaAttack()) && (assist2 == null || assist2.isDead() || !(assist2.isOnline() == 1) || !assist2.isInsideZone(L2Character.ARENA_EVENT) || !assist2.isArenaAttack()) && (assist3 == null || assist3.isDead() || !(assist3.isOnline() == 1) || !assist3.isInsideZone(L2Character.ARENA_EVENT) || !assist3.isArenaAttack()) && (assist4 == null || assist4.isDead() || !(assist4.isOnline() == 1) || !assist4.isInsideZone(L2Character.ARENA_EVENT) || !assist4.isArenaAttack()) && (assist5 == null || assist5.isDead() || !(assist5.isOnline() == 1) || !assist5.isInsideZone(L2Character.ARENA_EVENT) || !assist5.isArenaAttack()) && (assist6 == null || assist6.isDead() || !(assist6.isOnline() == 1) || !assist6.isInsideZone(L2Character.ARENA_EVENT) || !assist6.isArenaAttack()) && (assist7 == null || assist7.isDead() || !(assist7.isOnline() == 1) || !assist7.isInsideZone(L2Character.ARENA_EVENT) || !assist7.isArenaAttack()) && (assist8 == null || assist8.isDead() || !(assist8.isOnline() == 1) || !assist8.isInsideZone(L2Character.ARENA_EVENT) || !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() == 1) || !leader.isInsideZone(L2Character.ARENA_EVENT) || !leader.isArenaAttack()) && (assist == null || assist.isDead() || !(assist.isOnline() == 1) || !assist.isInsideZone(L2Character.ARENA_EVENT) || !assist.isArenaAttack()) && (assist2 == null || assist2.isDead() || !(assist2.isOnline() == 1) || !assist2.isInsideZone(L2Character.ARENA_EVENT) || !assist2.isArenaAttack()) && (assist3 == null || assist3.isDead() || !(assist3.isOnline() == 1) || !assist3.isInsideZone(L2Character.ARENA_EVENT) || !assist3.isArenaAttack()) && (assist4 == null || assist4.isDead() || !(assist4.isOnline() == 1) || !assist4.isInsideZone(L2Character.ARENA_EVENT) || !assist4.isArenaAttack()) && (assist5 == null || assist5.isDead() || !(assist5.isOnline() == 1) || !assist5.isInsideZone(L2Character.ARENA_EVENT) || !assist5.isArenaAttack()) && (assist6 == null || assist6.isDead() || !(assist6.isOnline() == 1) || !assist6.isInsideZone(L2Character.ARENA_EVENT) || !assist6.isArenaAttack()) && (assist7 == null || assist7.isDead() || !(assist7.isOnline() == 1) || !assist7.isInsideZone(L2Character.ARENA_EVENT) || !assist7.isArenaAttack()) && (assist8 == null || assist8.isDead() || !(assist8.isOnline() == 1) || !assist8.isInsideZone(L2Character.ARENA_EVENT) || !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() == 1)
- + {
- + //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();
- + }
- + */
- + if (!leader.isInJail())
- + leader.teleToLocation(x, y, z);
- +
- + leader.broadcastUserInfo();
- +
- + }
- + if (assist != null && assist.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist.isInJail())
- + assist.teleToLocation(x, y + 200, z);
- +
- + assist.broadcastUserInfo();
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist2.isInJail())
- + assist2.teleToLocation(x, y + 150, z);
- +
- + assist2.broadcastUserInfo();
- + }
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist3.isInJail())
- + assist3.teleToLocation(x, y + 100, z);
- +
- + assist3.broadcastUserInfo();
- + }
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist4.isInJail())
- + assist4.teleToLocation(x, y + 50, z);
- +
- + assist4.broadcastUserInfo();
- + }
- + if (assist5 != null && assist5.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist5.isInJail())
- + assist5.teleToLocation(x, y - 200, z);
- +
- +
- + assist5.broadcastUserInfo();
- + }
- + if (assist6 != null && assist6.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist6.isInJail())
- + assist6.teleToLocation(x, y - 150, z);
- +
- + assist6.broadcastUserInfo();
- + }
- + if (assist7 != null && assist7.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist7.isInJail())
- + assist7.teleToLocation(x, y - 100, z);
- +
- + assist7.broadcastUserInfo();
- + }
- + if (assist8 != null && assist8.isOnline() == 1)
- + {
- + //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();
- + }
- + */
- + if (!assist8.isInJail())
- + assist8.teleToLocation(x, y - 50, z);
- +
- + assist8.broadcastUserInfo();
- + }
- + }
- +
- + public void EventTitle(String title, String color)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setTitle(title);
- + leader.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setTitle(title);
- + assist.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setTitle(title);
- + assist2.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist2.broadcastUserInfo();
- + assist2.broadcastTitleInfo();
- + }
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.setTitle(title);
- + assist3.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist3.broadcastUserInfo();
- + assist3.broadcastTitleInfo();
- + }
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.setTitle(title);
- + assist4.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist4.broadcastUserInfo();
- + assist4.broadcastTitleInfo();
- + }
- + if (assist5 != null && assist5.isOnline() == 1)
- + {
- + assist5.setTitle(title);
- + assist5.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist5.broadcastUserInfo();
- + assist5.broadcastTitleInfo();
- + }
- + if (assist6 != null && assist6.isOnline() == 1)
- + {
- + assist6.setTitle(title);
- + assist6.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist6.broadcastUserInfo();
- + assist6.broadcastTitleInfo();
- + }
- + if (assist7 != null && assist7.isOnline() == 1)
- + {
- + assist7.setTitle(title);
- + assist7.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist7.broadcastUserInfo();
- + assist7.broadcastTitleInfo();
- + }
- + if (assist8 != null && assist8.isOnline() == 1)
- + {
- + assist8.setTitle(title);
- + assist8.getAppearance().setTitleColor(Integer.decode("0x" + color));
- + assist8.broadcastUserInfo();
- + assist8.broadcastTitleInfo();
- + }
- + }
- +
- + public void saveTitle()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader._originalTitleColorTournament = leader.getAppearance().getTitleColor();
- + leader._originalTitleTournament = leader.getTitle();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist._originalTitleColorTournament = assist.getAppearance().getTitleColor();
- + assist._originalTitleTournament = assist.getTitle();
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2._originalTitleColorTournament = assist2.getAppearance().getTitleColor();
- + assist2._originalTitleTournament = assist2.getTitle();
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3._originalTitleColorTournament = assist3.getAppearance().getTitleColor();
- + assist3._originalTitleTournament = assist3.getTitle();
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4._originalTitleColorTournament = assist4.getAppearance().getTitleColor();
- + assist4._originalTitleTournament = assist4.getTitle();
- + }
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + {
- + assist5._originalTitleColorTournament = assist5.getAppearance().getTitleColor();
- + assist5._originalTitleTournament = assist5.getTitle();
- + }
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + {
- + assist6._originalTitleColorTournament = assist6.getAppearance().getTitleColor();
- + assist6._originalTitleTournament = assist6.getTitle();
- + assist6._originalTitleTournament = assist6.getTitle();
- + }
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + {
- + assist7._originalTitleColorTournament = assist7.getAppearance().getTitleColor();
- + assist7._originalTitleTournament = assist7.getTitle();
- + }
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + {
- + assist8._originalTitleColorTournament = assist8.getAppearance().getTitleColor();
- + assist8._originalTitleTournament = assist8.getTitle();
- + }
- + }
- +
- + public void backTitle()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setTitle(leader._originalTitleTournament);
- + leader.getAppearance().setTitleColor(leader._originalTitleColorTournament);
- + leader.broadcastUserInfo();
- + leader.broadcastTitleInfo();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setTitle(assist._originalTitleTournament);
- + assist.getAppearance().setTitleColor(assist._originalTitleColorTournament);
- + assist.broadcastUserInfo();
- + assist.broadcastTitleInfo();
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setTitle(assist2._originalTitleTournament);
- + assist2.getAppearance().setTitleColor(assist2._originalTitleColorTournament);
- + assist2.broadcastUserInfo();
- + assist2.broadcastTitleInfo();
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.setTitle(assist3._originalTitleTournament);
- + assist3.getAppearance().setTitleColor(assist3._originalTitleColorTournament);
- + assist3.broadcastUserInfo();
- + assist3.broadcastTitleInfo();
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.setTitle(assist4._originalTitleTournament);
- + assist4.getAppearance().setTitleColor(assist4._originalTitleColorTournament);
- + assist4.broadcastUserInfo();
- + assist4.broadcastTitleInfo();
- + }
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + {
- + assist5.setTitle(assist5._originalTitleTournament);
- + assist5.getAppearance().setTitleColor(assist5._originalTitleColorTournament);
- + assist5.broadcastUserInfo();
- + assist5.broadcastTitleInfo();
- + }
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + {
- + assist6.setTitle(assist6._originalTitleTournament);
- + assist6.getAppearance().setTitleColor(assist6._originalTitleColorTournament);
- + assist6.broadcastUserInfo();
- + assist6.broadcastTitleInfo();
- + }
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + {
- + assist7.setTitle(assist7._originalTitleTournament);
- + assist7.getAppearance().setTitleColor(assist7._originalTitleColorTournament);
- + assist7.broadcastUserInfo();
- + assist7.broadcastTitleInfo();
- + }
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + {
- + assist8.setTitle(assist8._originalTitleTournament);
- + assist8.getAppearance().setTitleColor(assist8._originalTitleColorTournament);
- + assist8.broadcastUserInfo();
- + assist8.broadcastTitleInfo();
- + }
- + }
- +
- + public void setArenaInstance()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInstanceId(4); //9x9 Tournament Instance
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.setInstanceId(4); //9x9 Tournament Instance
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.setInstanceId(4); //9x9 Tournament Instance
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + assist3.setInstanceId(4); //9x9 Tournament Instance
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + assist4.setInstanceId(4); //9x9 Tournament Instance
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + assist5.setInstanceId(4); //9x9 Tournament Instance
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + assist6.setInstanceId(4); //9x9 Tournament Instance
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + assist7.setInstanceId(4); //9x9 Tournament Instance
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + assist8.setInstanceId(4); //9x9 Tournament Instance
- + }
- +
- + public void setRealInstance()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInstanceId(0);
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.setInstanceId(0);
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.setInstanceId(0);
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + assist3.setInstanceId(0);
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + assist4.setInstanceId(0);
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + assist5.setInstanceId(0);
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + assist6.setInstanceId(0);
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + assist7.setInstanceId(0);
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + assist8.setInstanceId(0);
- + }
- +
- + public void rewards()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + if (leader.isVip())
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, leader, true);
- + else
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9, leader, true);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + if (assist.isVip())
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist, true);
- + else
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9, assist, true);
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + if (assist2.isVip())
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist2, true);
- + else
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9, assist2, true);
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + if (assist3.isVip())
- + assist3.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist3, true);
- + else
- + assist3.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9, assist3, true);
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + if (assist4.isVip())
- + assist4.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist4, true);
- + else
- + assist4.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9, assist4, true);
- + }
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + {
- + if (assist5.isVip())
- + assist5.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist5, true);
- + else
- + assist5.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9, assist5, true);
- + }
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + {
- + if (assist6.isVip())
- + assist6.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist6, true);
- + else
- + assist6.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9, assist6, true);
- + }
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + {
- + if (assist7.isVip())
- + assist7.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist7, true);
- + else
- + assist7.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9, assist7, true);
- + }
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + {
- + if (assist8.isVip())
- + assist8.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist8, true);
- + else
- + assist8.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_WIN_REWARD_COUNT_9X9, assist8, true);
- + }
- +
- + sendPacket("Congratulations, your team won the event!", 5);
- + }
- +
- + public void rewardsLost()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + if (leader.isVip())
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, leader, true);
- + else
- + leader.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9, leader, true);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + if (assist.isVip())
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist, true);
- + else
- + assist.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9, assist, true);
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + if (assist2.isVip())
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist2, true);
- + else
- + assist2.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9, assist2, true);
- + }
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + if (assist3.isVip())
- + assist3.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist3, true);
- + else
- + assist3.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9, assist3, true);
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + if (assist4.isVip())
- + assist4.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist4, true);
- + else
- + assist4.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9, assist4, true);
- + }
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + {
- + if (assist5.isVip())
- + assist5.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist5, true);
- + else
- + assist5.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9, assist5, true);
- + }
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + {
- + if (assist6.isVip())
- + assist6.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist6, true);
- + else
- + assist6.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9, assist6, true);
- + }
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + {
- + if (assist7.isVip())
- + assist7.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist7, true);
- + else
- + assist7.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9, assist7, true);
- + }
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + {
- + if (assist8.isVip())
- + assist8.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9 * ArenaConfig.ARENA_VIP_DROP_RATE, assist8, true);
- + else
- + assist8.addItem("Arena_Event", ArenaConfig.ARENA_REWARD_ID, ArenaConfig.ARENA_LOST_REWARD_COUNT_9X9, assist8, true);
- + }
- +
- + sendPacket("your team lost the event! =(", 5);
- + }
- +
- + public void setInTournamentEvent(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.setInArenaEvent(val);
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.setInArenaEvent(val);
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.setInArenaEvent(val);
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + assist3.setInArenaEvent(val);
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + assist4.setInArenaEvent(val);
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + assist5.setInArenaEvent(val);
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + assist6.setInArenaEvent(val);
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + assist7.setInArenaEvent(val);
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + assist8.setInArenaEvent(val);
- + }
- +
- + public void removeMessage()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.sendMessage("Tournament: Your participation has been removed.");
- + leader.setArenaProtection(false);
- + leader.setArena9x9(false);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.sendMessage("Tournament: Your participation has been removed.");
- + assist.setArenaProtection(false);
- + assist.setArena9x9(false);
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.sendMessage("Tournament: Your participation has been removed.");
- + assist2.setArenaProtection(false);
- + assist2.setArena9x9(false);
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.sendMessage("Tournament: Your participation has been removed.");
- + assist3.setArenaProtection(false);
- + assist3.setArena9x9(false);
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.sendMessage("Tournament: Your participation has been removed.");
- + assist4.setArenaProtection(false);
- + assist4.setArena9x9(false);
- + }
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + {
- + assist5.sendMessage("Tournament: Your participation has been removed.");
- + assist5.setArenaProtection(false);
- + assist5.setArena9x9(false);
- + }
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + {
- + assist6.sendMessage("Tournament: Your participation has been removed.");
- + assist6.setArenaProtection(false);
- + assist6.setArena9x9(false);
- + }
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + {
- + assist7.sendMessage("Tournament: Your participation has been removed.");
- + assist7.setArenaProtection(false);
- + assist7.setArena9x9(false);
- + }
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + {
- + assist8.sendMessage("Tournament: Your participation has been removed.");
- + assist8.setArenaProtection(false);
- + assist8.setArena9x9(false);
- + }
- + }
- +
- + public void setArenaProtection(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setArenaProtection(val);
- + leader.setArena9x9(val);
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setArenaProtection(val);
- + assist.setArena9x9(val);
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setArenaProtection(val);
- + assist2.setArena9x9(val);
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.setArenaProtection(val);
- + assist3.setArena9x9(val);
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.setArenaProtection(val);
- + assist4.setArena9x9(val);
- + }
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + {
- + assist5.setArenaProtection(val);
- + assist5.setArena9x9(val);
- + }
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + {
- + assist6.setArenaProtection(val);
- + assist6.setArena9x9(val);
- + }
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + {
- + assist7.setArenaProtection(val);
- + assist7.setArena9x9(val);
- + }
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + {
- + assist8.setArenaProtection(val);
- + assist8.setArena9x9(val);
- + }
- + }
- +
- + public void revive()
- + {
- + if (leader != null && leader.isOnline() == 1 && leader.isDead())
- + leader.doRevive();
- +
- + if (assist != null && assist.isOnline() == 1 && assist.isDead())
- + assist.doRevive();
- +
- + if (assist2 != null && assist2.isOnline() == 1 && assist2.isDead())
- + assist2.doRevive();
- +
- + if (assist3 != null && assist3.isOnline() == 1 && assist3.isDead())
- + assist3.doRevive();
- +
- + if (assist4 != null && assist4.isOnline() == 1 && assist4.isDead())
- + assist4.doRevive();
- +
- + if (assist5 != null && assist5.isOnline() == 1 && assist5.isDead())
- + assist5.doRevive();
- +
- + if (assist6 != null && assist6.isOnline() == 1 && assist6.isDead())
- + assist6.doRevive();
- +
- + if (assist7 != null && assist7.isOnline() == 1 && assist7.isDead())
- + assist7.doRevive();
- +
- + if (assist8 != null && assist8.isOnline() == 1 && assist8.isDead())
- + assist8.doRevive();
- + }
- +
- + public void setImobilised(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setIsInvul(val);
- + leader.setStopArena(val);
- + }
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setIsInvul(val);
- + assist.setStopArena(val);
- + }
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setIsInvul(val);
- + assist2.setStopArena(val);
- + }
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.setIsInvul(val);
- + assist3.setStopArena(val);
- + }
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.setIsInvul(val);
- + assist4.setStopArena(val);
- + }
- + if (assist5 != null && assist5.isOnline() == 1)
- + {
- + assist5.setIsInvul(val);
- + assist5.setStopArena(val);
- + }
- + if (assist6 != null && assist6.isOnline() == 1)
- + {
- + assist6.setIsInvul(val);
- + assist6.setStopArena(val);
- + }
- + if (assist7 != null && assist7.isOnline() == 1)
- + {
- + assist7.setIsInvul(val);
- + assist7.setStopArena(val);
- + }
- + if (assist8 != null && assist8.isOnline() == 1)
- + {
- + assist8.setIsInvul(val);
- + assist8.setStopArena(val);
- + }
- + }
- +
- + public void setArenaAttack(boolean val)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + leader.setArenaAttack(val);
- + leader.broadcastUserInfo();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + assist.setArenaAttack(val);
- + assist.broadcastUserInfo();
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + assist2.setArenaAttack(val);
- + assist2.broadcastUserInfo();
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + assist3.setArenaAttack(val);
- + assist3.broadcastUserInfo();
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + assist4.setArenaAttack(val);
- + assist4.broadcastUserInfo();
- + }
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + {
- + assist5.setArenaAttack(val);
- + assist5.broadcastUserInfo();
- + }
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + {
- + assist6.setArenaAttack(val);
- + assist6.broadcastUserInfo();
- + }
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + {
- + assist7.setArenaAttack(val);
- + assist7.broadcastUserInfo();
- + }
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + {
- + assist8.setArenaAttack(val);
- + assist8.broadcastUserInfo();
- + }
- + }
- +
- + public void removePet()
- + {
- + if (leader != null && leader.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (leader.getPet() != null)
- + {
- + L2Summon summon = leader.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(leader);
- + }
- +
- + if (leader.getMountType() == 1 || leader.getMountType() == 2)
- + leader.dismount();
- + }
- +
- + if (assist != null && assist.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist.getPet() != null)
- + {
- + L2Summon summon = assist.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist);
- + }
- +
- + if (assist.getMountType() == 1 || assist.getMountType() == 2)
- + assist.dismount();
- +
- + }
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist2.getPet() != null)
- + {
- + L2Summon summon = assist2.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist2);
- +
- + }
- +
- + if (assist2.getMountType() == 1 || assist2.getMountType() == 2)
- + assist2.dismount();
- +
- + }
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist3.getPet() != null)
- + {
- + L2Summon summon = assist3.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist3);
- + }
- +
- + if (assist3.getMountType() == 1 || assist3.getMountType() == 2)
- + assist3.dismount();
- +
- + }
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist4.getPet() != null)
- + {
- + L2Summon summon = assist4.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist4);
- +
- + }
- +
- + if (assist4.getMountType() == 1 || assist4.getMountType() == 2)
- + assist4.dismount();
- +
- + }
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist5.getPet() != null)
- + {
- + L2Summon summon = assist5.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist5);
- +
- + }
- +
- + if (assist5.getMountType() == 1 || assist5.getMountType() == 2)
- + assist5.dismount();
- +
- + }
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist6.getPet() != null)
- + {
- + L2Summon summon = assist6.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist6);
- + }
- +
- + if (assist6.getMountType() == 1 || assist6.getMountType() == 2)
- + assist6.dismount();
- +
- + }
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist7.getPet() != null)
- + {
- + L2Summon summon = assist7.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist7);
- +
- + }
- +
- + if (assist7.getMountType() == 1 || assist7.getMountType() == 2)
- + assist7.dismount();
- +
- + }
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + {
- + // Remove Summon's buffs
- + if (assist8.getPet() != null)
- + {
- + L2Summon summon = assist8.getPet();
- + if (summon != null)
- + summon.unSummon(summon.getOwner());
- +
- + if (summon instanceof L2PetInstance)
- + summon.unSummon(assist8);
- +
- + }
- +
- + if (assist8.getMountType() == 1 || assist8.getMountType() == 2)
- + assist8.dismount();
- + }
- +
- + }
- +
- + public void removeSkills()
- + {
- + if (!(leader.getClassId() == ClassId.shillenElder || leader.getClassId() == ClassId.shillienSaint || leader.getClassId() == ClassId.bishop || leader.getClassId() == ClassId.cardinal || leader.getClassId() == ClassId.elder || leader.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : leader.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + leader.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist.getClassId() == ClassId.shillenElder || assist.getClassId() == ClassId.shillienSaint || assist.getClassId() == ClassId.bishop || assist.getClassId() == ClassId.cardinal || assist.getClassId() == ClassId.elder || assist.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist2.getClassId() == ClassId.shillenElder || assist2.getClassId() == ClassId.shillienSaint || assist2.getClassId() == ClassId.bishop || assist2.getClassId() == ClassId.cardinal || assist2.getClassId() == ClassId.elder || assist2.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist2.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist2.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist3.getClassId() == ClassId.shillenElder || assist3.getClassId() == ClassId.shillienSaint || assist3.getClassId() == ClassId.bishop || assist3.getClassId() == ClassId.cardinal || assist3.getClassId() == ClassId.elder || assist3.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist3.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist3.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist4.getClassId() == ClassId.shillenElder || assist4.getClassId() == ClassId.shillienSaint || assist4.getClassId() == ClassId.bishop || assist4.getClassId() == ClassId.cardinal || assist4.getClassId() == ClassId.elder || assist4.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist4.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist4.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist5.getClassId() == ClassId.shillenElder || assist5.getClassId() == ClassId.shillienSaint || assist5.getClassId() == ClassId.bishop || assist5.getClassId() == ClassId.cardinal || assist5.getClassId() == ClassId.elder || assist5.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist5.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist5.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist6.getClassId() == ClassId.shillenElder || assist6.getClassId() == ClassId.shillienSaint || assist6.getClassId() == ClassId.bishop || assist6.getClassId() == ClassId.cardinal || assist6.getClassId() == ClassId.elder || assist6.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist6.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist6.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist7.getClassId() == ClassId.shillenElder || assist7.getClassId() == ClassId.shillienSaint || assist7.getClassId() == ClassId.bishop || assist7.getClassId() == ClassId.cardinal || assist7.getClassId() == ClassId.elder || assist7.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist7.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist7.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (!(assist8.getClassId() == ClassId.shillenElder || assist8.getClassId() == ClassId.shillienSaint || assist8.getClassId() == ClassId.bishop || assist8.getClassId() == ClassId.cardinal || assist8.getClassId() == ClassId.elder || assist8.getClassId() == ClassId.evaSaint))
- + {
- + for (L2Effect effect : assist8.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist8.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- + }
- +
- + public void sendPacket(String message, int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + assist3.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + assist4.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + assist5.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + assist6.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + assist7.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + assist8.sendPacket(new ExShowScreenMessage(message, duration * 1000));
- +
- + }
- +
- + public void inicarContagem(int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(leader, duration), 0);
- +
- + if (assist != null && assist.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist, duration), 0);
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist2, duration), 0);
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist3, duration), 0);
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist4, duration), 0);
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist5, duration), 0);
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist6, duration), 0);
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist7, duration), 0);
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(assist8, duration), 0);
- + }
- +
- + public void sendPacketinit(String message, int duration)
- + {
- + if (leader != null && leader.isOnline() == 1)
- + leader.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist != null && assist.isOnline() == 1)
- + assist.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist2 != null && assist2.isOnline() == 1)
- + assist2.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist3 != null && assist3.isOnline() == 1)
- + assist3.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist4 != null && assist4.isOnline() == 1)
- + assist4.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist5 != null && assist5.isOnline() == 1)
- + assist5.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist6 != null && assist6.isOnline() == 1)
- + assist6.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist7 != null && assist7.isOnline() == 1)
- + assist7.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + if (assist8 != null && assist8.isOnline() == 1)
- + assist8.sendPacket(new ExShowScreenMessage(message, duration * 1000, ExShowScreenMessage.SMPOS.MIDDLE_LEFT, false));
- +
- + }
- +
- + }
- +
- + private class EvtArenaTask implements Runnable
- + {
- + private final Pair pairOne;
- + private final Pair pairTwo;
- + private final int pOneX, pOneY, pOneZ, pTwoX, pTwoY, pTwoZ;
- + private Arena arena;
- +
- + public EvtArenaTask(List<Pair> opponents)
- + {
- + pairOne = opponents.get(0);
- + pairTwo = opponents.get(1);
- + L2PcInstance 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--;
- + pairOne.saveTitle();
- + pairTwo.saveTitle();
- + portPairsToArena();
- + pairOne.inicarContagem(ArenaConfig.ARENA_WAIT_INTERVAL_9X9);
- + pairTwo.inicarContagem(ArenaConfig.ARENA_WAIT_INTERVAL_9X9);
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_WAIT_INTERVAL_9X9 * 1000);
- + }
- + catch (InterruptedException e1)
- + {
- + }
- + pairOne.sendPacketinit("Started. Good Fight!", 3);
- + pairTwo.sendPacketinit("Started. Good Fight!", 3);
- + pairOne.EventTitle(ArenaConfig.MSG_TEAM1, ArenaConfig.TITLE_COLOR_TEAM1);
- + pairTwo.EventTitle(ArenaConfig.MSG_TEAM2, ArenaConfig.TITLE_COLOR_TEAM2);
- + pairOne.setImobilised(false);
- + pairTwo.setImobilised(false);
- + pairOne.setArenaAttack(true);
- + pairTwo.setArenaAttack(true);
- +
- + while (check())
- + {
- + // check players status each seconds
- + try
- + {
- + Thread.sleep(ArenaConfig.ARENA_CHECK_INTERVAL);
- + }
- + catch (InterruptedException e)
- + {
- + break;
- + }
- + }
- + finishDuel();
- + free++;
- + }
- +
- + private void finishDuel()
- + {
- + fights.remove(arena.id);
- + rewardWinner();
- + pairOne.revive();
- + pairTwo.revive();
- + pairOne.teleportTo(pOneX, pOneY, pOneZ);
- + pairTwo.teleportTo(pTwoX, pTwoY, pTwoZ);
- + pairOne.backTitle();
- + pairTwo.backTitle();
- + pairOne.setRealInstance();
- + pairTwo.setRealInstance();
- + 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())
- + {
- + L2PcInstance leader1 = pairOne.getLeader();
- + L2PcInstance leader2 = pairTwo.getLeader();
- +
- + if (leader1.getClan() != null && leader2.getClan() != null && ArenaConfig.TOURNAMENT_EVENT_ANNOUNCE)
- + Broadcast.gameAnnounceToOnlinePlayers("(9X9):(" + leader1.getClan().getName() + " VS " + leader2.getClan().getName() + ") ~> " + leader1.getClan().getName() + " win!");
- +
- + pairOne.rewards();
- + pairTwo.rewardsLost();
- + }
- + else if (pairTwo.isAlive() && !pairOne.isAlive())
- + {
- + L2PcInstance leader1 = pairTwo.getLeader();
- + L2PcInstance leader2 = pairOne.getLeader();
- +
- + if (leader1.getClan() != null && leader2.getClan() != null && ArenaConfig.TOURNAMENT_EVENT_ANNOUNCE)
- + Broadcast.gameAnnounceToOnlinePlayers("(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 (Arena arena : arenas)
- + {
- + if (arena.isFree)
- + {
- + this.arena = arena;
- + arena.setFree(false);
- + pairOne.removePet();
- + pairTwo.removePet();
- + pairOne.setArenaInstance();
- + pairTwo.setArenaInstance();
- + 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(this.arena.id, pairOne.getLeader().getName() + " vs " + pairTwo.getLeader().getName());
- + break;
- + }
- + }
- + }
- + }
- +
- + private class Arena
- + {
- + protected int x, y, 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 L2PcInstance _player;
- + private int _time;
- +
- + public countdown(L2PcInstance player, int time)
- + {
- + _time = time;
- + _player = player;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_player.isOnline() == 1)
- + {
- +
- + switch (_time)
- + {
- + case 300:
- + case 240:
- + case 180:
- + case 120:
- + case 57:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in 60 second(s)..", 4000));
- + _player.sendMessage("60 second(s) to start the battle.");
- + }
- + break;
- + case 45:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 27:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("The battle starts in 30 second(s)..", 4000));
- + _player.sendMessage("30 second(s) to start the battle.");
- + }
- + break;
- + case 20:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 15:
- + if (_player.isOnline() == 1)
- + {
- + _player.sendPacket(new ExShowScreenMessage("" + _time + " ..", 3000));
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + }
- + break;
- + case 10:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 5:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 4:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 3:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 2:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + case 1:
- + if (_player.isOnline() == 1)
- + _player.sendMessage(_time + " second(s) to start the battle!");
- + break;
- + }
- + if (_time > 1)
- + {
- + ThreadPoolManager.getInstance().scheduleGeneral(new countdown(_player, _time - 1), 1000);
- + }
- + }
- + }
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final Arena9x9 INSTANCE = new Arena9x9();
- + }
- +}
- \ No newline at end of file
- diff --git a/head-src/Dev/Tournament/properties/ArenaConfig.java b/head-src/Dev/Tournament/properties/ArenaConfig.java
- new file mode 100644
- index 0000000..9d5d1aa
- --- /dev/null
- +++ b/head-src/Dev/Tournament/properties/ArenaConfig.java
- @@ -0,0 +1,368 @@
- +/*
- + * Copyright (C) 2004-2013 L2J Server
- + *
- + * This file is part of L2J Server.
- + *
- + * L2J Server is free software: you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation, either version 3 of the License, or
- + * (at your option) any later version.
- + *
- + * L2J Server is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + * General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package Dev.Tournament.properties;
- +
- +import com.l2jfrozen.commons.config.ExProperties;
- +
- +import java.io.File;
- +import java.io.IOException;
- +import java.util.ArrayList;
- +import java.util.List;
- +import java.util.logging.Logger;
- +
- +public class ArenaConfig
- +{
- + protected static final Logger _log = Logger.getLogger(ArenaConfig.class.getName());
- +
- + private static final String ARENA_FILE = "./config/CustomMods/Events/Tournament.ini";
- +
- + // tournament
- + 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 boolean CHECK_NOBLESS;
- +
- + 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 NPC_locx2;
- + public static int NPC_locy2;
- + public static int NPC_locz2;
- + public static int NPC_Heading2;
- +
- + public static int Tournament_locx;
- + public static int Tournament_locy;
- + public static int Tournament_locz;
- +
- + public static boolean ALLOW_1X1_REGISTER;
- + public static boolean ALLOW_3X3_REGISTER;
- + public static boolean ALLOW_5X5_REGISTER;
- + public static boolean ALLOW_9X9_REGISTER;
- +
- + public static boolean ALLOW_5X5_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_1X1;
- + public static int[][] ARENA_EVENT_LOCS_1X1;
- +
- + public static int ARENA_EVENT_COUNT_3X3;
- + public static int[][] ARENA_EVENT_LOCS_3X3;
- +
- + public static int ARENA_EVENT_COUNT_5X5;
- + public static int[][] ARENA_EVENT_LOCS_5X5;
- +
- + public static int ARENA_EVENT_COUNT_9X9;
- + public static int[][] ARENA_EVENT_LOCS_9X9;
- +
- + public static int duelist_COUNT_3X3;
- + public static int dreadnought_COUNT_3X3;
- + public static int tanker_COUNT_3X3;
- + public static int dagger_COUNT_3X3;
- + public static int archer_COUNT_3X3;
- + public static int bs_COUNT_3X3;
- + public static int archmage_COUNT_3X3;
- + public static int soultaker_COUNT_3X3;
- + public static int mysticMuse_COUNT_3X3;
- + public static int stormScreamer_COUNT_3X3;
- + public static int titan_COUNT_3X3;
- + public static int dominator_COUNT_3X3;
- +
- + public static int duelist_COUNT_5X5;
- + public static int dreadnought_COUNT_5X5;
- + public static int tanker_COUNT_5X5;
- + public static int dagger_COUNT_5X5;
- + public static int archer_COUNT_5X5;
- + public static int bs_COUNT_5X5;
- + public static int archmage_COUNT_5X5;
- + public static int soultaker_COUNT_5X5;
- + public static int mysticMuse_COUNT_5X5;
- + public static int stormScreamer_COUNT_5X5;
- + public static int titan_COUNT_5X5;
- + public static int dominator_COUNT_5X5;
- +
- + 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 dominator_COUNT_9X9;
- +
- + public static int ARENA_REWARD_ID;
- + public static int ARENA_VIP_DROP_RATE;
- + public static int ARENA_WIN_REWARD_COUNT_1X1;
- + public static int ARENA_LOST_REWARD_COUNT_1X1;
- + public static int ARENA_WIN_REWARD_COUNT_3X3;
- + public static int ARENA_LOST_REWARD_COUNT_3X3;
- + public static int ARENA_WIN_REWARD_COUNT_5X5;
- + public static int ARENA_LOST_REWARD_COUNT_5X5;
- + 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_1X1;
- + public static int ARENA_WAIT_INTERVAL_3X3;
- + public static int ARENA_WAIT_INTERVAL_5X5;
- + public static int ARENA_WAIT_INTERVAL_9X9;
- +
- + 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<>();
- + public static boolean ARENA_PROTECT;
- +
- + public static void init()
- + {
- + ExProperties tournament = load(ARENA_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("TournamentAnnounce", false);
- + CHECK_NOBLESS = tournament.getProperty("TournamentNobles", 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"));
- +
- + NPC_locx2 = Integer.parseInt(tournament.getProperty("Locx2", "1"));
- + NPC_locy2 = Integer.parseInt(tournament.getProperty("Locy2", "1"));
- + NPC_locz2 = Integer.parseInt(tournament.getProperty("Locz2", "1"));
- + NPC_Heading2 = Integer.parseInt(tournament.getProperty("Heading2", "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_1X1_REGISTER = Boolean.parseBoolean(tournament.getProperty("Allow1x1Register", "true"));
- + ALLOW_3X3_REGISTER = Boolean.parseBoolean(tournament.getProperty("Allow3x3Register", "true"));
- + ALLOW_5X5_REGISTER = Boolean.parseBoolean(tournament.getProperty("Allow5x5Register", "true"));
- + ALLOW_9X9_REGISTER = Boolean.parseBoolean(tournament.getProperty("Allow9x9Register", "true"));
- +
- + ALLOW_5X5_LOSTBUFF = Boolean.parseBoolean(tournament.getProperty("Allow5x5LostBuff", "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[] arenaLocs1x1 = tournament.getProperty("ArenasLoc1x1", "").split(";");
- + String[] locSplit1x1 = null;
- + ARENA_EVENT_COUNT_1X1 = arenaLocs1x1.length;
- + ARENA_EVENT_LOCS_1X1 = new int[ARENA_EVENT_COUNT_1X1][3];
- + for (int i = 0; i < ARENA_EVENT_COUNT_1X1; i++)
- + {
- + locSplit1x1 = arenaLocs1x1[i].split(",");
- + for (int j = 0; j < 3; j++)
- + {
- + ARENA_EVENT_LOCS_1X1[i][j] = Integer.parseInt(locSplit1x1[j].trim());
- + }
- + }
- +
- + String[] arenaLocs3x3 = tournament.getProperty("ArenasLoc3x3", "").split(";");
- + String[] locSplit3x3 = null;
- + ARENA_EVENT_COUNT_3X3 = arenaLocs3x3.length;
- + ARENA_EVENT_LOCS_3X3 = new int[ARENA_EVENT_COUNT_3X3][3];
- + for (int i = 0; i < ARENA_EVENT_COUNT_3X3; i++)
- + {
- + locSplit3x3 = arenaLocs3x3[i].split(",");
- + for (int j = 0; j < 3; j++)
- + {
- + ARENA_EVENT_LOCS_3X3[i][j] = Integer.parseInt(locSplit3x3[j].trim());
- + }
- + }
- +
- + String[] arenaLocs5x5 = tournament.getProperty("Arenas5x5Loc", "").split(";");
- + String[] locSplit5x5 = null;
- + ARENA_EVENT_COUNT_5X5 = arenaLocs5x5.length;
- + ARENA_EVENT_LOCS_5X5 = new int[ARENA_EVENT_COUNT_5X5][3];
- + for (int i = 0; i < ARENA_EVENT_COUNT_5X5; i++)
- + {
- + locSplit5x5 = arenaLocs5x5[i].split(",");
- + for (int j = 0; j < 3; j++)
- + {
- + ARENA_EVENT_LOCS_5X5[i][j] = Integer.parseInt(locSplit5x5[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];
- + for (int i = 0; i < ARENA_EVENT_COUNT_9X9; i++)
- + {
- + locSplit8x8 = arenaLocs9x9[i].split(",");
- + for (int j = 0; j < 3; j++)
- + {
- + ARENA_EVENT_LOCS_9X9[i][j] = Integer.parseInt(locSplit8x8[j].trim());
- + }
- + }
- +
- + duelist_COUNT_3X3 = tournament.getProperty("duelist_amount_3x3", 1);
- + dreadnought_COUNT_3X3 = tournament.getProperty("dreadnought_amount_3x3", 1);
- + tanker_COUNT_3X3 = tournament.getProperty("tanker_amount_3x3", 1);
- + dagger_COUNT_3X3 = tournament.getProperty("dagger_amount_3x3", 1);
- + archer_COUNT_3X3 = tournament.getProperty("archer_amount_3x3", 1);
- + bs_COUNT_3X3 = tournament.getProperty("bs_amount_3x3", 1);
- + archmage_COUNT_3X3 = tournament.getProperty("archmage_amount_3x3", 1);
- + soultaker_COUNT_3X3 = tournament.getProperty("soultaker_amount_3x3", 1);
- + mysticMuse_COUNT_3X3 = tournament.getProperty("mysticMuse_amount_3x3", 1);
- + stormScreamer_COUNT_3X3 = tournament.getProperty("stormScreamer_amount_3x3", 1);
- + titan_COUNT_3X3 = tournament.getProperty("titan_amount_3x3", 1);
- + dominator_COUNT_3X3 = tournament.getProperty("dominator_amount_3x3", 1);
- +
- + duelist_COUNT_5X5 = tournament.getProperty("duelist_amount_5x5", 1);
- + dreadnought_COUNT_5X5 = tournament.getProperty("dreadnought_amount_5x5", 1);
- + tanker_COUNT_5X5 = tournament.getProperty("tanker_amount_5x5", 1);
- + dagger_COUNT_5X5 = tournament.getProperty("dagger_amount_5x5", 1);
- + archer_COUNT_5X5 = tournament.getProperty("archer_amount_5x5", 1);
- + bs_COUNT_5X5 = tournament.getProperty("bs_amount_5x5", 1);
- + archmage_COUNT_5X5 = tournament.getProperty("archmage_amount_5x5", 1);
- + soultaker_COUNT_5X5 = tournament.getProperty("soultaker_amount_5x5", 1);
- + mysticMuse_COUNT_5X5 = tournament.getProperty("mysticMuse_amount_5x5", 1);
- + stormScreamer_COUNT_5X5 = tournament.getProperty("stormScreamer_amount_5x5", 1);
- + titan_COUNT_5X5 = tournament.getProperty("titan_amount_5x5", 1);
- + dominator_COUNT_5X5 = tournament.getProperty("dominator_amount_5x5", 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);
- + dominator_COUNT_9X9 = tournament.getProperty("dominator_amount_9x9", 1);
- +
- + ARENA_REWARD_ID = tournament.getProperty("ArenaRewardId", 57);
- + ARENA_VIP_DROP_RATE = tournament.getProperty("ArenaRateDropVIP", 1);
- + ARENA_WIN_REWARD_COUNT_1X1 = tournament.getProperty("ArenaWinRewardCount1x1", 1);
- + ARENA_LOST_REWARD_COUNT_1X1 = tournament.getProperty("ArenaLostRewardCount1x1", 1);
- + ARENA_WIN_REWARD_COUNT_3X3 = tournament.getProperty("ArenaWinRewardCount3x3", 1);
- + ARENA_LOST_REWARD_COUNT_3X3 = tournament.getProperty("ArenaLostRewardCount3x3", 1);
- + ARENA_WIN_REWARD_COUNT_5X5 = tournament.getProperty("ArenaWinRewardCount5x5", 1);
- + ARENA_LOST_REWARD_COUNT_5X5 = tournament.getProperty("ArenaLostRewardCount5x5", 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_1X1 = tournament.getProperty("ArenaBattleWaitInterval1x1", 20);
- + ARENA_WAIT_INTERVAL_3X3 = tournament.getProperty("ArenaBattleWaitInterval3x3", 20);
- + ARENA_WAIT_INTERVAL_5X5 = tournament.getProperty("ArenaBattleWaitInterval5x5", 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.parseInt(id));
- +
- + ARENA_SKILL_PROTECT = Boolean.parseBoolean(tournament.getProperty("ArenaSkillProtect", "false"));
- +
- + for (String id : tournament.getProperty("ArenaDisableSkillList", "0").split(","))
- + {
- + ARENA_SKILL_LIST.add(Integer.parseInt(id));
- + }
- +
- + for (String id : tournament.getProperty("DisableSkillList", "0").split(","))
- + {
- + ARENA_DISABLE_SKILL_LIST_PERM.add(Integer.parseInt(id));
- + }
- +
- + for (String id : tournament.getProperty("ArenaDisableSkillList_noStart", "0").split(","))
- + {
- + ARENA_DISABLE_SKILL_LIST.add(Integer.parseInt(id));
- + }
- +
- + for (String id : tournament.getProperty("ArenaStopSkillList", "0").split(","))
- + {
- + ARENA_STOP_SKILL_LIST.add(Integer.parseInt(id));
- + }
- +
- + ARENA_PROTECT = Boolean.parseBoolean(tournament.getProperty("ArenaProtect", "true"));
- + }
- +
- + public static ExProperties load(String filename)
- + {
- + return load(new File(filename));
- + }
- +
- + public static ExProperties load(File file)
- + {
- + ExProperties result = new ExProperties();
- +
- + try
- + {
- + result.load(file);
- + }
- + catch (IOException e)
- + {
- + _log.warning("Error loading config : " + file.getName() + "!");
- + }
- + return result;
- + }
- +}
- \ No newline at end of file
- diff --git a/head-src/Dev/Tournament/properties/ArenaEvent.java b/head-src/Dev/Tournament/properties/ArenaEvent.java
- new file mode 100644
- index 0000000..51a06d3
- --- /dev/null
- +++ b/head-src/Dev/Tournament/properties/ArenaEvent.java
- @@ -0,0 +1,109 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package Dev.Tournament.properties;
- +
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +
- +import java.text.SimpleDateFormat;
- +import java.util.Calendar;
- +import java.util.logging.Logger;
- +
- +/**
- + * @author Axcel Kuhn (Baseado no Restart System)
- + */
- +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";
- + }
- +
- + private ArenaEvent()
- + {
- + }
- +
- + public void StartCalculationOfNextEventTime()
- + {
- + try
- + {
- + Calendar currentTime = Calendar.getInstance();
- + Calendar testStartTime = null;
- + long flush2 = 0, timeL = 0;
- + int count = 0;
- +
- + for (String timeOfDay : ArenaConfig.TOURNAMENT_EVENT_INTERVAL_BY_TIME_OF_DAY)
- + {
- + testStartTime = Calendar.getInstance();
- + testStartTime.setLenient(true);
- + String[] splitTimeOfDay = timeOfDay.split(":");
- + testStartTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(splitTimeOfDay[0]));
- + testStartTime.set(Calendar.MINUTE, Integer.parseInt(splitTimeOfDay[1]));
- + testStartTime.set(Calendar.SECOND, 00);
- + if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis())
- + {
- + testStartTime.add(Calendar.DAY_OF_MONTH, 1);
- + }
- +
- + timeL = testStartTime.getTimeInMillis() - currentTime.getTimeInMillis();
- +
- + if (count == 0)
- + {
- + flush2 = timeL;
- + NextEvent = testStartTime;
- + }
- +
- + if (timeL < flush2)
- + {
- + flush2 = timeL;
- + NextEvent = testStartTime;
- + }
- + count++;
- + }
- + _log.info("Tournament: Next Event " + NextEvent.getTime().toString());
- + ThreadPoolManager.getInstance().scheduleGeneral(new StartEventTask(), flush2);
- + }
- + catch (Exception e)
- + {
- + e.printStackTrace();
- + System.out.println("[Tournament]: "+e);
- + }
- + }
- +
- + class StartEventTask implements Runnable
- + {
- + @Override
- + public void run()
- + {
- + _log.info("----------------------------------------------------------------------------");
- + _log.info("Tournament: Event Started.");
- + _log.info("----------------------------------------------------------------------------");
- + ArenaTask.SpawnEvent();
- + }
- + }
- +}
- diff --git a/head-src/Dev/Tournament/properties/ArenaTask.java b/head-src/Dev/Tournament/properties/ArenaTask.java
- new file mode 100644
- index 0000000..1dbe67e
- --- /dev/null
- +++ b/head-src/Dev/Tournament/properties/ArenaTask.java
- @@ -0,0 +1,311 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package Dev.Tournament.properties;
- +
- +import com.l2jfrozen.gameserver.datatables.sql.ItemTable;
- +import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
- +import com.l2jfrozen.gameserver.datatables.sql.SpawnTable;
- +import com.l2jfrozen.gameserver.model.L2World;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
- +import com.l2jfrozen.gameserver.network.clientpackets.Say2;
- +import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;
- +import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser;
- +import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +import com.l2jfrozen.gameserver.util.Broadcast;
- +
- +import Dev.Tournament.Arena1x1;
- +import Dev.Tournament.Arena3x3;
- +import Dev.Tournament.Arena5x5;
- +import Dev.Tournament.Arena9x9;
- +
- +public abstract class ArenaTask
- +{
- + public static L2Spawn _npcSpawn1;
- + public static L2Spawn _npcSpawn2;
- +
- + public static int _bossHeading = 0;
- +
- + /** The _in progress. */
- + public static boolean _started = false;
- +
- + public static boolean _aborted = false;
- +
- + public static void SpawnEvent()
- + {
- + Arena1x1.getInstance().clear();
- + Arena3x3.getInstance().clear();
- + Arena5x5.getInstance().clear();
- + Arena9x9.getInstance().clear();
- +
- + spawnNpc1();
- + spawnNpc2();
- +
- + Broadcast.gameAnnounceToOnlinePlayers("Tournament: Event Started");
- + //Broadcast.gameAnnounceToOnlinePlayers("Tournament: 1x1| 3x3 | 5x5 | 9x9");
- + Broadcast.gameAnnounceToOnlinePlayers("Tournament: Duration: " + ArenaConfig.TOURNAMENT_TIME + " minute(s)!");
- +
- + _aborted = false;
- + _started = true;
- +
- + ThreadPoolManager.getInstance().scheduleGeneral(Arena1x1.getInstance(), 5000);
- + ThreadPoolManager.getInstance().scheduleGeneral(Arena3x3.getInstance(), 5000);
- + ThreadPoolManager.getInstance().scheduleGeneral(Arena5x5.getInstance(), 5000);
- + ThreadPoolManager.getInstance().scheduleGeneral(Arena9x9.getInstance(), 5000);
- +
- + waiter(ArenaConfig.TOURNAMENT_TIME * 60 * 1000); // minutes for event time
- +
- + if (!_aborted)
- + finishEvent();
- + }
- +
- + public static void finishEvent()
- + {
- + Broadcast.gameAnnounceToOnlinePlayers("Tournament: Event Finished!");
- +
- + unspawnNpc1();
- + unspawnNpc2();
- + _started = false;
- +
- + ArenaEvent.getInstance().StartCalculationOfNextEventTime();
- +
- + for (L2PcInstance player : L2World.getInstance().getAllPlayers())
- + {
- + if (player != null && player.isOnline() == 1)
- + {
- + if (player.isArenaProtection())
- + {
- + ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
- + {
- +
- + @Override
- + public void run()
- + {
- + if (player.isOnline() == 1 && !player.isInArenaEvent() && !player.isArenaAttack())
- + {
- + if (player.isArena1x1())
- + Arena1x1.getInstance().remove(player);
- + if (player.isArena3x3())
- + Arena3x3.getInstance().remove(player);
- + if (player.isArena5x5())
- + Arena5x5.getInstance().remove(player);
- + if (player.isArena9x9())
- + Arena9x9.getInstance().remove(player);
- +
- + player.setArenaProtection(false);
- + }
- + }
- + }, 25000);
- + }
- +
- + CreatureSay cs = new CreatureSay(player.getObjectId(), Say2.PARTY, "[Tournament]", ("Next Tournament: " + ArenaEvent.getInstance().getNextTime()) + " (GMT-3)."); // 8D
- + player.sendPacket(cs);
- + }
- + }
- + }
- +
- + public static void spawnNpc1()
- + {
- + L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(ArenaConfig.ARENA_NPC);
- +
- + try
- + {
- + _npcSpawn1 = new L2Spawn(tmpl);
- + _npcSpawn1.setLocx(loc1x());
- + _npcSpawn1.setLocy(loc1y());
- + _npcSpawn1.setLocz(loc1z());
- + _npcSpawn1.setHeading(ArenaConfig.NPC_Heading);
- + _npcSpawn1.setRespawnDelay(1);
- +
- + SpawnTable.getInstance().addNewSpawn(_npcSpawn1, false);
- +
- + _npcSpawn1.doSpawn();
- + _npcSpawn1.getLastSpawn().getStatus().setCurrentHp(999999999);
- + _npcSpawn1.getLastSpawn().isAggressive();
- + _npcSpawn1.getLastSpawn().decayMe();
- + _npcSpawn1.getLastSpawn().spawnMe(_npcSpawn1.getLastSpawn().getX(), _npcSpawn1.getLastSpawn().getY(), _npcSpawn1.getLastSpawn().getZ());
- + _npcSpawn1.getLastSpawn().broadcastPacket(new MagicSkillUser(_npcSpawn1.getLastSpawn(), _npcSpawn1.getLastSpawn(), 1034, 1, 1, 1));
- + }
- + catch (Exception e)
- + {
- + e.printStackTrace();
- + }
- + }
- +
- + public static void spawnNpc2()
- + {
- + L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(ArenaConfig.ARENA_NPC);
- +
- + try
- + {
- + _npcSpawn2 = new L2Spawn(tmpl);
- + _npcSpawn2.setLocx(loc2x());
- + _npcSpawn2.setLocy(loc2y());
- + _npcSpawn2.setLocz(loc2z());
- + _npcSpawn2.setHeading(ArenaConfig.NPC_Heading2);
- + _npcSpawn2.setRespawnDelay(1);
- +
- +
- + SpawnTable.getInstance().addNewSpawn(_npcSpawn2, false);
- +
- +
- + _npcSpawn2.doSpawn();
- + _npcSpawn2.getLastSpawn().getStatus().setCurrentHp(999999999);
- + _npcSpawn2.getLastSpawn().isAggressive();
- + _npcSpawn2.getLastSpawn().decayMe();
- + _npcSpawn2.getLastSpawn().spawnMe(_npcSpawn2.getLastSpawn().getX(), _npcSpawn2.getLastSpawn().getY(), _npcSpawn2.getLastSpawn().getZ());
- + _npcSpawn2.getLastSpawn().broadcastPacket(new MagicSkillUser(_npcSpawn2.getLastSpawn(), _npcSpawn2.getLastSpawn(), 1034, 1, 1, 1));
- +
- + }
- + catch (Exception e)
- + {
- + e.printStackTrace();
- + }
- + }
- +
- + /**
- + * Checks if is _started.
- + * @return the _started
- + */
- + public static boolean is_started()
- + {
- + return _started;
- + }
- +
- + public static void unspawnNpc1()
- + {
- + if (_npcSpawn1 == null)
- + return;
- +
- + _npcSpawn1.getLastSpawn().deleteMe();
- + _npcSpawn1.stopRespawn();
- + SpawnTable.getInstance().deleteSpawn(_npcSpawn1, true);
- + }
- +
- + public static void unspawnNpc2()
- + {
- + if (_npcSpawn2 == null)
- + return;
- +
- + _npcSpawn2.getLastSpawn().deleteMe();
- + _npcSpawn2.stopRespawn();
- + SpawnTable.getInstance().deleteSpawn(_npcSpawn2, true);
- + }
- +
- + public static int loc1x()
- + {
- + int loc1x = ArenaConfig.NPC_locx;
- + return loc1x;
- + }
- +
- + public static int loc1y()
- + {
- + int loc1y = ArenaConfig.NPC_locy;
- + return loc1y;
- + }
- +
- + public static int loc1z()
- + {
- + int loc1z = ArenaConfig.NPC_locz;
- + return loc1z;
- + }
- +
- + public static int loc2x()
- + {
- + int loc2x = ArenaConfig.NPC_locx2;
- + return loc2x;
- + }
- +
- + public static int loc2y()
- + {
- + int loc2y = ArenaConfig.NPC_locy2;
- + return loc2y;
- + }
- +
- + public static int loc2z()
- + {
- + int loc2z = ArenaConfig.NPC_locz2;
- + return loc2z;
- + }
- +
- + /**
- + * Waiter.
- + * @param interval the interval
- + */
- + protected static void waiter(long interval)
- + {
- + long startWaiterTime = System.currentTimeMillis();
- + int seconds = (int) (interval / 1000);
- +
- + while (startWaiterTime + interval > System.currentTimeMillis() && !_aborted)
- + {
- + seconds--; // Here because we don't want to see two time announce at the same time
- +
- + switch (seconds)
- + {
- + case 3600: // 1 hour left
- +
- + if (_started)
- + {
- + Broadcast.gameAnnounceToOnlinePlayers("Tournament: Party Event PvP");
- + Broadcast.gameAnnounceToOnlinePlayers("Tournament: Teleport in the GK to (Tournament) Zone");
- + Broadcast.gameAnnounceToOnlinePlayers("Tournament: Reward: " + ItemTable.getInstance().getTemplate(ArenaConfig.ARENA_REWARD_ID).getName());
- + Broadcast.gameAnnounceToOnlinePlayers("Tournament: " + seconds / 60 / 60 + " hour(s) till event finish!");
- + }
- + break;
- + case 1800: // 30 minutes left
- + case 900: // 15 minutes left
- + case 600: // 10 minutes left
- + case 300: // 5 minutes left
- + case 240: // 4 minutes left
- + case 180: // 3 minutes left
- + case 120: // 2 minutes left
- + case 60: // 1 minute left
- + // removeOfflinePlayers();
- +
- + if (_started)
- + {
- + Broadcast.gameAnnounceToOnlinePlayers("Tournament: " + seconds / 60 + " minute(s) till event finish!");
- + }
- + break;
- + case 30: // 30 seconds left
- + case 15: // 15 seconds left
- + case 10: // 10 seconds left
- + case 3: // 3 seconds left
- + case 2: // 2 seconds left
- + case 1: // 1 seconds left
- + if (_started)
- + Broadcast.gameAnnounceToOnlinePlayers("Tournament: " + seconds + " second(s) till event finish!");
- +
- + break;
- + }
- +
- + long startOneSecondWaiterStartTime = System.currentTimeMillis();
- +
- + // Only the try catch with Thread.sleep(1000) give bad countdown on high wait times
- + while (startOneSecondWaiterStartTime + 1000 > System.currentTimeMillis())
- + {
- + try
- + {
- + Thread.sleep(1);
- + }
- + catch (InterruptedException ie)
- + {
- + }
- + }
- + }
- + }
- +}
- \ No newline at end of file
- diff --git a/head-src/com/l2jfrozen/Config.java b/head-src/com/l2jfrozen/Config.java
- index f9008de..f8a728a 100644
- --- a/head-src/com/l2jfrozen/Config.java
- +++ b/head-src/com/l2jfrozen/Config.java
- @@ -45,6 +45,7 @@
- import org.apache.log4j.Logger;
- +import com.l2jfrozen.commons.config.ExProperties;
- import com.l2jfrozen.gameserver.model.entity.olympiad.OlympiadPeriod;
- import com.l2jfrozen.gameserver.model.holder.RewardHolder;
- import com.l2jfrozen.gameserver.util.FloodProtectorConfig;
- @@ -6268,7 +6269,26 @@
- return false;
- return true;
- }
- -
- + /**
- + * Initialize {@link ExProperties} from specified configuration file.
- + * @param filename : File name to be loaded.
- + * @return ExProperties : Initialized {@link ExProperties}.
- + */
- + public static final ExProperties initProperties(String filename)
- + {
- + final ExProperties result = new ExProperties();
- +
- + try
- + {
- + result.load(new File(filename));
- + }
- + catch (IOException e)
- + {
- + LOGGER.warn("Config: Error loading \"" + filename + "\" config.");
- + }
- +
- + return result;
- + }
- public static void saveHexid(final int serverId, final String string)
- {
- Config.saveHexid(serverId, string, HEXID_FILE);
- diff --git a/head-src/com/l2jfrozen/commons/config/ExProperties.java b/head-src/com/l2jfrozen/commons/config/ExProperties.java
- new file mode 100644
- index 0000000..b7cdc9c
- --- /dev/null
- +++ b/head-src/com/l2jfrozen/commons/config/ExProperties.java
- @@ -0,0 +1,175 @@
- +package com.l2jfrozen.commons.config;
- +
- +import java.io.File;
- +import java.io.FileInputStream;
- +import java.io.IOException;
- +import java.io.InputStream;
- +import java.util.Properties;
- +
- +public class ExProperties extends Properties
- +{
- + private static final long serialVersionUID = 1L;
- +
- + public static final String defaultDelimiter = "[\\s,;]+";
- +
- + public void load(final String fileName) throws IOException
- + {
- + load(new File(fileName));
- + }
- +
- + public void load(final File file) throws IOException
- + {
- + try (InputStream is = new FileInputStream(file))
- + {
- + load(is);
- + }
- + }
- +
- + public boolean getProperty(final String name, final boolean defaultValue)
- + {
- + boolean val = defaultValue;
- +
- + final String value;
- +
- + if ((value = super.getProperty(name, null)) != null)
- + val = Boolean.parseBoolean(value);
- +
- + return val;
- + }
- +
- + public int getProperty(final String name, final int defaultValue)
- + {
- + int val = defaultValue;
- +
- + final String value;
- +
- + if ((value = super.getProperty(name, null)) != null)
- + val = Integer.parseInt(value);
- +
- + return val;
- + }
- +
- + public long getProperty(final String name, final long defaultValue)
- + {
- + long val = defaultValue;
- +
- + final String value;
- +
- + if ((value = super.getProperty(name, null)) != null)
- + val = Long.parseLong(value);
- +
- + return val;
- + }
- +
- + public double getProperty(final String name, final double defaultValue)
- + {
- + double val = defaultValue;
- +
- + final String value;
- +
- + if ((value = super.getProperty(name, null)) != null)
- + val = Double.parseDouble(value);
- +
- + return val;
- + }
- +
- + public String[] getProperty(final String name, final String[] defaultValue)
- + {
- + return getProperty(name, defaultValue, defaultDelimiter);
- + }
- +
- + public String[] getProperty(final String name, final String[] defaultValue, final String delimiter)
- + {
- + String[] val = defaultValue;
- + final String value;
- +
- + if ((value = super.getProperty(name, null)) != null)
- + val = value.split(delimiter);
- +
- + return val;
- + }
- +
- + public boolean[] getProperty(final String name, final boolean[] defaultValue)
- + {
- + return getProperty(name, defaultValue, defaultDelimiter);
- + }
- +
- + public boolean[] getProperty(final String name, final boolean[] defaultValue, final String delimiter)
- + {
- + boolean[] val = defaultValue;
- + final String value;
- +
- + if ((value = super.getProperty(name, null)) != null)
- + {
- + final String[] values = value.split(delimiter);
- + val = new boolean[values.length];
- + for (int i = 0; i < val.length; i++)
- + val[i] = Boolean.parseBoolean(values[i]);
- + }
- +
- + return val;
- + }
- +
- + public int[] getProperty(final String name, final int[] defaultValue)
- + {
- + return getProperty(name, defaultValue, defaultDelimiter);
- + }
- +
- + public int[] getProperty(final String name, final int[] defaultValue, final String delimiter)
- + {
- + int[] val = defaultValue;
- + final String value;
- +
- + if ((value = super.getProperty(name, null)) != null)
- + {
- + final String[] values = value.split(delimiter);
- + val = new int[values.length];
- + for (int i = 0; i < val.length; i++)
- + val[i] = Integer.parseInt(values[i]);
- + }
- +
- + return val;
- + }
- +
- + public long[] getProperty(final String name, final long[] defaultValue)
- + {
- + return getProperty(name, defaultValue, defaultDelimiter);
- + }
- +
- + public long[] getProperty(final String name, final long[] defaultValue, final String delimiter)
- + {
- + long[] val = defaultValue;
- + final String value;
- +
- + if ((value = super.getProperty(name, null)) != null)
- + {
- + final String[] values = value.split(delimiter);
- + val = new long[values.length];
- + for (int i = 0; i < val.length; i++)
- + val[i] = Long.parseLong(values[i]);
- + }
- +
- + return val;
- + }
- +
- + public double[] getProperty(final String name, final double[] defaultValue)
- + {
- + return getProperty(name, defaultValue, defaultDelimiter);
- + }
- +
- + public double[] getProperty(final String name, final double[] defaultValue, final String delimiter)
- + {
- + double[] val = defaultValue;
- + final String value;
- +
- + if ((value = super.getProperty(name, null)) != null)
- + {
- + final String[] values = value.split(delimiter);
- + val = new double[values.length];
- + for (int i = 0; i < val.length; i++)
- + val[i] = Double.parseDouble(values[i]);
- + }
- +
- + return val;
- + }
- +}
- \ No newline at end of file
- diff --git a/head-src/com/l2jfrozen/gameserver/GameServer.java b/head-src/com/l2jfrozen/gameserver/GameServer.java
- index 1631218..0be4989 100644
- --- a/head-src/com/l2jfrozen/gameserver/GameServer.java
- +++ b/head-src/com/l2jfrozen/gameserver/GameServer.java
- @@ -160,6 +160,9 @@
- import Dev.SpecialMods.PartyZoneReward;
- import Dev.SpecialMods.RaidBossInfoManager;
- import Dev.SpecialMods.XMLDocumentFactory;
- +import Dev.Tournament.properties.ArenaConfig;
- +import Dev.Tournament.properties.ArenaEvent;
- +import Dev.Tournament.properties.ArenaTask;
- public class GameServer
- {
- @@ -610,6 +613,20 @@
- else
- LOGGER.info("All events are Disabled.");
- + ArenaConfig.init();
- + if (ArenaConfig.TOURNAMENT_EVENT_TIME)
- + {
- + LOGGER.info("Tournament Event is enabled.");
- + ArenaEvent.getInstance().StartCalculationOfNextEventTime();
- + }
- + else if (ArenaConfig.TOURNAMENT_EVENT_START)
- + {
- + LOGGER.info("Tournament Event is enabled.");
- + ArenaTask.spawnNpc1();
- + ArenaTask.spawnNpc2();
- + }
- + else
- + LOGGER.info("Tournament Event is disabled");
- if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS)
- OfflineTradeTable.restoreOfflineTraders();
- diff --git a/head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java b/head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java
- index 6b66771..6e7bc93 100644
- --- a/head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java
- +++ b/head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java
- @@ -45,6 +45,7 @@
- import com.l2jfrozen.gameserver.model.zone.form.ZoneCuboid;
- import com.l2jfrozen.gameserver.model.zone.form.ZoneCylinder;
- import com.l2jfrozen.gameserver.model.zone.form.ZoneNPoly;
- +import com.l2jfrozen.gameserver.model.zone.type.L2ArenaEventZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2ArenaZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2BigheadZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2BossZone;
- @@ -67,6 +68,7 @@
- import com.l2jfrozen.gameserver.model.zone.type.L2PeaceZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2PoisonZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2SwampZone;
- +import com.l2jfrozen.gameserver.model.zone.type.L2TournamentZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2TownZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2WaterZone;
- import com.l2jfrozen.util.CloseUtil;
- @@ -238,6 +240,12 @@
- case "FlagZone":
- temp = new L2FlagZone(zoneId);
- break;
- + case "ArenaEventZone":
- + temp = new L2ArenaEventZone(zoneId);
- + break;
- + case "TournamentZone":
- + temp = new L2TournamentZone(zoneId);
- + break;
- case "BossZone":
- int boss_id = -1;
- diff --git a/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCustom.java b/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCustom.java
- index a740e7a..15b7fd1 100644
- --- a/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCustom.java
- +++ b/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCustom.java
- @@ -7,6 +7,7 @@
- import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- import Dev.Events.PartyFarm.PartyFarm;
- +import Dev.Tournament.properties.ArenaTask;
- //import Dev.Tournament.properties.ArenaTask;
- @@ -29,7 +30,7 @@
- {
- - /*if (command.equals("admin_tour"))
- + if (command.equals("admin_tour"))
- {
- if (ArenaTask._started)
- {
- @@ -53,7 +54,7 @@
- }
- return true;
- - }*/
- + }
- if (command.equals("admin_ptfarm"))
- {
- if (PartyFarm._started)
- @@ -108,7 +109,7 @@
- }, 1L);
- }
- - /*
- +
- private static void initEventArena()
- {
- ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
- @@ -133,7 +134,7 @@
- ArenaTask.finishEvent();
- }
- }, 10L);
- - }*/
- + }
- diff --git a/head-src/com/l2jfrozen/gameserver/handler/itemhandlers/SummonItems.java b/head-src/com/l2jfrozen/gameserver/handler/itemhandlers/SummonItems.java
- index 0e47ef9..b6e34b3 100644
- --- a/head-src/com/l2jfrozen/gameserver/handler/itemhandlers/SummonItems.java
- +++ b/head-src/com/l2jfrozen/gameserver/handler/itemhandlers/SummonItems.java
- @@ -27,6 +27,7 @@
- import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
- import com.l2jfrozen.gameserver.handler.IItemHandler;
- import com.l2jfrozen.gameserver.idfactory.IdFactory;
- +import com.l2jfrozen.gameserver.model.L2Character;
- import com.l2jfrozen.gameserver.model.L2Skill;
- import com.l2jfrozen.gameserver.model.L2SummonItem;
- import com.l2jfrozen.gameserver.model.L2World;
- @@ -63,7 +64,11 @@
- playable.sendPacket(ActionFailed.STATIC_PACKET);
- return;
- }
- -
- + if (activeChar.isArenaProtection() && activeChar.isInsideZone(L2Character.TOURNAMENT))
- + {
- + activeChar.sendMessage("You can not do this in Tournament Event");
- + return;
- + }
- // if(activeChar._inEventTvT && TvT._started && !Config.TVT_ALLOW_SUMMON)
- if (activeChar._inEventTvT && TvT.is_started() && !Config.TVT_ALLOW_SUMMON)
- {
- diff --git a/head-src/com/l2jfrozen/gameserver/handler/skillhandlers/SummonFriend.java b/head-src/com/l2jfrozen/gameserver/handler/skillhandlers/SummonFriend.java
- index aa13e95..50d415a 100644
- --- a/head-src/com/l2jfrozen/gameserver/handler/skillhandlers/SummonFriend.java
- +++ b/head-src/com/l2jfrozen/gameserver/handler/skillhandlers/SummonFriend.java
- @@ -64,7 +64,11 @@
- activePlayer.sendPacket(new SystemMessage(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT));
- return;
- }
- -
- + if (activeChar.isArenaProtection() && activeChar.isInsideZone(L2Character.TOURNAMENT))
- + {
- + activePlayer.sendMessage("You cannot use this skill in Tournament Event.");
- + return;
- + }
- if (activePlayer._inEvent)
- {
- activePlayer.sendMessage("You cannot use this skill in Event.");
- diff --git a/head-src/com/l2jfrozen/gameserver/handler/usercommandhandlers/Escape.java b/head-src/com/l2jfrozen/gameserver/handler/usercommandhandlers/Escape.java
- index f13d56e..2698fd8 100644
- --- a/head-src/com/l2jfrozen/gameserver/handler/usercommandhandlers/Escape.java
- +++ b/head-src/com/l2jfrozen/gameserver/handler/usercommandhandlers/Escape.java
- @@ -26,6 +26,7 @@
- import com.l2jfrozen.gameserver.datatables.csv.MapRegionTable;
- import com.l2jfrozen.gameserver.handler.IUserCommandHandler;
- import com.l2jfrozen.gameserver.managers.GrandBossManager;
- +import com.l2jfrozen.gameserver.model.L2Character;
- import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jfrozen.gameserver.model.entity.event.CTF;
- import com.l2jfrozen.gameserver.model.entity.event.DM;
- @@ -65,7 +66,11 @@
- activeChar.sendMessage("You may not use an escape command in a festival.");
- return false;
- }
- -
- + if (activeChar.isArenaProtection() && activeChar.isInsideZone(L2Character.TOURNAMENT))
- + {
- + activeChar.sendMessage("You cannot use this skill in Tournament Event/Zone.");
- + return false;
- + }
- // Check to see if the current player is in TVT Event.
- if (activeChar._inEventTvT && TvT.is_started())
- {
- diff --git a/head-src/com/l2jfrozen/gameserver/model/L2Character.java b/head-src/com/l2jfrozen/gameserver/model/L2Character.java
- index 13a0f45..3bc645a 100644
- --- a/head-src/com/l2jfrozen/gameserver/model/L2Character.java
- +++ b/head-src/com/l2jfrozen/gameserver/model/L2Character.java
- @@ -142,6 +142,8 @@
- import com.l2jfrozen.util.Point3D;
- import com.l2jfrozen.util.random.Rnd;
- +import Dev.Tournament.properties.ArenaConfig;
- +
- /**
- * Mother class of all character objects of the world (PC, NPC...)<BR>
- * <BR>
- @@ -310,7 +312,8 @@
- * x^2 or x*x.
- */
- public static final int ZONE_PVP = 1;
- -
- + public static final int ARENA_EVENT = 21;
- + public static final int TOURNAMENT = 22;
- /** The Constant ZONE_PEACE. */
- public static final int ZONE_PEACE = 2;
- @@ -2259,7 +2262,7 @@
- if (Config.CTF_REMOVE_BUFFS_ON_DIE)
- stopAllEffects();
- }
- - else if (Config.LEAVE_BUFFS_ON_DIE) // this means that the player is not in event
- + else if (Config.LEAVE_BUFFS_ON_DIE || (isArenaAttack() && (isArena9x9() || (isArena5x5() && ArenaConfig.ALLOW_5X5_LOSTBUFF)))) // this means that the player is not in event
- {
- stopAllEffects();
- }
- @@ -2809,7 +2812,7 @@
- */
- public boolean isMovementDisabled()
- {
- - return isImmobileUntilAttacked() || isStunned() || isRooted() || isSleeping() || isOverloaded() || isParalyzed() || isImobilised() || isFakeDeath() || isFallsdown();
- + return isImmobileUntilAttacked() || isStunned() || isRooted() || isStopArena() || isSleeping() || isOverloaded() || isParalyzed() || isImobilised() || isFakeDeath() || isFallsdown();
- }
- /**
- @@ -10973,6 +10976,173 @@
- {
- _isAttackDisabled = value;
- }
- + //--------------
- + // Tournament
- + //--------------
- +
- + private boolean _ArenaProtection;
- +
- + public void setArenaProtection(boolean comm)
- + {
- + _ArenaProtection = comm;
- + }
- +
- + public boolean isArenaProtection()
- + {
- + return _ArenaProtection;
- + }
- +
- + private boolean inArenaEvent = false;
- +
- + public void setInArenaEvent(boolean val)
- + {
- + inArenaEvent = val;
- + }
- +
- + public boolean isInArenaEvent()
- + {
- + return inArenaEvent;
- + }
- +
- + private boolean _ArenaAttack;
- +
- + public void setArenaAttack(boolean comm)
- + {
- + _ArenaAttack = comm;
- + }
- +
- + public boolean isArenaAttack()
- + {
- + return _ArenaAttack;
- + }
- +
- + private boolean _Arena1x1;
- +
- + public void setArena1x1(boolean comm)
- + {
- + _Arena1x1 = comm;
- + }
- +
- + public boolean isArena1x1()
- + {
- + return _Arena1x1;
- + }
- +
- + private boolean _Arena3x3;
- +
- + public void setArena3x3(boolean comm)
- + {
- + _Arena3x3 = comm;
- + }
- +
- + public boolean isArena3x3()
- + {
- + return _Arena3x3;
- + }
- +
- + private boolean _Arena5x5;
- +
- + public void setArena5x5(boolean comm)
- + {
- + _Arena5x5 = comm;
- + }
- +
- + public boolean isArena5x5()
- + {
- + return _Arena5x5;
- + }
- +
- + private boolean _Arena9x9;
- +
- + public void setArena9x9(boolean comm)
- + {
- + _Arena9x9 = comm;
- + }
- +
- + public boolean isArena9x9()
- + {
- + return _Arena9x9;
- + }
- + private boolean _ArenaObserv;
- +
- + public void setArenaObserv(boolean comm)
- + {
- + _ArenaObserv = comm;
- + }
- +
- + public boolean isArenaObserv()
- + {
- + return _ArenaObserv;
- + }
- + private boolean _isStopMov = false;
- + public boolean isStopArena()
- + {
- + return _isStopMov;
- + }
- + //---------
- +
- + public int _originalTitleColorTournament = 0;
- + public String _originalTitleTournament;
- +
- + private boolean _TournamentTeleport;
- +
- + public void setTournamentTeleport(boolean comm)
- + {
- + _TournamentTeleport = comm;
- + }
- +
- + public boolean isTournamentTeleport()
- + {
- + return _TournamentTeleport;
- + }
- +
- + public int duelist_cont = 0,
- + dreadnought_cont = 0,
- + tanker_cont = 0,
- + dagger_cont = 0,
- + archer_cont = 0,
- + bs_cont = 0,
- + archmage_cont = 0,
- + soultaker_cont = 0,
- + mysticMuse_cont = 0,
- + stormScreamer_cont = 0,
- + titan_cont = 0,
- + dominator_cont = 0,
- + grandKhauatari_cont = 0,
- + doomcryer_cont = 0;
- +
- + public int duelist_cont_tournament = 0,
- + dreadnought_cont_tournament = 0,
- + tanker_cont_tournament = 0,
- + dagger_cont_tournament = 0,
- + archer_cont_tournament = 0,
- + bs_cont_tournament = 0,
- + archmage_cont_tournament = 0,
- + soultaker_cont_tournament = 0,
- + mysticMuse_cont_tournament = 0,
- + stormScreamer_cont_tournament = 0,
- + titan_cont_tournament = 0,
- + dominator_cont_tournament = 0;
- +
- +
- + private boolean _OlympiadProtection;
- +
- + public int _player_n = 1;
- +
- + public void setOlympiadProtection(boolean comm)
- + {
- + _OlympiadProtection = comm;
- + }
- +
- + public boolean isOlympiadProtection()
- + {
- + return _OlympiadProtection;
- + }
- +
- + public void setStopArena(boolean value)
- + {
- + _isStopMov = value;
- + }
- /**
- * <B><U> Overridden in </U> :</B><BR>
- * <BR>
- diff --git a/head-src/com/l2jfrozen/gameserver/model/L2Skill.java b/head-src/com/l2jfrozen/gameserver/model/L2Skill.java
- index cf89e89..36f7db9 100644
- --- a/head-src/com/l2jfrozen/gameserver/model/L2Skill.java
- +++ b/head-src/com/l2jfrozen/gameserver/model/L2Skill.java
- @@ -1576,7 +1576,7 @@
- }
- // Check for null target or any other invalid target
- - if (target == null || target.isDead() || target == activeChar && !canTargetSelf)
- + if (target == null || target.isDead() || (target == activeChar && !canTargetSelf) || ((activeChar instanceof L2PcInstance) && !activeChar.isInArenaEvent() && target.isInArenaEvent()))
- {
- return null;
- diff --git a/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java b/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- index 3756755..7498ee2 100644
- --- a/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- +++ b/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- @@ -248,6 +248,7 @@
- import com.l2jfrozen.util.random.Rnd;
- import Dev.SpecialMods.DressMeData;
- +import Dev.Tournament.properties.ArenaConfig;
- /**
- * This class represents all player characters in the world.<br>
- @@ -684,7 +685,29 @@
- sendPacket(ActionFailed.STATIC_PACKET);
- return;
- }
- + if (isArenaProtection() && ((isArena5x5() && ArenaConfig.bs_COUNT_5X5 == 0) || isArena3x3()) && (skill.getSkillType() == SkillType.RESURRECT))
- + {
- + sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + if (isArenaProtection() && !isArena5x5() && !isArena9x9() && ArenaConfig.ARENA_SKILL_LIST.contains(skill.getId()))
- + {
- + sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- +
- + if (isArenaProtection() && ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(skill.getId()))
- + {
- + sendMessage("[Tournament]: Skill disabled in tournament.");
- + return;
- + }
- +
- + if (isInArenaEvent() && !isArenaAttack() && ArenaConfig.ARENA_DISABLE_SKILL_LIST.contains(skill.getId()))
- + {
- + sendMessage("[Tournament]: Wait for the battle to begin");
- + return;
- + }
- super.doCast(skill);
- if (!skill.isOffensive())
- @@ -11858,7 +11881,25 @@
- return false;
- }
- }
- -
- + if (attacker.isInArenaEvent())
- + {
- + L2PcInstance player = null;
- + if (attacker instanceof L2PcInstance)
- + {
- + player = (L2PcInstance) attacker;
- + }
- + else if (attacker instanceof L2Summon)
- + {
- + player = ((L2Summon) attacker).getOwner();
- + }
- + if (player != null)
- + {
- + if (isArenaAttack() && player.isArenaAttack())
- + return true;
- +
- + return false;
- + }
- + }
- if (L2Character.isInsidePeaceZone(attacker, this))
- {
- return false;
- diff --git a/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2TeleporterInstance.java b/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2TeleporterInstance.java
- index 52a05c4..298cba6 100644
- --- a/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2TeleporterInstance.java
- +++ b/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2TeleporterInstance.java
- @@ -37,6 +37,8 @@
- import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
- import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
- +import Dev.Tournament.properties.ArenaTask;
- +
- /**
- * The Class L2TeleporterInstance.
- * @author NightMarez
- @@ -82,7 +84,14 @@
- player.sendMessage("You are not allowed to use a teleport while registered in olympiad game.");
- return;
- }
- -
- + if (player.isArenaProtection())
- + {
- + if (!ArenaTask.is_started())
- + player.setArenaProtection(false);
- + else
- + player.sendMessage("Remove your participation from the Tournament event!");
- + return;
- + }
- if (player.isAio() && !Config.ALLOW_AIO_USE_GK)
- {
- player.sendMessage("Aio Buffers Can't Use Teleports");
- diff --git a/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2TournamentInstance.java b/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2TournamentInstance.java
- new file mode 100644
- index 0000000..60ba666
- --- /dev/null
- +++ b/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2TournamentInstance.java
- @@ -0,0 +1,1250 @@
- +/*
- + * Copyright (C) 2004-2013 L2J Server
- + *
- + * This file is part of L2J Server.
- + *
- + * L2J Server is free software: you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation, either version 3 of the License, or
- + * (at your option) any later version.
- + *
- + * L2J Server is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + * General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package com.l2jfrozen.gameserver.model.actor.instance;
- +
- +import com.l2jfrozen.gameserver.ai.CtrlIntention;
- +import com.l2jfrozen.gameserver.model.L2Effect;
- +import com.l2jfrozen.gameserver.model.L2Party;
- +import com.l2jfrozen.gameserver.model.L2World;
- +import com.l2jfrozen.gameserver.model.base.ClassId;
- +import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
- +import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
- +import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage;
- +import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected;
- +import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
- +import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation;
- +import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
- +
- +import java.util.List;
- +
- +
- +import Dev.Tournament.Arena1x1;
- +import Dev.Tournament.Arena3x3;
- +import Dev.Tournament.Arena5x5;
- +import Dev.Tournament.Arena9x9;
- +import Dev.Tournament.properties.ArenaConfig;
- +
- +public class L2TournamentInstance extends L2FolkInstance
- +{
- + public L2TournamentInstance(int objectId, L2NpcTemplate template)
- + {
- + super(objectId, template);
- + }
- + @Override
- + public void onAction(L2PcInstance player)
- + {
- + if (!canTarget(player))
- + return;
- +
- + player.setLastFolkNPC(this);
- +
- + // Check if the L2PcInstance already target the L2NpcInstance
- + if (this != player.getTarget())
- + {
- + // Set the target of the L2PcInstance player
- + player.setTarget(this);
- +
- + // Send a Server->Client packet MyTargetSelected to the L2PcInstance player
- + MyTargetSelected my = new MyTargetSelected(getObjectId(), 0);
- + player.sendPacket(my);
- + my = null;
- +
- + // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
- + player.sendPacket(new ValidateLocation(this));
- + }
- + else
- + {
- + // Calculate the distance between the L2PcInstance and the L2NpcInstance
- + if (!canInteract(player))
- + {
- + // Notify the L2PcInstance AI with AI_INTENTION_INTERACT
- + player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
- + }
- + else
- + {
- + showMessageWindow(player);
- + }
- + }
- + // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + }
- +
- + public void showMessageWindow(L2PcInstance player)
- + {
- + //player.sendPacket(ActionFailed.STATIC_PACKET);
- + String filename = "data/html/mods/tournament/index.htm";
- + NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- + html.setFile(filename);
- + html.replace("%objectId%", getObjectId());
- +
- + if (Arena1x1.registered.size() == 0)
- + html.replace("%1x1%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena1x1.registered.size() == 1)
- + html.replace("%1x1%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_1_over\" fore=\"L2UI_CH3.calculate1_1\">");
- + else if (Arena1x1.registered.size() == 2)
- + html.replace("%1x1%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_2_over\" fore=\"L2UI_CH3.calculate1_2\">");
- + else if (Arena1x1.registered.size() == 3)
- + html.replace("%1x1%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_3_over\" fore=\"L2UI_CH3.calculate1_3\">");
- + else if (Arena1x1.registered.size() == 4)
- + html.replace("%1x1%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_4_over\" fore=\"L2UI_CH3.calculate1_4\">");
- + else if (Arena1x1.registered.size() == 5)
- + html.replace("%1x1%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_5_over\" fore=\"L2UI_CH3.calculate1_5\">");
- + else if (Arena1x1.registered.size() == 6)
- + html.replace("%1x1%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_6_over\" fore=\"L2UI_CH3.calculate1_6\">");
- + else if (Arena1x1.registered.size() == 7)
- + html.replace("%1x1%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_7_over\" fore=\"L2UI_CH3.calculate1_7\">");
- + else if (Arena1x1.registered.size() == 8)
- + html.replace("%1x1%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_8_over\" fore=\"L2UI_CH3.calculate1_8\">");
- + else if (Arena1x1.registered.size() >= 9)
- + html.replace("%1x1%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_9_over\" fore=\"L2UI_CH3.calculate1_9\">");
- +
- + if (Arena3x3.registered.size() == 0)
- + html.replace("%3x3%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena3x3.registered.size() == 1)
- + html.replace("%3x3%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_1_over\" fore=\"L2UI_CH3.calculate1_1\">");
- + else if (Arena3x3.registered.size() == 2)
- + html.replace("%3x3%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_2_over\" fore=\"L2UI_CH3.calculate1_2\">");
- + else if (Arena3x3.registered.size() == 3)
- + html.replace("%3x3%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_3_over\" fore=\"L2UI_CH3.calculate1_3\">");
- + else if (Arena3x3.registered.size() == 4)
- + html.replace("%3x3%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_4_over\" fore=\"L2UI_CH3.calculate1_4\">");
- + else if (Arena3x3.registered.size() == 5)
- + html.replace("%3x3%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_5_over\" fore=\"L2UI_CH3.calculate1_5\">");
- + else if (Arena3x3.registered.size() == 6)
- + html.replace("%3x3%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_6_over\" fore=\"L2UI_CH3.calculate1_6\">");
- + else if (Arena3x3.registered.size() == 7)
- + html.replace("%3x3%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_7_over\" fore=\"L2UI_CH3.calculate1_7\">");
- + else if (Arena3x3.registered.size() == 8)
- + html.replace("%3x3%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_8_over\" fore=\"L2UI_CH3.calculate1_8\">");
- + else if (Arena3x3.registered.size() >= 9)
- + html.replace("%3x3%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_9_over\" fore=\"L2UI_CH3.calculate1_9\">");
- +
- + if (Arena5x5.registered.size() == 0)
- + html.replace("%5x5%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_0_over\" fore=\"L2UI_CH3.calculate1_0\">");
- + else if (Arena5x5.registered.size() == 1)
- + html.replace("%5x5%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_1_over\" fore=\"L2UI_CH3.calculate1_1\">");
- + else if (Arena5x5.registered.size() == 2)
- + html.replace("%5x5%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_2_over\" fore=\"L2UI_CH3.calculate1_2\">");
- + else if (Arena5x5.registered.size() == 3)
- + html.replace("%5x5%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_3_over\" fore=\"L2UI_CH3.calculate1_3\">");
- + else if (Arena5x5.registered.size() == 4)
- + html.replace("%5x5%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_4_over\" fore=\"L2UI_CH3.calculate1_4\">");
- + else if (Arena5x5.registered.size() == 5)
- + html.replace("%5x5%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_5_over\" fore=\"L2UI_CH3.calculate1_5\">");
- + else if (Arena5x5.registered.size() == 6)
- + html.replace("%5x5%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_6_over\" fore=\"L2UI_CH3.calculate1_6\">");
- + else if (Arena5x5.registered.size() == 7)
- + html.replace("%5x5%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_7_over\" fore=\"L2UI_CH3.calculate1_7\">");
- + else if (Arena5x5.registered.size() == 8)
- + html.replace("%5x5%", "<button value=\"\" action=\"\" width=32 height=32 back=\"L2UI_CH3.calculate1_8_over\" fore=\"L2UI_CH3.calculate1_8\">");
- + else if (Arena5x5.registered.size() >= 9)
- + html.replace("%5x5%", "<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("%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\">");
- +
- + player.sendPacket(html);
- + }
- +
- + @Override
- + public void onBypassFeedback(L2PcInstance player, String command)
- + {
- + if (command.startsWith("1x1"))
- + {
- + if (!ArenaConfig.ALLOW_1X1_REGISTER)
- + {
- + player.sendMessage("Tournament 1x1 is not enabled.");
- + return;
- + }
- +
- + if (player.isArena3x3() || player.isArena5x5() || player.isArena9x9() || player.isArenaProtection())
- + {
- + player.sendMessage("You are already registered in another tournament event.");
- + return;
- + }
- +
- + if (player._active_boxes > 1 && !ArenaConfig.Allow_Same_HWID_On_Tournament)
- + {
- + final List<String> players_in_boxes = player.active_boxes_characters;
- +
- + if (players_in_boxes != null && players_in_boxes.size() > 1)
- + {
- + for (final String character_name : players_in_boxes)
- + {
- + final L2PcInstance ppl = L2World.getInstance().getPlayer(character_name);
- +
- + if (ppl != null && ppl.isArenaProtection())
- + {
- + player.sendMessage("You are already participating in Tournament with another char!");
- + return;
- + }
- + }
- + }
- + }
- +
- + if (ArenaConfig.CHECK_NOBLESS)
- + {
- + if (!player.isNoble())
- + {
- + player.sendMessage("You does not have the necessary requirements.");
- + return;
- + }
- + }
- +
- + if (player.isCursedWeaponEquipped() || player.inObserverMode() || player.isInStoreMode() || player.isAio() || player.getKarma() > 0)
- + {
- + player.sendMessage("You does not have the necessary requirements.");
- + return;
- + }
- +
- + if (player._inEventTvT || player._inEventCTF)
- + {
- + player.sendMessage("Tournament: You already participated in another event!");
- + return;
- + }
- +
- + if (Olympiad.getInstance().isRegistered(player))
- + {
- + player.sendMessage("You is registered in the Olympiad.");
- + return;
- + }
- +
- + if (player.getClassId() == ClassId.shillenElder || player.getClassId() == ClassId.shillienSaint || player.getClassId() == ClassId.bishop || player.getClassId() == ClassId.cardinal || player.getClassId() == ClassId.elder || player.getClassId() == ClassId.evaSaint)
- + {
- + player.sendMessage("Yor class is not allowed in 1x1 game event.");
- + return;
- + }
- +
- + if (Arena1x1.getInstance().register(player))
- + {
- + player.setArena1x1(true);
- + player.setArenaProtection(true);
- + }
- + }
- +
- + if (command.startsWith("3x3"))
- + {
- + if (!ArenaConfig.ALLOW_3X3_REGISTER)
- + {
- + player.sendMessage("Tournament 3x3 is not enabled.");
- + return;
- + }
- +
- + if (player.isArena3x3() || player.isArena5x5() || player.isArena9x9() || player.isArenaProtection())
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return;
- + }
- +
- + if (player._active_boxes > 1 && !ArenaConfig.Allow_Same_HWID_On_Tournament)
- + {
- + final List<String> players_in_boxes = player.active_boxes_characters;
- +
- + if (players_in_boxes != null && players_in_boxes.size() > 1)
- + {
- + for (final String character_name : players_in_boxes)
- + {
- + final L2PcInstance ppl = L2World.getInstance().getPlayer(character_name);
- +
- + if (ppl != null && ppl.isArenaProtection())
- + {
- + player.sendMessage("You are already participating in Tournament with another char!");
- + 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().getMemberCount() < 3)
- + {
- + player.sendMessage("Tournament: Your party does not have 3 members.");
- + player.sendPacket(new ExShowScreenMessage("Your party does not have 3 members", 6 * 1000));
- + return;
- + }
- +
- + if (player.getParty().getMemberCount() > 3)
- + {
- + player.sendMessage("Tournament: Your Party can not have more than 3 members.");
- + player.sendPacket(new ExShowScreenMessage("Your Party can not have more than 3 members", 6 * 1000));
- + return;
- + }
- +
- + L2PcInstance assist1 = player.getParty().getPartyMembers().get(1);
- + L2PcInstance assist2 = player.getParty().getPartyMembers().get(2);
- +
- + if (player.isCursedWeaponEquipped() || assist1.isCursedWeaponEquipped() || assist2.isCursedWeaponEquipped() || player.isInStoreMode() || assist1.isInStoreMode() || assist2.isInStoreMode() || player.getKarma() > 0 || assist1.getKarma() > 0 || assist2.getKarma() > 0)
- + {
- + player.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist1.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist2.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + return;
- + }
- +
- + if (Olympiad.getInstance().isRegistered(player) || Olympiad.getInstance().isRegistered(assist1) || Olympiad.getInstance().isRegistered(assist2))
- + {
- + player.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist1.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist2.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + return;
- + }
- +
- + if (player._inEventTvT || assist1._inEventTvT || assist2._inEventTvT || player._inEventCTF || assist1._inEventCTF || assist2._inEventCTF)
- + {
- + player.sendMessage("Tournament: You already participated in TvT event!");
- + assist1.sendMessage("Tournament: You already participated in TvT event!");
- + assist2.sendMessage("Tournament: You already participated in TvT event!");
- + return;
- + }
- +
- + if (!ArenaConfig.Allow_Same_HWID_On_Tournament)
- + {
- + //String ip1 = player.getHWID();
- + //String ip2 = assist1.getHWID();
- + //String ip3 = assist2.getHWID();
- + String ip1 = player.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip2 = assist1.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip3 = assist2.getClient().getConnection().getInetAddress().getHostAddress();
- +
- +
- + if (ip1.equals(ip2) || ip1.equals(ip3))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist1.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip2.equals(ip1) || ip2.equals(ip3))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist1.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip3.equals(ip1) || ip3.equals(ip2))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist1.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + }
- +
- + if (ArenaConfig.ARENA_SKILL_PROTECT)
- + {
- + for (L2Effect effect : player.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + player.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist1.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist1.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist2.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_STOP_SKILL_LIST.contains(effect.getSkill().getId()))
- + assist2.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : player.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + player.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist1.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist1.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist2.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist2.stopSkillEffects(effect.getSkill().getId());
- + }
- + }
- +
- + if (Arena3x3.getInstance().register(player, assist1, assist2))
- + {
- + player.sendMessage("Tournament: Your participation has been approved.");
- + assist1.sendMessage("Tournament: Your participation has been approved.");
- + assist2.sendMessage("Tournament: Your participation has been approved.");
- + player.setArenaProtection(true);
- + assist1.setArenaProtection(true);
- + assist2.setArenaProtection(true);
- + player.setArena3x3(true);
- + assist1.setArena3x3(true);
- + assist2.setArena3x3(true);
- + showChatWindow(player);
- + }
- + else
- + player.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + }
- +
- + if (command.startsWith("5x5"))
- + {
- + if (!ArenaConfig.ALLOW_5X5_REGISTER)
- + {
- + player.sendMessage("Tournament 5x5 is not enabled.");
- + return;
- + }
- +
- + if (player.isArena3x3() || player.isArena5x5() || player.isArena9x9() || player.isArenaProtection())
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return;
- + }
- +
- + if (player._active_boxes > 1 && !ArenaConfig.Allow_Same_HWID_On_Tournament)
- + {
- + final List<String> players_in_boxes = player.active_boxes_characters;
- +
- + if (players_in_boxes != null && players_in_boxes.size() > 1)
- + {
- + for (final String character_name : players_in_boxes)
- + {
- + final L2PcInstance ppl = L2World.getInstance().getPlayer(character_name);
- +
- + if (ppl != null && ppl.isArenaProtection())
- + {
- + player.sendMessage("You are already participating in Tournament with another char!");
- + 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().getMemberCount() < 5)
- + {
- + player.sendMessage("Tournament: Your party does not have 4 members.");
- + player.sendPacket(new ExShowScreenMessage("Your party does not have 4 members", 6 * 1000));
- + return;
- + }
- +
- + if (player.getParty().getMemberCount() > 5)
- + {
- + 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", 6 * 1000));
- + return;
- + }
- +
- + L2PcInstance assist1 = player.getParty().getPartyMembers().get(1);
- + L2PcInstance assist2 = player.getParty().getPartyMembers().get(2);
- + L2PcInstance assist3 = player.getParty().getPartyMembers().get(3);
- + L2PcInstance assist4 = player.getParty().getPartyMembers().get(4);
- +
- + if (player.isCursedWeaponEquipped() || assist1.isCursedWeaponEquipped() || assist2.isCursedWeaponEquipped() || assist3.isCursedWeaponEquipped() || assist4.isCursedWeaponEquipped() || player.isInStoreMode() || assist1.isInStoreMode() || assist2.isInStoreMode() || assist3.isInStoreMode() || assist4.isInStoreMode() || player.getKarma() > 0 || assist1.getKarma() > 0 || assist2.getKarma() > 0 || assist3.getKarma() > 0 || assist4.getKarma() > 0)
- + {
- + player.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + assist1.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + 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.");
- + assist4.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + return;
- + }
- +
- + if (Olympiad.getInstance().isRegistered(player) || Olympiad.getInstance().isRegistered(assist1) || Olympiad.getInstance().isRegistered(assist2) || Olympiad.getInstance().isRegistered(assist3) || Olympiad.getInstance().isRegistered(assist4))
- + {
- + player.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist1.sendMessage("Tournament: You or your member is registered in the Olympiad.");
- + assist2.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.");
- + return;
- + }
- +
- + if (player._inEventTvT || assist1._inEventTvT || assist2._inEventTvT || assist3._inEventTvT || assist4._inEventTvT || player._inEventCTF || assist1._inEventCTF || assist2._inEventCTF || assist3._inEventCTF || assist4._inEventCTF)
- + {
- + player.sendMessage("Tournament: You already participated in TvT event!");
- + assist1.sendMessage("Tournament: You already participated in TvT event!");
- + assist2.sendMessage("Tournament: You already participated in TvT event!");
- + assist3.sendMessage("Tournament: You already participated in TvT event!");
- + assist4.sendMessage("Tournament: You already participated in TvT event!");
- + return;
- + }
- +
- + if (!ArenaConfig.Allow_Same_HWID_On_Tournament)
- + {
- + //String ip1 = player.getHWID();
- + //String ip2 = assist1.getHWID();
- + //String ip3 = assist2.getHWID();
- + //String ip4 = assist3.getHWID();
- + //String ip5 = assist4.getHWID();
- + String ip1 = player.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip2 = assist1.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip3 = assist2.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip4 = assist3.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip5 = assist4.getClient().getConnection().getInetAddress().getHostAddress();
- +
- + if (ip1.equals(ip2) || ip1.equals(ip3) || ip1.equals(ip4) || ip1.equals(ip5))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist1.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip2.equals(ip1) || ip2.equals(ip3) || ip2.equals(ip4) || ip2.equals(ip5))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist1.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip3.equals(ip1) || ip3.equals(ip2) || ip3.equals(ip4) || ip3.equals(ip5))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist1.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip4.equals(ip1) || ip4.equals(ip2) || ip4.equals(ip3) || ip3.equals(ip5))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist1.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + }
- +
- + for (L2Effect effect : player.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + player.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist1.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist1.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist2.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist2.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist3.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist3.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist4.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist4.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + ClasseCheck(player);
- +
- + if (player.duelist_cont > ArenaConfig.duelist_COUNT_5X5)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.duelist_COUNT_5X5 + " Duelist's or " + ArenaConfig.duelist_COUNT_5X5 + " Grand Khauatari's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.duelist_COUNT_5X5 + " Duelist's or " + ArenaConfig.duelist_COUNT_5X5 + " Grand Khauatari'sallowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.dreadnought_cont > ArenaConfig.dreadnought_COUNT_5X5)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.dreadnought_COUNT_5X5 + " Dread Nought's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.dreadnought_COUNT_5X5 + " Dread Nought's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.tanker_cont > ArenaConfig.tanker_COUNT_5X5)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.tanker_COUNT_5X5 + " Tanker's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.tanker_COUNT_5X5 + " Tanker's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.dagger_cont > ArenaConfig.dagger_COUNT_5X5)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.dagger_COUNT_5X5 + " Dagger's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.dagger_COUNT_5X5 + " Dagger's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.archer_cont > ArenaConfig.archer_COUNT_5X5)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.archer_COUNT_5X5 + " Archer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.archer_COUNT_5X5 + " Archer's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.bs_cont > ArenaConfig.bs_COUNT_5X5)
- + {
- + if (ArenaConfig.bs_COUNT_5X5 == 0)
- + {
- + player.sendMessage("Tournament: Bishop's not allowed in 5x5.");
- + player.sendPacket(new ExShowScreenMessage("Tournament: Bishop's not allowed in 5x5.", 6 * 1000));
- + }
- + else
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.bs_COUNT_5X5 + " Bishop's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.bs_COUNT_5X5 + " Bishop's allowed per party.", 6 * 1000));
- + }
- + clean(player);
- + return;
- + }
- + else if (player.archmage_cont > ArenaConfig.archmage_COUNT_5X5)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.archmage_COUNT_5X5 + " Archmage's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.archmage_COUNT_5X5 + " Archmage's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.soultaker_cont > ArenaConfig.soultaker_COUNT_5X5)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.soultaker_COUNT_5X5 + " Soultaker's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.soultaker_COUNT_5X5 + " Soultaker's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.mysticMuse_cont > ArenaConfig.mysticMuse_COUNT_5X5)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.mysticMuse_COUNT_5X5 + " Mystic Muse's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.mysticMuse_COUNT_5X5 + " Mystic Muse's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.stormScreamer_cont > ArenaConfig.stormScreamer_COUNT_5X5)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.stormScreamer_COUNT_5X5 + " Storm Screamer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.stormScreamer_COUNT_5X5 + " Storm Screamer's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.titan_cont > ArenaConfig.titan_COUNT_5X5)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.titan_COUNT_5X5 + " Titan's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.titan_COUNT_5X5 + " Titan's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.dominator_cont > ArenaConfig.dominator_COUNT_5X5)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.dominator_COUNT_5X5 + " Dominator's or " + ArenaConfig.dominator_COUNT_5X5 + " Doomcryer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.dominator_COUNT_5X5 + " Dominator's or " + ArenaConfig.dominator_COUNT_5X5 + " Doomcryer's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (Arena5x5.getInstance().register(player, assist1, assist2, assist3, assist4) && (player.getParty().getPartyMembers().get(1) != null && player.getParty().getPartyMembers().get(2) != null && player.getParty().getPartyMembers().get(3) != null && player.getParty().getPartyMembers().get(4) != null))
- + {
- + player.sendMessage("Tournament: Your participation has been approved.");
- + assist1.sendMessage("Tournament: Your participation has been approved.");
- + assist2.sendMessage("Tournament: Your participation has been approved.");
- + assist3.sendMessage("Tournament: Your participation has been approved.");
- + assist4.sendMessage("Tournament: Your participation has been approved.");
- +
- + player.setArenaProtection(true);
- + assist1.setArenaProtection(true);
- + assist2.setArenaProtection(true);
- + assist3.setArenaProtection(true);
- + assist4.setArenaProtection(true);
- +
- + player.setArena5x5(true);
- + assist1.setArena5x5(true);
- + assist2.setArena5x5(true);
- + assist3.setArena5x5(true);
- + assist4.setArena5x5(true);
- + clean(player);
- + showChatWindow(player);
- + }
- + else
- + player.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + }
- +
- + if (command.startsWith("9x9"))
- + {
- + if (!ArenaConfig.ALLOW_9X9_REGISTER)
- + {
- + player.sendMessage("Tournament 9x9 is not enabled.");
- + return;
- + }
- +
- + if (player.isArena3x3() || player.isArena5x5() || player.isArena9x9() || player.isArenaProtection())
- + {
- + player.sendMessage("Tournament: You already registered!");
- + return;
- + }
- +
- + if (player._active_boxes > 1 && !ArenaConfig.Allow_Same_HWID_On_Tournament)
- + {
- + final List<String> players_in_boxes = player.active_boxes_characters;
- +
- + if (players_in_boxes != null && players_in_boxes.size() > 1)
- + {
- + for (final String character_name : players_in_boxes)
- + {
- + final L2PcInstance ppl = L2World.getInstance().getPlayer(character_name);
- +
- + if (ppl != null && ppl.isArenaProtection())
- + {
- + player.sendMessage("You are already participating in Tournament with another char!");
- + 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().getMemberCount() < 9)
- + {
- + player.sendMessage("Tournament: Your party does not have 9 members.");
- + player.sendPacket(new ExShowScreenMessage("Your party does not have 9 members", 6 * 1000));
- + return;
- + }
- +
- + if (player.getParty().getMemberCount() > 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", 6 * 1000));
- + return;
- + }
- +
- + L2PcInstance assist = player.getParty().getPartyMembers().get(1);
- + L2PcInstance assist2 = player.getParty().getPartyMembers().get(2);
- + L2PcInstance assist3 = player.getParty().getPartyMembers().get(3);
- + L2PcInstance assist4 = player.getParty().getPartyMembers().get(4);
- + L2PcInstance assist5 = player.getParty().getPartyMembers().get(5);
- + L2PcInstance assist6 = player.getParty().getPartyMembers().get(6);
- + L2PcInstance assist7 = player.getParty().getPartyMembers().get(7);
- + L2PcInstance assist8 = player.getParty().getPartyMembers().get(8);
- +
- + if (player.isCursedWeaponEquipped() || assist.isCursedWeaponEquipped() || assist2.isCursedWeaponEquipped() || assist3.isCursedWeaponEquipped() || assist4.isCursedWeaponEquipped() || assist5.isCursedWeaponEquipped() || assist6.isCursedWeaponEquipped() || assist7.isCursedWeaponEquipped() || assist8.isCursedWeaponEquipped() || player.isInStoreMode() || assist.isInStoreMode() || assist2.isInStoreMode() || assist3.isInStoreMode() || assist4.isInStoreMode() || assist5.isInStoreMode() || assist6.isInStoreMode() || assist7.isInStoreMode() || assist8.isInStoreMode() || player.getKarma() > 0 || assist.getKarma() > 0 || assist2.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.");
- + 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.");
- + 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 (Olympiad.getInstance().isRegistered(player) || Olympiad.getInstance().isRegistered(assist) || Olympiad.getInstance().isRegistered(assist2) || Olympiad.getInstance().isRegistered(assist3) || Olympiad.getInstance().isRegistered(assist4) || Olympiad.getInstance().isRegistered(assist5) || Olympiad.getInstance().isRegistered(assist6) || Olympiad.getInstance().isRegistered(assist7) || Olympiad.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.");
- + assist2.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;
- + }
- +
- + if (player._inEventTvT || assist._inEventTvT || assist2._inEventTvT || assist3._inEventTvT || assist4._inEventTvT || assist5._inEventTvT || assist6._inEventTvT || assist7._inEventTvT || assist8._inEventTvT || player._inEventCTF || assist._inEventCTF || assist2._inEventCTF || assist3._inEventCTF || assist4._inEventCTF || assist5._inEventCTF || assist6._inEventCTF || assist7._inEventCTF || assist8._inEventCTF)
- + {
- + player.sendMessage("Tournament: You already participated in TvT event!");
- + assist.sendMessage("Tournament: You already participated in TvT event!");
- + assist2.sendMessage("Tournament: You already participated in TvT event!");
- + assist3.sendMessage("Tournament: You already participated in TvT event!");
- + assist4.sendMessage("Tournament: You already participated in TvT event!");
- + assist5.sendMessage("Tournament: You already participated in TvT event!");
- + assist6.sendMessage("Tournament: You already participated in TvT event!");
- + assist7.sendMessage("Tournament: You already participated in TvT event!");
- + assist8.sendMessage("Tournament: You already participated in TvT event!");
- + return;
- + }
- +
- + if (!ArenaConfig.Allow_Same_HWID_On_Tournament)
- + {
- + if (player.isInParty() && (player.getParty().getPartyMembers().get(1) != null && player.getParty().getPartyMembers().get(2) != null && player.getParty().getPartyMembers().get(3) != null && player.getParty().getPartyMembers().get(4) != null && player.getParty().getPartyMembers().get(5) != null && player.getParty().getPartyMembers().get(6) != null && player.getParty().getPartyMembers().get(7) != null && player.getParty().getPartyMembers().get(8) != null))
- + {
- + //String ip1 = player.getHWID();
- + //String ip2 = assist.getHWID();
- + //String ip3 = assist2.getHWID();
- + //String ip4 = assist3.getHWID();
- + //String ip5 = assist4.getHWID();
- + //String ip6 = assist5.getHWID();
- + //String ip7 = assist6.getHWID();
- + //String ip8 = assist7.getHWID();
- + //String ip9 = assist8.getHWID();
- + String ip1 = player.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip2 = assist.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip3 = assist2.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip4 = assist3.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip5 = assist4.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip6 = assist5.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip7 = assist6.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip8 = assist7.getClient().getConnection().getInetAddress().getHostAddress();
- + String ip9 = assist8.getClient().getConnection().getInetAddress().getHostAddress();
- +
- + if (ip1.equals(ip2) || ip1.equals(ip3) || ip1.equals(ip4) || ip1.equals(ip5) || ip1.equals(ip6) || ip1.equals(ip7) || ip1.equals(ip8) || ip1.equals(ip9))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + assist5.sendMessage("Tournament: Register only 1 player per Computer");
- + assist6.sendMessage("Tournament: Register only 1 player per Computer");
- + assist7.sendMessage("Tournament: Register only 1 player per Computer");
- + assist8.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip2.equals(ip1) || ip2.equals(ip3) || ip2.equals(ip4) || ip2.equals(ip5) || ip2.equals(ip6) || ip2.equals(ip7) || ip2.equals(ip8) || ip2.equals(ip9))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + assist5.sendMessage("Tournament: Register only 1 player per Computer");
- + assist6.sendMessage("Tournament: Register only 1 player per Computer");
- + assist7.sendMessage("Tournament: Register only 1 player per Computer");
- + assist8.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip3.equals(ip1) || ip3.equals(ip2) || ip3.equals(ip4) || ip3.equals(ip5) || ip3.equals(ip6) || ip3.equals(ip7) || ip3.equals(ip8) || ip3.equals(ip9))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + assist5.sendMessage("Tournament: Register only 1 player per Computer");
- + assist6.sendMessage("Tournament: Register only 1 player per Computer");
- + assist7.sendMessage("Tournament: Register only 1 player per Computer");
- + assist8.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip4.equals(ip1) || ip4.equals(ip2) || ip4.equals(ip3) || ip4.equals(ip5) || ip4.equals(ip6) || ip4.equals(ip7) || ip4.equals(ip8) || ip4.equals(ip9))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + assist5.sendMessage("Tournament: Register only 1 player per Computer");
- + assist6.sendMessage("Tournament: Register only 1 player per Computer");
- + assist7.sendMessage("Tournament: Register only 1 player per Computer");
- + assist8.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip5.equals(ip1) || ip5.equals(ip2) || ip5.equals(ip3) || ip5.equals(ip4) || ip5.equals(ip6) || ip5.equals(ip7) || ip5.equals(ip8) || ip5.equals(ip9))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + assist5.sendMessage("Tournament: Register only 1 player per Computer");
- + assist6.sendMessage("Tournament: Register only 1 player per Computer");
- + assist7.sendMessage("Tournament: Register only 1 player per Computer");
- + assist8.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip6.equals(ip1) || ip6.equals(ip2) || ip6.equals(ip3) || ip6.equals(ip4) || ip6.equals(ip5) || ip6.equals(ip7) || ip6.equals(ip8) || ip6.equals(ip9))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + assist5.sendMessage("Tournament: Register only 1 player per Computer");
- + assist6.sendMessage("Tournament: Register only 1 player per Computer");
- + assist7.sendMessage("Tournament: Register only 1 player per Computer");
- + assist8.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip7.equals(ip1) || ip7.equals(ip2) || ip7.equals(ip3) || ip7.equals(ip4) || ip7.equals(ip5) || ip7.equals(ip6) || ip7.equals(ip8) || ip7.equals(ip9))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + assist5.sendMessage("Tournament: Register only 1 player per Computer");
- + assist6.sendMessage("Tournament: Register only 1 player per Computer");
- + assist7.sendMessage("Tournament: Register only 1 player per Computer");
- + assist8.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip8.equals(ip1) || ip8.equals(ip2) || ip8.equals(ip3) || ip8.equals(ip4) || ip8.equals(ip5) || ip8.equals(ip6) || ip8.equals(ip7) || ip8.equals(ip9))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + assist5.sendMessage("Tournament: Register only 1 player per Computer");
- + assist6.sendMessage("Tournament: Register only 1 player per Computer");
- + assist7.sendMessage("Tournament: Register only 1 player per Computer");
- + assist8.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + else if (ip9.equals(ip1) || ip9.equals(ip2) || ip9.equals(ip3) || ip9.equals(ip4) || ip9.equals(ip5) || ip9.equals(ip6) || ip9.equals(ip7) || ip9.equals(ip8))
- + {
- + player.sendMessage("Tournament: Register only 1 player per Computer");
- + assist.sendMessage("Tournament: Register only 1 player per Computer");
- + assist2.sendMessage("Tournament: Register only 1 player per Computer");
- + assist3.sendMessage("Tournament: Register only 1 player per Computer");
- + assist4.sendMessage("Tournament: Register only 1 player per Computer");
- + assist5.sendMessage("Tournament: Register only 1 player per Computer");
- + assist6.sendMessage("Tournament: Register only 1 player per Computer");
- + assist7.sendMessage("Tournament: Register only 1 player per Computer");
- + assist8.sendMessage("Tournament: Register only 1 player per Computer");
- + return;
- + }
- + }
- + }
- +
- + for (L2Effect effect : player.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + player.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist2.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist2.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist3.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist3.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist4.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist4.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + for (L2Effect effect : assist5.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist5.stopSkillEffects(effect.getSkill().getId());
- + }
- + for (L2Effect effect : assist6.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist6.stopSkillEffects(effect.getSkill().getId());
- + }
- + for (L2Effect effect : assist7.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist7.stopSkillEffects(effect.getSkill().getId());
- + }
- + for (L2Effect effect : assist8.getAllEffects())
- + {
- + if (ArenaConfig.ARENA_DISABLE_SKILL_LIST_PERM.contains(effect.getSkill().getId()))
- + assist8.stopSkillEffects(effect.getSkill().getId());
- + }
- +
- + ClasseCheck(player);
- +
- + if (player.duelist_cont > ArenaConfig.duelist_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.duelist_COUNT_9X9 + " Duelist's or " + ArenaConfig.duelist_COUNT_9X9 + " Grand Khauatari's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.duelist_COUNT_9X9 + " Duelist's or " + ArenaConfig.duelist_COUNT_9X9 + " Grand Khauatari's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.dreadnought_cont > ArenaConfig.dreadnought_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.dreadnought_COUNT_9X9 + " Dread Nought's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.dreadnought_COUNT_9X9 + " Dread Nought's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.tanker_cont > ArenaConfig.tanker_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.tanker_COUNT_9X9 + " Tanker's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.tanker_COUNT_9X9 + " Tanker's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.dagger_cont > ArenaConfig.dagger_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.dagger_COUNT_9X9 + " Dagger's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.dagger_COUNT_9X9 + " Dagger's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.archer_cont > ArenaConfig.archer_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.archer_COUNT_9X9 + " Archer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.archer_COUNT_9X9 + " Archer's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.bs_cont > ArenaConfig.bs_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.bs_COUNT_9X9 + " Bishop's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.bs_COUNT_9X9 + " Bishop's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.archmage_cont > ArenaConfig.archmage_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.archmage_COUNT_9X9 + " Archmage's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.archmage_COUNT_9X9 + " Archmage's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.soultaker_cont > ArenaConfig.soultaker_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.soultaker_COUNT_9X9 + " Soultaker's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.soultaker_COUNT_9X9 + " Soultaker's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.mysticMuse_cont > ArenaConfig.mysticMuse_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.mysticMuse_COUNT_9X9 + " Mystic Muse's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.mysticMuse_COUNT_9X9 + " Mystic Muse's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.stormScreamer_cont > ArenaConfig.stormScreamer_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.stormScreamer_COUNT_9X9 + " Storm Screamer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.stormScreamer_COUNT_9X9 + " Storm Screamer's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.titan_cont > ArenaConfig.titan_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.titan_COUNT_9X9 + " Titan's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.titan_COUNT_9X9 + " Titan's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (player.dominator_cont > ArenaConfig.dominator_COUNT_9X9)
- + {
- + player.sendMessage("Tournament: Only " + ArenaConfig.dominator_COUNT_9X9 + " Dominator's or " + ArenaConfig.dominator_COUNT_9X9 + " Doomcryer's allowed per party.");
- + player.sendPacket(new ExShowScreenMessage("Only " + ArenaConfig.dominator_COUNT_9X9 + " Dominator's or " + ArenaConfig.dominator_COUNT_9X9 + " Doomcryer's allowed per party.", 6 * 1000));
- + clean(player);
- + return;
- + }
- + else if (Arena9x9.getInstance().register(player, assist, assist2, assist3, assist4, assist5, assist6, assist7, assist8) && (player.getParty().getPartyMembers().get(1) != null && player.getParty().getPartyMembers().get(2) != null && player.getParty().getPartyMembers().get(3) != null && player.getParty().getPartyMembers().get(4) != null && player.getParty().getPartyMembers().get(5) != null && player.getParty().getPartyMembers().get(6) != null && player.getParty().getPartyMembers().get(7) != null && player.getParty().getPartyMembers().get(8) != null))
- + {
- + player.sendMessage("Tournament: Your participation has been approved.");
- + assist.sendMessage("Tournament: Your participation has been approved.");
- + assist2.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);
- + assist2.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);
- + assist2.setArena9x9(true);
- + assist3.setArena9x9(true);
- + assist4.setArena9x9(true);
- + assist5.setArena9x9(true);
- + assist6.setArena9x9(true);
- + assist7.setArena9x9(true);
- + assist8.setArena9x9(true);
- + clean(player);
- + showChatWindow(player);
- +
- + }
- + else
- + player.sendMessage("Tournament: You or your member does not have the necessary requirements.");
- + }
- + else if (command.startsWith("remove"))
- + {
- + if (!player.isInParty() && !player.isArena1x1())
- + {
- + player.sendMessage("Tournament: You dont have a party.");
- + return;
- + }
- + else if (player.getParty() != null && !player.getParty().isLeader(player))
- + {
- + player.sendMessage("Tournament: You are not the party leader!");
- + return;
- + }
- +
- + if (player.isArena1x1())
- + Arena1x1.getInstance().remove(player);
- + if (player.isArena3x3())
- + Arena3x3.getInstance().remove(player);
- + if (player.isArena5x5())
- + Arena5x5.getInstance().remove(player);
- + if (player.isArena9x9())
- + Arena9x9.getInstance().remove(player);
- + }
- + else
- + super.onBypassFeedback(player, command);
- + }
- +
- + public void ClasseCheck(L2PcInstance activeChar)
- + {
- + L2Party plparty = activeChar.getParty();
- + for (L2PcInstance player : plparty.getPartyMembers())
- + {
- + if (player != null)
- + {
- + if (player.getParty() != null)
- + {
- + if (player.getClassId() == ClassId.gladiator || player.getClassId() == ClassId.duelist || player.getClassId() == ClassId.grandKhauatari || player.getClassId() == ClassId.tyrant)
- + activeChar.duelist_cont = activeChar.duelist_cont + 1;
- +
- + if (player.getClassId() == ClassId.warlord || player.getClassId() == ClassId.dreadnought)
- + activeChar.dreadnought_cont = activeChar.dreadnought_cont + 1;
- +
- + if (player.getClassId() == ClassId.paladin || player.getClassId() == ClassId.phoenixKnight || player.getClassId() == ClassId.darkAvenger || player.getClassId() == ClassId.hellKnight || player.getClassId() == ClassId.evaTemplar || player.getClassId() == ClassId.templeKnight || player.getClassId() == ClassId.shillienKnight || player.getClassId() == ClassId.shillienTemplar)
- + activeChar.tanker_cont = activeChar.tanker_cont + 1;
- +
- + if (player.getClassId() == ClassId.adventurer || player.getClassId() == ClassId.treasureHunter || player.getClassId() == ClassId.windRider || player.getClassId() == ClassId.plainsWalker || player.getClassId() == ClassId.ghostHunter || player.getClassId() == ClassId.abyssWalker)
- + activeChar.dagger_cont = activeChar.dagger_cont + 1;
- +
- + if (player.getClassId() == ClassId.hawkeye || player.getClassId() == ClassId.sagittarius || player.getClassId() == ClassId.moonlightSentinel || player.getClassId() == ClassId.silverRanger || player.getClassId() == ClassId.ghostSentinel || player.getClassId() == ClassId.phantomRanger)
- + activeChar.archer_cont = activeChar.archer_cont + 1;
- +
- + if (player.getClassId() == ClassId.shillenElder || player.getClassId() == ClassId.shillienSaint || player.getClassId() == ClassId.bishop || player.getClassId() == ClassId.cardinal || player.getClassId() == ClassId.elder || player.getClassId() == ClassId.evaSaint)
- + activeChar.bs_cont = activeChar.bs_cont + 1;
- +
- + if (player.getClassId() == ClassId.archmage || player.getClassId() == ClassId.sorceror)
- + activeChar.archmage_cont = activeChar.archmage_cont + 1;
- +
- + if (player.getClassId() == ClassId.soultaker || player.getClassId() == ClassId.necromancer)
- + activeChar.soultaker_cont = activeChar.soultaker_cont + 1;
- +
- + if (player.getClassId() == ClassId.mysticMuse || player.getClassId() == ClassId.spellsinger)
- + activeChar.mysticMuse_cont = activeChar.mysticMuse_cont + 1;
- +
- + if (player.getClassId() == ClassId.stormScreamer || player.getClassId() == ClassId.spellhowler)
- + activeChar.stormScreamer_cont = activeChar.stormScreamer_cont + 1;
- +
- + if (player.getClassId() == ClassId.titan || player.getClassId() == ClassId.destroyer)
- + activeChar.titan_cont = activeChar.titan_cont + 1;
- +
- + if (player.getClassId() == ClassId.dominator || player.getClassId() == ClassId.overlord || player.getClassId() == ClassId.doomcryer || player.getClassId() == ClassId.warcryer)
- + activeChar.dominator_cont = activeChar.dominator_cont + 1;
- +
- + }
- + }
- + }
- + }
- +
- + public void clean(L2PcInstance 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.grandKhauatari_cont = 0;
- + player.dominator_cont = 0;
- + player.doomcryer_cont = 0;
- + }
- +}
- \ No newline at end of file
- diff --git a/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2VillageMasterInstance.java b/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2VillageMasterInstance.java
- index de9f073..039cad8 100644
- --- a/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2VillageMasterInstance.java
- +++ b/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2VillageMasterInstance.java
- @@ -56,6 +56,8 @@
- import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
- import com.l2jfrozen.gameserver.util.Util;
- +import Dev.Tournament.properties.ArenaTask;
- +
- /**
- * This class ...
- * @version $Revision: 1.4.2.3.2.8 $ $Date: 2009/04/13 02:10:41 $
- @@ -96,7 +98,14 @@
- {
- cmdParams2 = commandStr[2];
- }
- -
- + if (player.isArenaProtection())
- + {
- + if (!ArenaTask.is_started())
- + player.setArenaProtection(false);
- + else
- + player.sendMessage("Remove your participation from the Tournament Event!");
- + return;
- + }
- commandStr = null;
- if (player.isAio() && !Config.ALLOW_AIO_USE_CM)
- {
- diff --git a/head-src/com/l2jfrozen/gameserver/model/zone/L2ZoneType.java b/head-src/com/l2jfrozen/gameserver/model/zone/L2ZoneType.java
- index 4d412ab..8367847 100644
- --- a/head-src/com/l2jfrozen/gameserver/model/zone/L2ZoneType.java
- +++ b/head-src/com/l2jfrozen/gameserver/model/zone/L2ZoneType.java
- @@ -372,7 +372,7 @@
- for (final L2Character character : _characterList.values())
- {
- - if (character instanceof L2PcInstance)
- + if (character instanceof L2PcInstance && !(((L2PcInstance) character).isInsideZone(L2Character.TOURNAMENT) && !((L2PcInstance) character).inObserverMode()) && !((L2PcInstance) character).isArenaProtection() && !((L2PcInstance) character).isArenaObserv())
- character.sendPacket(packet);
- }
- }
- diff --git a/head-src/com/l2jfrozen/gameserver/model/zone/type/L2ArenaEventZone.java b/head-src/com/l2jfrozen/gameserver/model/zone/type/L2ArenaEventZone.java
- new file mode 100644
- index 0000000..2ea0a36
- --- /dev/null
- +++ b/head-src/com/l2jfrozen/gameserver/model/zone/type/L2ArenaEventZone.java
- @@ -0,0 +1,206 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <[url="http://www.gnu.org/licenses/>."]http://www.gnu.org/licenses/>.[/url]
- + */
- +package com.l2jfrozen.gameserver.model.zone.type;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.datatables.SkillTable;
- +import com.l2jfrozen.gameserver.model.L2Character;
- +import com.l2jfrozen.gameserver.model.L2Skill;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2MonsterInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
- +import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +import com.l2jfrozen.util.random.Rnd;
- +
- +import java.util.concurrent.Future;
- +
- +public class L2ArenaEventZone extends L2ZoneType
- +{
- + int _skillId;
- + private int _chance;
- + private int _initialDelay;
- + int _skillLvl;
- + private int _reuse;
- + private boolean _enabled;
- + private String _target;
- + private Future<?> _task;
- +
- + public L2ArenaEventZone(int id)
- + {
- + super(id);
- + _skillId = 1323;
- + _skillLvl = 1;
- + _chance = 100;
- + _initialDelay = 0;
- + _reuse = 30000;
- + _enabled = true;
- + _target = "pc";
- + }
- +
- + @Override
- + public void setParameter(String name, String value)
- + {
- + if (name.equals("skillId"))
- + {
- + _skillId = Integer.parseInt(value);
- + }
- + else if (name.equals("skillLvl"))
- + {
- + _skillLvl = Integer.parseInt(value);
- + }
- + else if (name.equals("chance"))
- + {
- + _chance = Integer.parseInt(value);
- + }
- + else if (name.equals("initialDelay"))
- + {
- + _initialDelay = Integer.parseInt(value);
- + }
- + else if (name.equals("default_enabled"))
- + {
- + _enabled = Boolean.parseBoolean(value);
- + }
- + else if (name.equals("target"))
- + {
- + _target = String.valueOf(value);
- + }
- + else if (name.equals("reuse"))
- + {
- + _reuse = Integer.parseInt(value);
- + }
- + else
- + {
- + super.setParameter(name, value);
- + }
- + }
- + /** The _pvp flag lasts. */
- + private long _pvpFlagLasts;
- +
- + /**
- + * Sets the pvp flag lasts.
- + * @param time the new pvp flag lasts
- + */
- + public void setPvpFlagLasts(final long time)
- + {
- + _pvpFlagLasts = time;
- + }
- + /* Gets the pvp flag lasts.
- + * @return the pvp flag lasts
- + */
- + public long getPvpFlagLasts()
- + {
- + return _pvpFlagLasts;
- + }
- + @Override
- + protected void onEnter(L2Character character)
- + {
- + if (character instanceof L2PcInstance)
- + {
- + character.setInsideZone(L2Character.ARENA_EVENT, true);
- + // Set pvp flag
- + ((L2PcInstance) character).setPvpFlag(1);
- + ((L2PcInstance) character).sendMessage("You are in pvp zone.");
- + ((L2PcInstance) character).broadcastUserInfo();
- + if ((character instanceof L2PlayableInstance && _target.equalsIgnoreCase("pc") || character instanceof L2PcInstance && _target.equalsIgnoreCase("pc_only") || character instanceof L2MonsterInstance && _target.equalsIgnoreCase("npc")) && _task == null)
- + {
- + _task = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new ApplySkill(/* this */), _initialDelay, _reuse);
- + }
- + }
- + }
- +
- + @Override
- + protected void onExit(L2Character character)
- + {
- + if (character instanceof L2PcInstance)
- + {
- + character.setInsideZone(L2Character.ARENA_EVENT, false);
- + setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
- + ((L2PcInstance) character).setPvpFlag(0);
- + ((L2PcInstance) character).sendMessage("You are not in pvp zone, sissy.");
- + ((L2PcInstance) character).broadcastUserInfo();
- + }
- + if (_characterList.isEmpty() && _task != null)
- + {
- + _task.cancel(true);
- + _task = null;
- + }
- + }
- +
- + public L2Skill getSkill()
- + {
- + return SkillTable.getInstance().getInfo(_skillId, _skillLvl);
- + }
- +
- + public String getTargetType()
- + {
- + return _target;
- + }
- +
- + public boolean isEnabled()
- + {
- + return _enabled;
- + }
- +
- + public int getChance()
- + {
- + return _chance;
- + }
- +
- + public void setZoneEnabled(boolean val)
- + {
- + _enabled = val;
- + }
- +
- + class ApplySkill implements Runnable
- + {
- + @Override
- + public void run()
- + {
- + if (isEnabled())
- + {
- + for (L2Character temp : _characterList.values())
- + {
- + if (temp != null && !temp.isDead())
- + {
- + if ((temp instanceof L2PlayableInstance && getTargetType().equalsIgnoreCase("pc") || temp instanceof L2PcInstance && getTargetType().equalsIgnoreCase("pc_only") || temp instanceof L2MonsterInstance && getTargetType().equalsIgnoreCase("npc")) && Rnd.get(100) < getChance())
- + {
- + L2Skill skill = null;
- + if ((skill = getSkill()) == null)
- + {
- + System.out.println("ATTENTION: error on zone with id " + getId());
- + System.out.println("Skill " + _skillId + "," + _skillLvl + " not present between skills");
- + }
- + else
- + skill.getEffects(temp, temp);
- + }
- + }
- + }
- + }
- + }
- + }
- +
- + @Override
- + public void onDieInside(L2Character character)
- + {
- +
- + }
- +
- + @Override
- + public void onReviveInside(L2Character character)
- + {
- +
- + }
- +}
- \ No newline at end of file
- diff --git a/head-src/com/l2jfrozen/gameserver/model/zone/type/L2OlympiadStadiumZone.java b/head-src/com/l2jfrozen/gameserver/model/zone/type/L2OlympiadStadiumZone.java
- index abcbd19..0720174 100644
- --- a/head-src/com/l2jfrozen/gameserver/model/zone/type/L2OlympiadStadiumZone.java
- +++ b/head-src/com/l2jfrozen/gameserver/model/zone/type/L2OlympiadStadiumZone.java
- @@ -54,13 +54,15 @@
- public void onEnter(final L2Character character)
- {
- character.setInsideZone(L2Character.ZONE_PVP, true);
- -
- +
- if (character instanceof L2PcInstance)
- {
- - if ((((L2PcInstance) character).getOlympiadGameId() + 1) == getStadiumId())
- - ((L2PcInstance) character).sendPacket(new SystemMessage(SystemMessageId.ENTERED_COMBAT_ZONE));
- + final L2PcInstance player = character.getActingPlayer();
- +
- + if (player.getOlympiadGameId() + 1 == getStadiumId() || player.isArenaProtection() || player.isGM())
- + player.sendPacket(new SystemMessage(SystemMessageId.ENTERED_COMBAT_ZONE));
- else
- - character.teleToLocation(TeleportWhereType.Town);
- + player.teleToLocation(TeleportWhereType.Town);
- }
- }
- diff --git a/head-src/com/l2jfrozen/gameserver/model/zone/type/L2TournamentZone.java b/head-src/com/l2jfrozen/gameserver/model/zone/type/L2TournamentZone.java
- new file mode 100644
- index 0000000..0da16e7
- --- /dev/null
- +++ b/head-src/com/l2jfrozen/gameserver/model/zone/type/L2TournamentZone.java
- @@ -0,0 +1,90 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package com.l2jfrozen.gameserver.model.zone.type;
- +
- +import com.l2jfrozen.gameserver.model.L2Character;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
- +
- +public class L2TournamentZone extends L2ZoneType
- +{
- + public L2TournamentZone(int id)
- + {
- + super(id);
- + }
- +
- + @Override
- + protected void onEnter(L2Character character)
- + {
- + character.setInsideZone(L2Character.ZONE_PEACE, true);
- + character.setInsideZone(L2Character.TOURNAMENT, true);
- +
- + if (character instanceof L2PcInstance)
- + {
- + final L2PcInstance player = (L2PcInstance) character;
- + player.setTournamentTeleport(true);
- + if (!player.isOlympiadProtection())
- + {
- + player.sendMessage("You have entered a Tournament zone.");
- + //player.getAppearance().setInvisible();
- + player.broadcastUserInfo();
- + }
- +
- + }
- + }
- +
- + @Override
- + protected void onExit(L2Character character)
- + {
- + character.setInsideZone(L2Character.TOURNAMENT, false);
- + character.setInsideZone(L2Character.ZONE_PEACE, false);
- +
- + if (character instanceof L2PcInstance)
- + {
- + final L2PcInstance player = (L2PcInstance) character;
- +
- + if (!player.isArenaProtection() && !player.isOlympiadProtection())
- + {
- + player.setTournamentTeleport(false);
- +
- + if (!player.inObserverMode() && !player.isOlympiadProtection() && !player.isGM())
- + player.getAppearance().setVisible();
- +
- + /*
- + if (!player.inObserverMode())
- + {
- + player._player_n = 1;
- + player.sendMessage("Tournament: You have been removed from the waiting list!");
- + }
- + */
- +
- + player.sendMessage("You left a Tournament zone.");
- + player.broadcastUserInfo();
- + }
- +
- + }
- + }
- +
- + @Override
- + public void onDieInside(L2Character character)
- + {
- + }
- +
- + @Override
- + public void onReviveInside(L2Character character)
- + {
- + }
- +
- +}
- \ No newline at end of file
- diff --git a/head-src/com/l2jfrozen/gameserver/network/L2GameClient.java b/head-src/com/l2jfrozen/gameserver/network/L2GameClient.java
- index 01020bc..3286c24 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/L2GameClient.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/L2GameClient.java
- @@ -71,6 +71,8 @@
- import com.l2jfrozen.util.database.DatabaseUtils;
- import com.l2jfrozen.util.database.L2DatabaseFactory;
- +import Dev.Tournament.properties.ArenaTask;
- +
- /**
- * @author L2JFrozen dev
- */
- @@ -785,6 +787,17 @@
- final L2PcInstance player = L2GameClient.this.getActiveChar();
- if (player != null) // this should only happen on connection loss
- {
- + 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();
- + }
- + }
- if (Config.ENABLE_OLYMPIAD_DISCONNECTION_DEBUG)
- {
- if (player.isInOlympiadMode() || player.inObserverMode())
- @@ -799,6 +812,11 @@
- final String text = "Player " + player.getName() + ", Class:" + player.getClassId() + ", Level:" + player.getLevel() + ", Mode: Observer, Loc: " + player.getX() + " Y:" + player.getY() + " Z:" + player.getZ() + ", Critical?: " + _forcedToClose;
- OlympiadLogger.add(text, "Olympiad_crash_debug");
- }
- + if (player.isInArenaEvent())
- + {
- + //player.increaseArenaDefeats();
- + player.setXYZ(82698, 148638, -3473);
- + }
- else
- {
- final String text = "Player " + player.getName() + ", Class:" + player.getClassId() + ", Level:" + player.getLevel() + ", Mode: Default, Loc: " + player.getX() + " Y:" + player.getY() + " Z:" + player.getZ() + ", Critical?: " + _forcedToClose;
- @@ -914,6 +932,17 @@
- L2PcInstance player = L2GameClient.this.getActiveChar();
- if (player != null) // this should only happen on connection loss
- {
- + 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();
- + }
- + }
- // Olympiad crash DEBUG
- if (Config.ENABLE_OLYMPIAD_DISCONNECTION_DEBUG)
- {
- diff --git a/head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java b/head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java
- index 13436ef..97643ef 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java
- @@ -31,6 +31,8 @@
- import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
- import com.l2jfrozen.gameserver.taskmanager.AttackStanceTaskManager;
- +import Dev.Tournament.properties.ArenaTask;
- +
- public final class Logout extends L2GameClientPacket
- {
- private static Logger LOGGER = Logger.getLogger(Logout.class);
- @@ -55,7 +57,12 @@
- player.sendPacket(ActionFailed.STATIC_PACKET);
- return;
- }
- -
- + if ((player.isInArenaEvent() || player.isArenaProtection()) && ArenaTask.is_started())
- + {
- + player.sendMessage("You cannot logout while in Tournament Event!");
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- if (player.isAway())
- {
- player.sendMessage("You can't restart in Away mode.");
- diff --git a/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java b/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java
- index 7b6d64b..17ab26d 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java
- @@ -63,8 +63,10 @@
- import com.l2jfrozen.gameserver.util.GMAudit;
- import com.l2jfrozen.util.StringUtil;
- import com.l2jfrozen.util.database.L2DatabaseFactory;
- +import com.l2jfrozen.util.random.Rnd;
- import Dev.SpecialMods.DressMeData;
- +import Dev.Tournament.properties.ArenaConfig;
- public final class RequestBypassToServer extends L2GameClientPacket
- {
- @@ -176,6 +178,16 @@
- VoicedBossSpawn.showHtml2(activeChar);
- }
- + else if (_command.startsWith("tele_tournament"))
- + {
- + if (activeChar.isOlympiadProtection())
- + {
- + activeChar.sendMessage("Are you participating in the Olympiad..");
- + return;
- + }
- + activeChar.teleToLocation(ArenaConfig.Tournament_locx + Rnd.get(-100, 100), ArenaConfig.Tournament_locy + Rnd.get(-100, 100), ArenaConfig.Tournament_locz);
- + activeChar.setTournamentTeleport(true);
- + }
- else if (_command.startsWith("returnboss"))
- {
- VoicedBossSpawn.showChatWindow(activeChar);
- diff --git a/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java b/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java
- index 978dec1..b0bc99a 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java
- @@ -40,6 +40,8 @@
- import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
- import com.l2jfrozen.gameserver.taskmanager.AttackStanceTaskManager;
- +import Dev.Tournament.properties.ArenaTask;
- +
- public final class RequestRestart extends L2GameClientPacket
- {
- private static Logger LOGGER = Logger.getLogger(RequestRestart.class);
- @@ -61,7 +63,13 @@
- LOGGER.warn("[RequestRestart] activeChar null!?");
- return;
- }
- -
- + if ((player.isInArenaEvent() || player.isArenaProtection()) && ArenaTask.is_started())
- + {
- + player.sendMessage("You cannot restart while in Tournament Event!");
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + sendPacket(RestartResponse.valueOf(false));
- + return;
- + }
- // Check if player is enchanting
- if (player.getActiveEnchantItem() != null)
- {
- diff --git a/head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java b/head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java
- index bf89edd..41e32ed 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java
- @@ -168,7 +168,11 @@
- return;
- }
- }
- -
- + if (activeChar.isInArenaEvent() && !activeChar.isArenaAttack())
- + {
- + activeChar.sendMessage("Wait for the battle to begin..");
- + return;
- + }
- if (!getClient().getFloodProtectors().getSayAction().tryPerformAction("Say2"))
- {
- activeChar.sendMessage("You cannot speak too fast.");
- diff --git a/head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java b/head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java
- index abe77fc..9e90c97 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java
- @@ -51,6 +51,8 @@
- import com.l2jfrozen.gameserver.templates.L2WeaponType;
- import com.l2jfrozen.gameserver.util.Util;
- +import Dev.Tournament.properties.ArenaConfig;
- +
- public final class UseItem extends L2GameClientPacket
- {
- private static Logger LOGGER = Logger.getLogger(UseItem.class);
- @@ -293,7 +295,15 @@
- {
- LOGGER.debug(activeChar.getObjectId() + ": use item " + _objectId);
- }
- -
- + if (activeChar.isInArenaEvent() || activeChar.isArenaProtection())
- + {
- + if (ArenaConfig.TOURNAMENT_LISTID_RESTRICT.contains(item.getItemId()))
- + {
- + activeChar.sendMessage("You can not use this item during Tournament Event.");
- + activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + }
- if (item.isEquipable())
- {
- // No unequipping/equipping while the player is in special conditions
- diff --git a/head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java b/head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java
- index 7e637b1..2ee48af 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java
- @@ -60,7 +60,7 @@
- final L2PcInstance player = (L2PcInstance) cha;
- _access = player.getAccessLevel();
- _clan = player.getClan();
- - _canTeleport = !((TvT.is_started() && player._inEventTvT) || (DM.is_started() && player._inEventDM) || (CTF.is_started() && player._inEventCTF) || player.isInFunEvent() || player.isPendingRevive());
- + _canTeleport = !((TvT.is_started() && player._inEventTvT) || (DM.is_started() && player._inEventDM) || (CTF.is_started() && player._inEventCTF) || player.isInFunEvent() || player.isPendingRevive() || cha.isInArenaEvent());
- }
- _charObjId = cha.getObjectId();
- _fake = !cha.isDead();
- diff --git a/head-src/com/l2jfrozen/gameserver/network/serverpackets/ExShowScreenMessage.java b/head-src/com/l2jfrozen/gameserver/network/serverpackets/ExShowScreenMessage.java
- index 96df2c9..d000935 100644
- --- a/head-src/com/l2jfrozen/gameserver/network/serverpackets/ExShowScreenMessage.java
- +++ b/head-src/com/l2jfrozen/gameserver/network/serverpackets/ExShowScreenMessage.java
- @@ -1,46 +1,43 @@
- -/*
- - * L2jFrozen Project - www.l2jfrozen.com
- - *
- - * This program is free software: you can redistribute it and/or modify it under
- - * the terms of the GNU General Public License as published by the Free Software
- - * Foundation, either version 3 of the License, or (at your option) any later
- - * version.
- - *
- - * This program is distributed in the hope that it will be useful, but WITHOUT
- - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- - * details.
- - *
- - * You should have received a copy of the GNU General Public License along with
- - * this program. If not, see <http://www.gnu.org/licenses/>.
- - */
- package com.l2jfrozen.gameserver.network.serverpackets;
- /**
- - * @author Kerberos
- + * @author glory to Setekh for IL opcode ;p
- */
- public class ExShowScreenMessage extends L2GameServerPacket
- {
- + public static enum SMPOS
- + {
- + DUMMY,
- + TOP_LEFT,
- + TOP_CENTER,
- + TOP_RIGHT,
- + MIDDLE_LEFT,
- + MIDDLE_CENTER,
- + MIDDLE_RIGHT,
- + BOTTOM_CENTER,
- + BOTTOM_RIGHT,
- + }
- +
- private final int _type;
- private final int _sysMessageId;
- - private final int _unk1;
- + private final boolean _hide;
- private final int _unk2;
- private final int _unk3;
- - private final int _unk4;
- + private final boolean _fade;
- private final int _size;
- private final int _position;
- private final boolean _effect;
- private final String _text;
- private final int _time;
- - public ExShowScreenMessage(final String text, final int time)
- + public ExShowScreenMessage(String text, int time)
- {
- _type = 1;
- _sysMessageId = -1;
- - _unk1 = 0;
- + _hide = false;
- _unk2 = 0;
- _unk3 = 0;
- - _unk4 = 0;
- + _fade = false;
- _position = 0x02;
- _text = text;
- _time = time;
- @@ -48,14 +45,34 @@
- _effect = false;
- }
- - public ExShowScreenMessage(final int type, final int messageId, final int position, final int unk1, final int size, final int unk2, final int unk3, final boolean showEffect, final int time, final int unk4, final String text)
- + public ExShowScreenMessage(String text, int time, SMPOS pos, boolean effect)
- + {
- + this(text, time, pos.ordinal(), effect);
- + }
- +
- + public ExShowScreenMessage(String text, int time, int pos, boolean effect)
- + {
- + _type = 1;
- + _sysMessageId = -1;
- + _hide = false;
- + _unk2 = 0;
- + _unk3 = 0;
- + _fade = false;
- + _position = pos;
- + _text = text;
- + _time = time;
- + _size = 0;
- + _effect = effect;
- + }
- +
- + public ExShowScreenMessage(int type, int messageId, int position, boolean hide, int size, int unk2, int unk3, boolean showEffect, int time, boolean fade, String text)
- {
- _type = type;
- _sysMessageId = messageId;
- - _unk1 = unk1;
- + _hide = hide;
- _unk2 = unk2;
- _unk3 = unk3;
- - _unk4 = unk4;
- + _fade = fade;
- _position = position;
- _text = text;
- _time = time;
- @@ -64,12 +81,6 @@
- }
- @Override
- - public String getType()
- - {
- - return "[S]FE:39 ExShowScreenMessage";
- - }
- -
- - @Override
- protected void writeImpl()
- {
- writeC(0xfe);
- @@ -77,13 +88,22 @@
- writeD(_type); // 0 - system messages, 1 - your defined text
- writeD(_sysMessageId); // system message id (_type must be 0 otherwise no effect)
- writeD(_position); // message position
- - writeD(_unk1); // ?
- + writeD(_hide ? 1 : 0); // hide
- writeD(_size); // font size 0 - normal, 1 - small
- writeD(_unk2); // ?
- writeD(_unk3); // ?
- writeD(_effect ? 1 : 0); // upper effect (0 - disabled, 1 enabled) - _position must be 2 (center) otherwise no effect
- writeD(_time); // time
- - writeD(_unk4); // ?
- + writeD(_fade ? 1 : 0); // fade effect (0 - disabled, 1 enabled)
- writeS(_text); // your text (_type must be 1, otherwise no effect)
- }
- +
- + /* (non-Javadoc)
- + * @see com.l2jfrozen.gameserver.network.serverpackets.L2GameServerPacket#getType()
- + */
- + @Override
- + public String getType()
- + {
- + return "[S]FE:39 ExShowScreenMessage";
- + }
- }
- \ No newline at end of file
Add Comment
Please, Sign In to add comment