Авторизация
Подписчики
0
Hall Of Fame
Описание
Зал Славы
package ru.la2betdream.gameserver.instancemanager;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;import javolution.util.FastMap;import ru.la2betdream.L2DatabaseFactory;import ru.la2betdream.gameserver.model.L2World;import ru.la2betdream.gameserver.model.actor.L2Npc;import ru.la2betdream.gameserver.model.actor.instance.L2PcInstance;import ru.la2betdream.gameserver.model.quest.Quest;import ru.la2betdream.gameserver.model.quest.QuestState;public final class HallOfFame extends Quest{private final static int NpcId = 1234;String noob;int num = 0;private HallOfFame(int questId, String name, String descr){super(questId, name, descr);addStartNpc(NpcId);addTalkId(NpcId);get();}@Overridepublic final String onAdvEvent(String event, L2Npc npc, L2PcInstance player){QuestState st = player.getQuestState("HallOfFame");if (st == null){return "";}else if (event.equalsIgnoreCase("show")){StringBuilder sb = new StringBuilder();sb.append("");sb.append("");// sb.append("Current Event: 1vs1 ");sb.append("");sb.append("");sb.append("HallOfFame" + "");sb.append("Hello " + player.getName() + "");sb.append("");sb.append("");sb.append("");sb.append("");sb.append("");sb.append("");sb.append("");sb.append("");sb.append("sb.append("");return sb.toString();}else if (event.equalsIgnoreCase("addme")){StringBuilder sb = new StringBuilder();if (player.getPvpKills() >= 1000){sb.append("");sb.append("You have been added to the list");}else{sb.append("");sb.append("You dont meet the criteria");}return sb.toString();}else if (event.equalsIgnoreCase("showlist")){StringBuilder sb = new StringBuilder();sb.append("");sb.append("");sb.append("Num.NameStatus" + noob + "");return sb.toString();}else if (event.equalsIgnoreCase("moreinfo")){StringBuilder sb = new StringBuilder();sb.append("");sb.append("Info");return sb.toString();}return event;}public FastMap get(){try{Connection con = L2DatabaseFactory.getInstance().getConnection();String sql = "SELECT char_name FROM characters WHERE famer=?";PreparedStatement statement = con.prepareStatement(sql);statement.setInt(1, 1);ResultSet rset = statement.executeQuery();while (rset.next()){boolean status = false;for (L2PcInstance n00b : L2World.getInstance().getAllPlayersArray()){if (n00b.getName().equals(rset.getString("char_name"))){status = true;}}num++;noob += "" + num + "" + rset.getString("char_name") + "";if (status){noob += "Online";}else{noob += "Offline";}}rset.close();}catch (Exception e){}return null;}@SuppressWarnings("synthetic-access")public static HallOfFame getInstance(){return SingletonHolder._instance;}private static class SingletonHolder{@SuppressWarnings("synthetic-access")private static final HallOfFame _instance = new HallOfFame(-1, "HallOfFame", "instances");}}
Рекомендуемые комментарии
Комментариев нет