Hi everyone i take Random Fight event from frozen and sometimes not teleport in, ppl just walking whit that aura, please help if you can.
/* * 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 . */ package com.l2jfrozen.gameserver.model.entity.event;
/** * @author RnP PC * */ /* * 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 . */
/** * @author lioy * */ public class RandomFight { public static enum State{INACTIVE,REGISTER,LOADING,FIGHT} public static State state = State.INACTIVE;
public static CopyOnWriteArrayList players = new CopyOnWriteArrayList<>();
protected void openRegistrations() { state = State.REGISTER; Announcements.getInstance().announceToAll("Winner reward: " + ItemTable.getInstance().getTemplate(Config.RANDOM_FIGHT_REWARD_ID).getName() + "!"); Announcements.getInstance().announceToAll("Random Fight Event will start in 10 minute."); Announcements.getInstance().announceToAll("To register write ?register"); Announcements.getInstance().announceToAll("If you wanna unregister write ?unregister"); ThreadPoolManager.getInstance().scheduleGeneral(new checkRegist(), 60000 ); }
if(players.size() < 2) { // Announcements.getInstance().announceToAll("Random Fight Event will not start cause of no many partitipations, we are sorry."); // clean(); // return; for(L2PcInstance player : L2World.getInstance().getAllPlayers()) { if(!players.contains(player) && !player.isInOlympiadMode() && !Olympiad.getInstance().isRegistered(player) && !player.isDead() && player.getPrivateStoreType() == L2PcInstance.STORE_PRIVATE_NONE && !player.isProcessingTransaction() && !player.inObserverMode()) players.add(player); } if(players.size() < 2) { Announcements.getInstance().announceToAll("Random Fight Event will not start cause of no many partitipations, we are sorry."); clean(); return; } } Announcements.getInstance().announceToAll("Amount of players Registed: "+players.size()); Announcements.getInstance().announceToAll("2 Random players will be choosen in 30 seconds!"); Announcements.getInstance().announceToAll("If you wanna unregister write ?unregister"); ThreadPoolManager.getInstance().scheduleGeneral(new pickPlayers(), 30000 ); }
protected void pickPlayers() { if(players.size() < 2) { Announcements.getInstance().announceToAll("Random Fight Event aborted because no many partitipations, we are sorry."); clean(); return; }
for(L2PcInstance p : players) if(p.isInOlympiadMode() || Olympiad.getInstance().isRegistered(p)) { players.remove(p); p.sendMessage("You automatically left from event because of your olympiad obligations."); }
Announcements.getInstance().announceToAll("Players selected: "+players.get(0).getName()+" || "+players.get(1).getName()); Announcements.getInstance().announceToAll("Players will be teleported in 15 seconds"); ThreadPoolManager.getInstance().scheduleGeneral(new teleportPlayers(), 15000); }
protected void teleport() { if(players.size() < 2) { Announcements.getInstance().announceToAll("Random Fight Event aborted because no many partitipations, we are sorry."); clean(); return; } Announcements.getInstance().announceToAll("Players teleported!");
if(players.isEmpty() || players.size() < 2) { Announcements.getInstance().announceToAll("One of the players isn't online, event aborted we are sorry!"); clean(); return; }
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
ADENA
500 K = 40e
1kk = 70e
3kk = 190e
ITEMS
staff of life = 150e
karmian set = 90e
elven jewls top D = 30e
Orcish Poleaxe+1 best C pole = 680e
any D grade armor on demand
discord
wiz0642_81242
❖Items that are sent by physical delivery are sent using someone else's data. That is, if you are not able to accept the parcel, we will not be able to return it. Please keep this in mind.
READY IN STOCK
PAYMENT SYSTEMS
4x4 io, Weststein, Paysafecard, Paysend, Genome, Conotoxia, Mybrocard, Payz Silver, Pockit UK, NagaPay, Volet com, SpectroCoin, SwissMoney, Yuh, Lydia / Sumeria, Ka.App, Wittix, Western Union, MyGuava, Xapo Bank, Bunq on emulator (DE, NL, FR, ES, IE ibans), Revolut on emulator (UK/EU), ICard, BlackCatCard, Vivid DE, Bankera, Bitsa, Wise EU/UK, N26 DE/ES on emulator, Skrill, Neteller, Trasta, Wirex, Lama, Paysera, Moneyjar
CRYPTOEXCHANGE
BINGX com, Bybit LVL 2, KuCoin, Binance LVL 2, Mexc, Latoken, Poloniex, Bitmart, Kraken, WhiteBit, Quppy, Nexo, Gate, OKX, Paybis, Paxful, Huobi (HTX), xcoins com, Bit2Me
BUSINESS ACCOUNTS
Stripe, Payoneer EU, Wise Business UK/EU, Revolut Business EU/UK, N26 Business DE, Wallester Business EU, Kraken Business Pro, Monzo Business, Vivid Business, Zen Business EU, Millennium Business PL, AirWallex EU/UK, Finom business, PayPal business, Payset business
NATIONAL BANKS / BANKS
BBVA, CommerzBank, ING, Santander, Kaspi Bank, Sberbank, AlfaBank, Tbank, Raiffeisen, mBank, Paribas, Bereke Bank, Kapital Bank
Question
teamviewer
Hi everyone i take Random Fight event from frozen and sometimes not teleport in, ppl just walking whit that aura, please help if you can.
/*
* 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 .
*/
package com.l2jfrozen.gameserver.model.entity.event;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.datatables.sql.ItemTable;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.entity.Announcements;
import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
import com.l2jfrozen.util.random.Rnd;
/**
* @author RnP PC
*
*/
/*
* 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 .
*/
/**
* @author lioy
*
*/
public class RandomFight
{
public static enum State{INACTIVE,REGISTER,LOADING,FIGHT}
public static State state = State.INACTIVE;
public static CopyOnWriteArrayList players = new CopyOnWriteArrayList<>();
protected void openRegistrations()
{
state = State.REGISTER;
Announcements.getInstance().announceToAll("Winner reward: " + ItemTable.getInstance().getTemplate(Config.RANDOM_FIGHT_REWARD_ID).getName() + "!");
Announcements.getInstance().announceToAll("Random Fight Event will start in 10 minute.");
Announcements.getInstance().announceToAll("To register write ?register");
Announcements.getInstance().announceToAll("If you wanna unregister write ?unregister");
ThreadPoolManager.getInstance().scheduleGeneral(new checkRegist(), 60000 );
}
protected void checkRegistrations()
{
state=State.LOADING;
if(players.size() < 2)
{
// Announcements.getInstance().announceToAll("Random Fight Event will not start cause of no many partitipations, we are sorry.");
// clean();
// return;
for(L2PcInstance player : L2World.getInstance().getAllPlayers())
{
if(!players.contains(player) && !player.isInOlympiadMode() && !Olympiad.getInstance().isRegistered(player) && !player.isDead()
&& player.getPrivateStoreType() == L2PcInstance.STORE_PRIVATE_NONE && !player.isProcessingTransaction() && !player.inObserverMode())
players.add(player);
}
if(players.size() < 2)
{
Announcements.getInstance().announceToAll("Random Fight Event will not start cause of no many partitipations, we are sorry.");
clean();
return;
}
}
Announcements.getInstance().announceToAll("Amount of players Registed: "+players.size());
Announcements.getInstance().announceToAll("2 Random players will be choosen in 30 seconds!");
Announcements.getInstance().announceToAll("If you wanna unregister write ?unregister");
ThreadPoolManager.getInstance().scheduleGeneral(new pickPlayers(), 30000 );
}
protected void pickPlayers()
{
if(players.size() < 2)
{
Announcements.getInstance().announceToAll("Random Fight Event aborted because no many partitipations, we are sorry.");
clean();
return;
}
for(L2PcInstance p : players)
if(p.isInOlympiadMode() || Olympiad.getInstance().isRegistered(p))
{
players.remove(p);
p.sendMessage("You automatically left from event because of your olympiad obligations.");
}
L2PcInstance p1 = players.get(Rnd.get(players.size()));
L2PcInstance p2 = players.get(Rnd.get(players.size()));
while(p1==p2)
p2=players.get(Rnd.get(players.size()));
players.clear();
players.add(p1);
players.add(p2);
Announcements.getInstance().announceToAll("Players selected: "+players.get(0).getName()+" || "+players.get(1).getName());
Announcements.getInstance().announceToAll("Players will be teleported in 15 seconds");
ThreadPoolManager.getInstance().scheduleGeneral(new teleportPlayers(), 15000);
}
protected void teleport()
{
if(players.size() < 2)
{
Announcements.getInstance().announceToAll("Random Fight Event aborted because no many partitipations, we are sorry.");
clean();
return;
}
Announcements.getInstance().announceToAll("Players teleported!");
players.get(0).teleToLocation(113474,15552,3968);
players.get(1).teleToLocation(112990,15489,3968);
players.get(0).setTeam(1);
players.get(1).setTeam(2);
//para,etc
players.get(0).sendMessage("Fight will begin in 15 seconds!");
players.get(1).sendMessage("Fight will begin in 15 seconds!");
ThreadPoolManager.getInstance().scheduleGeneral(new fight(), 15000);
}
protected void startFight()
{
if(players.isEmpty() || players.size() < 2)
{
Announcements.getInstance().announceToAll("One of the players isn't online, event aborted we are sorry!");
clean();
return;
}
state = State.FIGHT;
Announcements.getInstance().announceToAll("FIGHT STARTED!");
try{
for(L2PcInstance p : players){
p.updatePvPFlag(1);
p.sendPacket(new ExShowScreenMessage("Start Fight!",750));
Thread.sleep(750);
p.sendPacket(new ExShowScreenMessage("Kill your enemy!",750));
Thread.sleep(750);
p.sendPacket(new ExShowScreenMessage("Reveiwe reward Top-Grade Life Stone: level 76 ",750));
}
}catch(Exception e){}
ThreadPoolManager.getInstance().scheduleGeneral(new checkLast(), 120000 );
}
protected void lastCheck()
{
if(state == State.FIGHT)
{
if(players.size() 0)
p.setKarma(0);
p.updatePvPFlag(0);
p.broadcastUserInfo();
p.teleToLocation(82698,148638,-3473);
}
}
public static void clean()
{
if(state == State.FIGHT)
for(L2PcInstance p : players)
p.setTeam(0);
players.clear();
state = State.INACTIVE;
}
protected RandomFight()
{
ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Event(), 60000 * Config.EVERY_MINUTES , 60000 * Config.EVERY_MINUTES);
}
public static RandomFight getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder
{
protected static final RandomFight _instance = new RandomFight();
}
protected class Event implements Runnable
{
@Override
public void run()
{
if(state == State.INACTIVE)
openRegistrations();
}
}
protected class checkRegist implements Runnable
{
@Override
public void run()
{
checkRegistrations();
}
}
protected class pickPlayers implements Runnable
{
@Override
public void run()
{
pickPlayers();
}
}
protected class teleportPlayers implements Runnable
{
@Override
public void run()
{
teleport();
}
}
protected class fight implements Runnable
{
@Override
public void run()
{
startFight();
}
}
protected class checkLast implements Runnable
{
@Override
public void run()
{
lastCheck();
}
}
}
That event
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.