Ребята помогите установить в исходинки ластхеро на сборку L2jfrozen
Как скомплировать етот
Скрытый текст// Decompiled by DJ v3.11.11.95 Copyright 2009 Atanas Neshkov Date: 29.08.2011 18:58:41// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: LastHero.java
package scripts.autoevents.lasthero;
import java.io.PrintStream;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.logging.Logger;
import javolution.util.FastList;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.datatables.ItemTable;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.PcInventory;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.entity.TvTEvent;
import net.sf.l2j.gameserver.model.entity.olympiad.Olympiad;
import net.sf.l2j.gameserver.templates.L2Item;
import net.sf.l2j.util.Location;
import net.sf.l2j.util.Rnd;
import scripts.autoevents.basecapture.BaseCapture;
import scripts.autoevents.masspvp.massPvp;
public class LastHero
{
public class WinTask
implements Runnable
{
public void run()
{
if(LastHero._players.size() == 1)
announceWinner((L2PcInstance)LastHero._players.getFirst());
else
ThreadPoolManager.getInstance().scheduleGeneral(new WinTask(), 10000L);
}
final LastHero this$0;
public WinTask()
{
this$0 = LastHero.this;
super();
}
}
public class StartBattle
implements Runnable
{
public void run()
{
L2PcInstance player = null;
javolution.util.FastList.Node n = LastHero._players.head();
javolution.util.FastList.Node endp = LastHero._players.tail();
do
{
if((n = n.getNext()) == endp)
break;
player = (L2PcInstance)n.getValue();
if(player != null && player.isDead())
notifyDeath(player);
} while(true);
n = LastHero._players.head();
endp = LastHero._players.tail();
do
{
if((n = n.getNext()) == endp)
break;
player = (L2PcInstance)n.getValue();
if(player != null)
{
if(Config.FORBIDDEN_EVENT_ITMES)
{
L2ItemInstance arr$[] = player.getInventory().getItems();
int len$ = arr$.length;
for(int i$ = 0; i$ < len$; i$++)
{
L2ItemInstance item = arr$[i$];
if(item != null && item.notForOly())
player.getInventory().unEquipItemInBodySlotAndRecord(item.getItem().getBodyPart(
));
}
}
player.setChannel(6);
player.teleToLocationEvent(LastHero._tpLoc.x + Rnd.get(300), LastHero._tpLoc.y + Rnd.get(300), LastHero._tpLoc.z);
player.stopAllEffects();
player.setCurrentCp(player.getMaxCp());
player.setCurrentHp(player.getMaxHp());
player.setCurrentMp(player.getMaxMp());
player.setPVPArena(true);
player.setTeam(1);
}
} while(true);
player = null;
ThreadPoolManager.getInstance().scheduleGeneral(new WinTask(), 10000L);
System.out.println("EventManager: Last Hero, battle started.");
}
final LastHero this$0;
public StartBattle()
{
this$0 = LastHero.this;
super();
}
}
public class AnnounceTask
implements Runnable
{
public void run()
{
if(LastHero._state != EventState.REG)
return;
long regMin = LastHero._regTime;
for(int i = 0; (long)i < LastHero._regTime; i = (int)((long)i + LastHero._anTime))
try
{
regMin -= LastHero._anTime;
announce("\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F \u043D\u0430 \u0435\u0432\u0435\u043D\u0442 -\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-!");
announce((new StringBuilder()).append("\u0412 \u0425\u0430\u043D\u0442\u0435\u0440 \u0412\u0438\u043B\u043B\u0430\u0434\u0436, \u043E\u0441\u0442\u0430\u043B\u043E\u0441\u044C ").append(regMin / 60000L + 1L).append(" \u043C\u0438\u043D\u0443\u0442.").toString());
if(LastHero._players.isEmpty())
announce("(\u0415\u0449\u0435 \u043D\u0438\u043A\u0442\u043E \u043D\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043B\u0441\u044F \u043D\u0430 \u044D\u0432\u0435\u043D\u0442.)");
else
announce((new StringBuilder()).append("(\u0423\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u043E\u0432: ").append(LastHero._players.size()).append(")").toString());
Thread.sleep(LastHero._anTime);
}
catch(InterruptedException e) { }
announce("\u0417\u0430\u043A\u043E\u043D\u0447\u0435\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F \u043D\u0430 \u0435\u0432\u0435\u043D\u0442 -\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-!");
LastHero._state = EventState.BATTLE;
if(LastHero._players.size() < LastHero._minPlayers)
{
LastHero._state = EventState.WAIT;
announce("\u042D\u0432\u0435\u043D\u0442 -\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439- \u043E\u0442\u043C\u0435\u043D\u0435\u043D, \u043D\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u043E\u0432.");
announce((new StringBuilder()).append("\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u044D\u0432\u0435\u043D\u0442 \u0447\u0435\u0440\u0435\u0437 ").append(LastHero._nextTime / 60000L).append(" \u043C\u0438\u043D\u0443\u0442!").toString());
System.out.println("EventManager: Last Hero, canceled: no players.");
System.out.println((new StringBuilder()).append("EventManager: Last Hero, next start after ").append(LastHero._nextTime / 60000L).append(" min.").toString());
ThreadPoolManager.getInstance().scheduleGeneral(new StartTask(), LastHero._nextTime);
return;
} else
{
announce((new StringBuilder()).append("\u0411\u0438\u0442\u0432\u0430 \u043D\u0430\u0447\u043D\u0435\u0442\u0441\u044F \u0447\u0435\u0440\u0435\u0437 ").append(LastHero._tpDelay / 60000L).append(" \u043C\u0438\u043D\u0443\u0442!").toString());
System.out.println((new StringBuilder()).append("EventManager: Last Hero, battle start after ").append(LastHero._tpDelay / 60000L).append(" min.").toString());
ThreadPoolManager.getInstance().scheduleGeneral(new StartBattle(), LastHero._tpDelay);
return;
}
}
final LastHero this$0;
public AnnounceTask()
{
this$0 = LastHero.this;
super();
}
}
public class StartTask
implements Runnable
{
public void run()
{
if(LastHero._state == EventState.WAIT)
startEvent();
}
final LastHero this$0;
public StartTask()
{
this$0 = LastHero.this;
super();
}
}
static final class EventState extends Enum
{
public static EventState[] values()
{
return (EventState[])$VALUES.clone();
}
public static EventState valueOf(String name)
{
return (EventState)Enum.valueOf(scripts/autoevents/lasthero/LastHero$EventState, name);
}
public static final EventState WAIT;
public static final EventState REG;
public static final EventState BATTLE;
private static final EventState $VALUES[];
static
{
WAIT = new EventState("WAIT", 0);
REG = new EventState("REG", 1);
BATTLE = new EventState("BATTLE", 2);
$VALUES = (new EventState[] {
WAIT, REG, BATTLE
});
}
private EventState(String s, int i)
{
super(s, i);
}
}
public LastHero()
{
}
public static void init()
{
_event = new LastHero();
_event.load();
}
public static LastHero getEvent()
{
return _event;
}
public void load()
{
checkTimer();
}
public void checkTimer()
{
ThreadPoolManager.getInstance().scheduleGeneral(new StartTask(), _arRestart);
System.out.println((new StringBuilder()).append("EventManager: Last Hero, start after ").append(_arRestart / 60000L).append(" min.").toString());
}
private void startEvent()
{
_state = EventState.REG;
announce("\u0421\u0442\u0430\u0440\u0442\u043E\u0432\u0430\u043B \u0435\u0432\u0435\u043D\u0442 -\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-!");
announce((new StringBuilder()).append("\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F \u0432 \u0425\u0430\u043D\u0442\u0435\u0440 \u0412\u0438\u043B\u043B\u0430\u0434\u0436 \u043D\u0430 ").append(_regTime / 60000L + 1L).append(" \u043C\u0438\u043D\u0443\u0442.").toString());
System.out.println("EventManager: Last Hero, registration opened.");
_ips.clear();
_players.clear();
ThreadPoolManager.getInstance().scheduleGeneral(new AnnounceTask(), _anTime);
}
public void announceWinner(L2PcInstance player)
{
_state = EventState.WAIT;
announce("\u042D\u0432\u0435\u043D\u0442 -\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439- \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D!");
announce((new StringBuilder()).append("\u041F\u043E\u0431\u0435\u0434\u0438\u0442\u0435\u043B\u044C: ").append(player.getName()).append("!").toString());
announce((new StringBuilder()).append("\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u044D\u0432\u0435\u043D\u0442 \u0447\u0435\u0440\u0435\u0437 ").append(_nextTime / 60000L).append(" \u043C\u0438\u043D\u0443\u0442!").toString());
System.out.println((new StringBuilder()).append("EventManager: Last Hero, finished; palyer ").append(player.getName()).append(" win.").toString());
System.out.println((new StringBuilder()).append("EventManager: Last Hero, next start after ").append(_nextTime / 60000L).append(" min.").toString());
ThreadPoolManager.getInstance().scheduleGeneral(new StartTask(), _nextTime);
if(!player.isHero())
player.setHero(Config.ELH_HERO_DAYS);
player.setPVPArena(false);
javolution.util.FastList.Node k = _rewards.head();
javolution.util.FastList.Node endk = _rewards.tail();
do
{
if((k = k.getNext()) == endk)
break;
net.sf.l2j.Config.EventReward reward = (net.sf.l2j.Config.EventReward)k.getValue();
if(reward != null && Rnd.get(100) < reward.chance)
{
L2ItemInstance rewItem = ItemTable.getInstance().createItem("LastHero", reward.id, reward.count, player, null);
player.getInventory().addItem("LastHero", rewItem, player, null);
}
} while(true);
player.teleToLocation(0x14331, 0x2445b, -3470);
player.setChannel(1);
}
private boolean foundIp(String ip)
{
return _ips.contains(ip);
}
public void regPlayer(L2PcInstance player)
{
if(_state != EventState.REG)
{
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F \u0435\u0449\u0435 \u043D\u0435 \u043E\u0431\u044C\u044F\u0432\u043B\u044F\u043B\u0430\u0441\u044C<br1> \u041F\u0440\u0438\u0445\u043E\u0434\u0438\u0442\u0435 \u043F\u043E\u0437\u0436\u0435 .");
return;
}
if(!TvTEvent.isInactive() && TvTEvent.isPlayerParticipant(player.getName()))
{
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0412\u044B \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D\u044B \u043D\u0430 TvT.");
return;
}
if(Config.MASS_PVP && massPvp.getEvent().isReg(player))
{
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0423\u0434\u0430\u0447\u0438 \u043D\u0430 \u0435\u0432\u0435\u043D\u0442\u0435 -\u041C\u0430\u0441\u0441 \u041F\u0412\u041F-");
return;
}
if(Config.EBC_ENABLE && BaseCapture.getEvent().isRegged(player))
{
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0423\u0434\u0430\u0447\u0438 \u043D\u0430 \u0435\u0432\u0435\u043D\u0442\u0435 -\u0417\u0430\u0445\u0432\u0430\u0442 \u0431\u0430\u0437\u044B-");
return;
}
if(Olympiad.isRegisteredInComp(player) || player.isInOlympiadMode())
{
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0412\u044B \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D\u044B \u043D\u0430 \u043E\u043B\u0438\u043C\u043F\u0438\u0430\u0434\u0435.");
return;
}
if(player.isCursedWeaponEquiped())
{
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0421 \u043F\u0440\u043E\u043A\u043B\u044F\u0442\u044B\u043C \u043E\u0440\u0443\u0436\u0438\u0435\u043C \u043D\u0435\u043B\u044C\u0437\u044F.");
return;
}
if(_players.size() >= _maxPlayers)
{
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0414\u043E\u0441\u0442\u0438\u0433\u043D\u0443\u0442 \u043F\u0440\u0435\u0434\u0435\u043B \u0438\u0433\u0440\u043E\u043A\u043E\u0432.");
return;
}
if(_players.contains(player))
{
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0412\u044B \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D\u044B.");
return;
}
if(!Config.EVENTS_SAME_IP && foundIp(player.getIP()))
{
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0421 \u0432\u0430\u0448\u0435\u0433\u043E IP \u0443\u0436\u0435 \u0435\u0441\u0442\u044C \u0438\u0433\u0440\u043E\u043A.");
return;
}
if(_ticketId > 0)
{
L2ItemInstance coin = player.getInventory().getItemByItemId(_ticketId);
if(coin == null || coin.getCount() < _ticketCount)
{
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0423\u0447\u0430\u0441\u0442\u0438\u0432 \u0432 \u0438\u0432\u0435\u043D\u0442\u0435 \u043F\u043B\u0430\u0442\u043D\u043E\u0435.");
return;
}
player.destroyItemByItemId("lasthero", _ticketId, _ticketCount, player, true);
}
_players.add(player);
if(!Config.EVENTS_SAME_IP)
_ips.add(player.getIP());
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0430.");
}
public void delPlayer(L2PcInstance player)
{
if(!_players.contains(player))
{
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0412\u044B \u043D\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D\u044B.");
return;
}
_players.remove(_players.indexOf(player));
if(!Config.EVENTS_SAME_IP)
_ips.remove(player.getIP());
player.sendHtmlMessage("-\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0433\u0435\u0440\u043E\u0439-", "\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F \u043E\u0442\u043C\u0435\u043D\u0435\u043D\u0430.");
}
public void notifyFail(L2PcInstance player)
{
if(_state == EventState.WAIT)
return;
if(_players.contains(player))
{
_players.remove(_players.indexOf(player));
if(!Config.EVENTS_SAME_IP)
_ips.remove(player.getIP());
player.setChannel(1);
player.setXYZ(0x14331, 0x2445b, -3470);
player.setPVPArena(false);
}
}
public void notifyDeath(L2PcInstance player)
{
if(_state == EventState.WAIT)
return;
if(_players.contains(player))
{
_players.remove(_players.indexOf(player));
if(!Config.EVENTS_SAME_IP)
_ips.remove(player.getIP());
player.sendCritMessage("\u0412\u044B \u043F\u0440\u043E\u0438\u0433\u0440\u0430\u043B\u0438...");
try
{
player.teleToLocationEvent(0x14331, 0x2445b, -3470);
}
catch(Exception e) { }
player.setChannel(1);
player.doRevive();
player.setCurrentHp(player.getMaxHp());
player.setCurrentMp(player.getMaxMp());
player.setCurrentCp(player.getMaxCp());
player.setPVPArena(false);
player.setTeam(0);
}
}
public boolean isRegged(L2PcInstance player)
{
if(_state == EventState.WAIT)
return false;
return _players.contains(player);
}
private void announce(String text)
{
Announcements.getInstance().announceToAll(text);
}
public boolean isInBattle()
{
return _state == EventState.BATTLE;
}
protected static final Logger _log = Logger.getLogger(scripts/autoevents/lasthero/LastHero.getName());
private static final long _arRestart;
private static final long _regTime;
private static final long _anTime;
private static final long _tpDelay;
private static final long _nextTime;
private static final int _minLvl;
private static final int _minPlayers;
private static final int _maxPlayers;
private static Location _tpLoc;
private static final int _ticketId;
private static final int _ticketCount;
private static FastList _players = new FastList();
private static FastList _rewards;
private static ConcurrentLinkedQueue _ips = new ConcurrentLinkedQueue();
private static EventState _state;
private static LastHero _event;
static
{
_arRestart = Config.ELH_ARTIME * 60000L;
_regTime = Config.ELH_REGTIME * 60000L;
_anTime = Config.ELH_ANNDELAY * 60000L;
_tpDelay = Config.ELH_TPDELAY * 60000L;
_nextTime = Config.ELH_NEXT * 60000L;
_minLvl = Config.ELH_MINLVL;
_minPlayers = Config.ELH_MINP;
_maxPlayers = Config.ELH_MAXP;
_tpLoc = Config.ELH_TPLOC;
_ticketId = Config.ELH_TICKETID;
_ticketCount = Config.ELH_TICKETCOUNT;
_rewards = Config.ELH_REWARDS;
_state = EventState.WAIT;
}
}
или какой прогой