Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2J_Server_BETA
- Index: java/com/l2jserver/gameserver/model/entity/Ranks.java
- ===================================================================
- --- java/com/l2jserver/gameserver/model/entity/Ranks.java (revision 0)
- +++ java/com/l2jserver/gameserver/model/entity/Ranks.java (revision 0)
- @@ -0,0 +1,46 @@
- +/*
- + * 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.l2jserver.gameserver.model.entity;
- +
- +/**
- + * @author Marwan
- + */
- +public enum Ranks
- +{
- + Rank("Ranked", 100),
- + Rank2("Unranked", 0);
- + private final String rank;
- + private final int pts;
- +
- + Ranks(String r, int p)
- + {
- + rank = r;
- + pts = p;
- + }
- +
- + public String getRank()
- + {
- + return rank;
- + }
- +
- + public int getRankPts()
- + {
- + return pts;
- + }
- +}
- Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 5757)
- +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -167,6 +167,8 @@
- import com.l2jserver.gameserver.model.entity.Hero;
- import com.l2jserver.gameserver.model.entity.Instance;
- import com.l2jserver.gameserver.model.entity.L2Event;
- +import com.l2jserver.gameserver.model.entity.LeagueOfElo;
- +import com.l2jserver.gameserver.model.entity.Ranks;
- import com.l2jserver.gameserver.model.entity.Siege;
- import com.l2jserver.gameserver.model.entity.TvTEvent;
- import com.l2jserver.gameserver.model.fishing.L2Fish;
- @@ -306,6 +308,38 @@
- */
- public final class L2PcInstance extends L2Playable
- {
- + String rank = "Unranked";
- +
- + public void setRank(String ranks)
- + {
- + rank = ranks;
- + }
- +
- + public String getRank()
- + {
- +
- + return rank;
- + }
- +
- + int rankpts;
- +
- + public void SetRankPts(int i)
- + {
- + rankpts = i;
- + for (Ranks r : Ranks.values())
- + {
- + if (this.getRankPts() >= r.getRankPts())
- + {
- + this.setRank(r.getRank());
- + }
- + }
- + }
- +
- + public int getRankPts()
- + {
- + return rankpts;
- + }
- +
- // Character Skill SQL String Definitions:
- private static final String RESTORE_SKILLS_FOR_CHAR = "SELECT skill_id,skill_level FROM character_skills WHERE charId=? AND class_index=?";
- private static final String ADD_NEW_SKILL = "INSERT INTO character_skills (charId,skill_id,skill_level,class_index) VALUES (?,?,?,?)";
- @@ -325,8 +359,8 @@
- // Character Character SQL String Definitions:
- private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,createDate) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
- - private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=? WHERE charId=?";
- - private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createDate,language FROM characters WHERE charId=?";
- + private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=?,rank=? WHERE charId=?";
- + private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createDate,language,rank FROM characters WHERE charId=?";
- // Character Teleport Bookmark:
- private static final String INSERT_TP_BOOKMARK = "INSERT INTO character_tpbookmark (charId,Id,x,y,z,icon,tag,name) values (?,?,?,?,?,?,?,?)";
- @@ -5810,10 +5844,41 @@
- * attacker and Karam loss for the killed L2PcInstance</li> <li>If the killed L2PcInstance has Karma, manage Drop Item</li> <li>Kill the L2PcInstance</li>
- * @param killer
- */
- + boolean blue = false;
- + boolean red = false;
- +
- + public void setBlue(boolean h)
- + {
- + blue = h;
- + }
- +
- + public boolean isBlue()
- + {
- + return blue;
- + }
- +
- + public void setRed(boolean h)
- + {
- + red = h;
- + }
- +
- + public boolean isRed()
- + {
- + return red;
- + }
- +
- @Override
- public boolean doDie(L2Character killer)
- {
- // Kill the L2PcInstance
- +
- + // Kill the L2PcInstance
- + if (isRed() || isBlue())
- + {
- + sendMessage("You will be respawned in 1 minute");
- + LeagueOfElo.res(this);
- + }
- +
- if (!super.doDie(killer))
- {
- return false;
- @@ -6220,6 +6285,14 @@
- */
- public void increasePvpKills(L2Character target)
- {
- + if (isRed())
- + {
- + LeagueOfElo.redpts += 1;
- + }
- + if (isBlue())
- + {
- + LeagueOfElo.bluepts += 1;
- + }
- if ((target instanceof L2PcInstance) && AntiFeedManager.getInstance().check(this, target))
- {
- // Add karma to attacker and increase its PK counter
- @@ -7715,7 +7788,11 @@
- player = new L2PcInstance(objectId, template, rset.getString("account_name"), app);
- player.setName(rset.getString("char_name"));
- player._lastAccess = rset.getLong("lastAccess");
- + player.setRank(rset.getString("rank"));
- player.getStat().setExp(rset.getLong("exp"));
- player.setExpBeforeDeath(rset.getLong("expBeforeDeath"));
- player.getStat().setLevel(rset.getByte("level"));
- @@ -8241,6 +8318,8 @@
- store(true);
- }
- + public static int wins, loses = 0;
- +
- private void storeCharBase()
- {
- try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- @@ -8313,7 +8392,10 @@
- statement.setInt(50, getBookMarkSlot());
- statement.setInt(51, getVitalityPoints());
- statement.setString(52, getLang());
- - statement.setInt(53, getObjectId());
- + statement.setString(53, getRank());
- + statement.setInt(54, wins);
- + statement.setInt(55, loses);
- + statement.setInt(54, getObjectId());
- statement.execute();
- statement.close();
- @@ -11883,6 +11965,7 @@
- public void onActionRequest()
- {
- +
- if (isSpawnProtected())
- {
- sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS);
- Index: java/com/l2jserver/gameserver/model/entity/LeagueOfElo.java
- ===================================================================
- --- java/com/l2jserver/gameserver/model/entity/LeagueOfElo.java (revision 0)
- +++ java/com/l2jserver/gameserver/model/entity/LeagueOfElo.java (revision 0)
- @@ -0,0 +1,290 @@
- +/* 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package com.l2jserver.gameserver.model.entity;
- +
- +import java.util.Vector;
- +
- +import javolution.util.FastList;
- +
- +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
- +
- +/**
- + * @author Marwan
- + */
- +public class LeagueOfElo
- +{
- + @SuppressWarnings("unused")
- + public static FastList<L2PcInstance> vs5, svs5 = new FastList<L2PcInstance>();
- + public static FastList<L2PcInstance> sfiver, sfiveb = new FastList<L2PcInstance>();
- + public static FastList<L2PcInstance> fiver, fiveb = new FastList<L2PcInstance>();
- + public static Vector<L2PcInstance> team1, team2 = new Vector<L2PcInstance>();
- + public static int redpts, bluepts = 0;
- + public static int blue, red;
- +
- + public static void Team5v5()
- + {
- + int redpts = 0, bluepts = 0;
- + if (vs5.size() == 10)
- + {
- +
- + boolean AddRed = true;
- + for (L2PcInstance a : vs5)
- + {
- + if (AddRed == true)
- + {
- + // add to red
- + fiver.add(a);
- + }
- + else
- + {
- + // add to blue
- + fiveb.add(a);
- + }
- + AddRed = !AddRed;
- + }
- +
- + for (L2PcInstance redp : fiver)
- + {
- + redp.getAppearance().setNameColor(255, 0, 0);
- + redp.sendMessage("Youre in red team");
- + redp.teleToLocation(147771, 46712, -3411);
- + redp.setRed(true);
- + }
- + for (L2PcInstance bluep : fiveb)
- + {
- + bluep.getAppearance().setNameColor(0, 0, 255);
- + bluep.sendMessage("Youre in blue team");
- + bluep.teleToLocation(151248, 46721, -3406);
- + bluep.setBlue(true);
- + }
- + wait(10);
- + if (redpts > bluepts)
- + {
- + for (L2PcInstance k : fiver)
- + {
- + k.sendMessage("You won");
- + k.SetRankPts(k.getRankPts() + 15);
- + }
- + for (L2PcInstance k : fiveb)
- + {
- + k.sendMessage("You lost");
- + k.SetRankPts(k.getRankPts() - 15);
- + }
- + }
- + else if (bluepts > redpts)
- + {
- + for (L2PcInstance k : fiver)
- + {
- + k.sendMessage("You lost");
- + k.SetRankPts(k.getRankPts() - 15);
- + }
- + for (L2PcInstance k : fiveb)
- + {
- + k.sendMessage("You won");
- + k.SetRankPts(k.getRankPts() + 15);
- + }
- + }
- + else if (bluepts == redpts)
- + {
- + for (L2PcInstance k : fiver)
- + {
- + k.sendMessage("You won");
- + k.SetRankPts(k.getRankPts() + 5);
- + }
- + for (L2PcInstance k : fiveb)
- + {
- + k.sendMessage("Match end in tie");
- + k.SetRankPts(k.getRankPts() + 5);
- + }
- + }
- + }
- + }
- +
- + public static void Solo5vs5()
- + {
- +
- + if (svs5.size() == 2)
- + {
- +
- + boolean AddRed = true;
- + for (L2PcInstance a : svs5)
- + {
- + if (AddRed == true)
- + {
- + // add to red
- + sfiver.add(a);
- + }
- + else
- + {
- + // add to blue
- + sfiveb.add(a);
- + }
- + AddRed = !AddRed;
- + }
- +
- + for (L2PcInstance redp : sfiver)
- + {
- + redp.getAppearance().setNameColor(255, 0, 0);
- + redp.sendMessage("Youre in red team");
- + redp.teleToLocation(147771, 46712, -3411);
- + redp.setRed(true);
- + }
- + for (L2PcInstance bluep : sfiveb)
- + {
- + bluep.getAppearance().setNameColor(0, 0, 255);
- + bluep.sendMessage("Youre in blue team");
- + bluep.teleToLocation(151248, 46721, -3406);
- + bluep.setBlue(true);
- + }
- + wait(10);
- + if (redpts > bluepts)
- + {
- + for (L2PcInstance k : sfiver)
- + {
- + k.sendMessage("You won");
- + k.SetRankPts(k.getRankPts() + 15);
- + }
- + for (L2PcInstance k : sfiveb)
- + {
- + k.sendMessage("You lost");
- + k.SetRankPts(k.getRankPts() - 15);
- + }
- + }
- + else if (bluepts > redpts)
- + {
- + for (L2PcInstance k : sfiver)
- + {
- + k.sendMessage("You lost");
- + k.SetRankPts(k.getRankPts() - 15);
- + }
- + for (L2PcInstance k : sfiveb)
- + {
- + k.sendMessage("You won");
- + k.SetRankPts(k.getRankPts() + 15);
- + }
- + }
- + else if (bluepts == redpts)
- + {
- + for (L2PcInstance k : sfiver)
- + {
- + k.sendMessage("You won");
- + k.SetRankPts(k.getRankPts() + 5);
- + }
- + for (L2PcInstance k : sfiveb)
- + {
- + k.sendMessage("Match end in tie");
- + k.SetRankPts(k.getRankPts() + 5);
- + }
- + }
- +
- + }
- + }
- +
- + public static void svs5reg(L2PcInstance p)
- + {
- + svs5.add(p);
- + }
- +
- + public static void res(L2PcInstance a)
- + {
- + wait(1);
- + a.doRevive();
- + }
- +
- +
- + public static void wait(int i)
- + {
- + try
- + {
- + Thread.sleep(i * 60000);
- + }
- + catch (InterruptedException ie)
- + {
- + ie.printStackTrace();
- + }
- + }
- +
- +}
- \ No newline at end of file
- ### Eclipse Workspace Patch 1.0
- #P L2J_Server_BETA2
- Index: java/com/l2jserver/gameserver/model/actor/instance/L2LeagueInstance.java
- ===================================================================
- --- java/com/l2jserver/gameserver/model/actor/instance/L2LeagueInstance.java (revision 0)
- +++ java/com/l2jserver/gameserver/model/actor/instance/L2LeagueInstance.java (revision 0)
- @@ -0,0 +1,310 @@
- +package com.l2jserver.gameserver.model.actor.instance;
- +
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.sql.SQLException;
- +import java.util.StringTokenizer;
- +
- +import javolution.text.TextBuilder;
- +
- +import com.l2jserver.L2DatabaseFactory;
- +import com.l2jserver.gameserver.model.L2World;
- +import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
- +import com.l2jserver.gameserver.model.entity.LeagueOfElo;
- +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
- +
- +/**
- + * @author Marwan
- + * @version 1.0
- + */
- +public class L2LeagueInstance extends L2NpcInstance
- +{
- + boolean r = true;
- +
- + public L2LeagueInstance (int objectId, L2NpcTemplate template)
- + {
- + super(objectId, template);
- + }
- +
- + @Override
- + public void onBypassFeedback(L2PcInstance activeChar, String command)
- + {
- +
- + if (command.startsWith("teamm"))
- + {
- + Connection con = null;
- + try
- + {
- +
- + con = L2DatabaseFactory.getInstance().getConnection();
- + PreparedStatement stm = con.prepareStatement("SELECT member1,member2,member3,member4 FROM rankedteams WHERE leader=?");
- + stm.setString(1, activeChar.getName());
- + ResultSet rs = stm.executeQuery();
- + L2PcInstance h;
- + while (rs.next())
- + {
- + if (r)
- + {
- +
- + L2PcInstance t1 = L2World.getInstance().getPlayer(rs.getString("member1"));
- + L2PcInstance t2 = L2World.getInstance().getPlayer(rs.getString("member2"));
- + L2PcInstance t3 = L2World.getInstance().getPlayer(rs.getString("member3"));
- + L2PcInstance t4 = L2World.getInstance().getPlayer(rs.getString("member4"));
- + if (t1.isOnline() && t2.isOnline() && t3.isOnline() && t4.isOnline())
- + {
- + activeChar.sendMessage("Registartion Succesfull");
- + LeagueOfElo.team1.add(t1);
- + LeagueOfElo.team1.add(t2);
- + LeagueOfElo.team1.add(t3);
- + LeagueOfElo.team1.add(t4);
- + LeagueOfElo.team1.add(activeChar);
- + LeagueOfElo.red = 5;
- + }
- + else
- + {
- + activeChar.sendMessage("someone in your team is offline biatch");
- + }
- + r = false;
- + return;
- + }
- + else
- + {
- + L2PcInstance t1 = L2World.getInstance().getPlayer(rs.getString("member1"));
- + L2PcInstance t2 = L2World.getInstance().getPlayer(rs.getString("member2"));
- + L2PcInstance t3 = L2World.getInstance().getPlayer(rs.getString("member3"));
- + L2PcInstance t4 = L2World.getInstance().getPlayer(rs.getString("member4"));
- + if (t1.isOnline() && t2.isOnline() && t3.isOnline() && t4.isOnline())
- + {
- + activeChar.sendMessage("Registartion Succesfull");
- + LeagueOfElo.team2.add(t1);
- + LeagueOfElo.team2.add(t2);
- + LeagueOfElo.team2.add(t3);
- + LeagueOfElo.team2.add(t4);
- + LeagueOfElo.team2.add(activeChar);
- + LeagueOfElo.blue = 5;
- + }
- + else
- + {
- + activeChar.sendMessage("someone in your team is offline biatch");
- + }
- + r = true;
- + }
- +
- + rs.close();
- + stm.close();
- + }
- + }
- + catch (SQLException sqle)
- + {
- + }
- + finally
- + {
- +
- + try
- + {
- + con.close();
- + }
- + catch (SQLException e)
- + {
- + // TODO Auto-generated catch block
- + e.printStackTrace();
- + }
- +
- + }
- + if ((LeagueOfElo.red == 5) && (LeagueOfElo.blue == 5))
- + {
- + LeagueOfElo.Team5v5();
- + }
- +
- + }
- + else if (command.startsWith("status"))
- + {
- + TextBuilder sb = new TextBuilder();
- + Connection con = null;
- + sb.append("<html><title>League Of Elo</title><body><br><br>");
- + try
- + {
- + con = L2DatabaseFactory.getInstance().getConnection();
- +
- + PreparedStatement statement = con.prepareStatement("SELECT * FROM characters where `char_name`=? ");
- +
- + statement.setString(1, activeChar.getName());
- + statement.execute();
- + ResultSet result = statement.executeQuery();
- +
- + while (result.next())
- + {
- + sb.append("Wins : " + result.getInt(62) + "<br>");
- + sb.append("Loses : " + result.getInt(63));
- + sb.append("</body></html>");
- + }
- + statement.close();
- + }
- + catch (Exception e)
- + {
- +
- + }
- + finally
- + {
- +
- + try
- + {
- + con.close();
- + }
- + catch (SQLException e)
- + {
- + // TODO Auto-generated catch block
- + e.printStackTrace();
- + }
- + }
- + NpcHtmlMessage msg = new NpcHtmlMessage(6);
- + msg.setHtml(sb.toString());
- + activeChar.sendPacket(msg);
- +
- + }
- +
- + else if (command.startsWith("team"))
- + {
- +
- + TextBuilder sb = new TextBuilder();
- + Connection con = null;
- + sb.append("<html><title>League Of Elo</title><body><br><br>");
- + try
- + {
- + con = L2DatabaseFactory.getInstance().getConnection();
- +
- + PreparedStatement statement = con.prepareStatement("SELECT * FROM rankedteams where `leader`=? OR `member1`=?");
- +
- + statement.setString(1, activeChar.getName());
- + statement.setString(2, activeChar.getName());
- + statement.execute();
- + ResultSet result = statement.executeQuery();
- +
- + while (result.next())
- + {
- + sb.append("Team Name : " + result.getString(1) + "<br>");
- + sb.append("Team Leader : " + result.getString(2) + "<br>");
- + sb.append("Team Members : " + result.getString(3) + " " + result.getString(4) + " " + result.getString(5) + " " + result.getString(6));
- + sb.append("<br>Wins : " + result.getString(7) + "<br>");
- + sb.append("Loses : " + result.getString(8) + "</body></html>");
- + }
- + statement.close();
- + }
- + catch (Exception e)
- + {
- +
- + }
- + finally
- + {
- +
- + try
- + {
- + con.close();
- + }
- + catch (SQLException e)
- + {
- + // TODO Auto-generated catch block
- + e.printStackTrace();
- + }
- + }
- + NpcHtmlMessage msg = new NpcHtmlMessage(6);
- + msg.setHtml(sb.toString());
- + activeChar.sendPacket(msg);
- +
- + }
- + else if (command.startsWith("createt"))
- + {
- + TextBuilder tb = new TextBuilder();
- + tb.append("<html><title>League Of Elo</title><body><center><br>");
- + tb.append("Name: <edit var=\"name\" width=\"50\" height=\"50\"><br>");
- + tb.append("<br><br><center><button value=\"Post\" action=\"bypass -h _npc_" + this.getObjectId() + "_create $name\" width=160 height=32 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center>");
- + NpcHtmlMessage msg = new NpcHtmlMessage(7);
- + msg.setHtml(tb.toString());
- + activeChar.sendPacket(msg);
- + }
- + else if (command.startsWith("create "))
- + {
- + String name = "";
- + StringTokenizer st = new StringTokenizer(command, " ");
- + st.nextToken();
- + while (st.hasMoreTokens())
- + {
- + name = name + st.nextToken();
- + }
- + Connection con = null;
- + try
- + {
- +
- + con = L2DatabaseFactory.getInstance().getConnection();
- +
- + PreparedStatement statement = con.prepareStatement("INSERT INTO rankedteams VALUES (?,?,?,?,?,?,?,?)");
- +
- + statement.setString(1, name);
- + statement.setString(2, activeChar.getName());
- + statement.setString(3, activeChar.getParty().getPartyMembers().getLast().getName());
- + statement.setString(4, activeChar.getParty().getPartyMembers().getFirst().getName());
- + statement.setString(5, activeChar.getParty().getPartyMembers().getFirst().getName());
- + statement.setString(6, activeChar.getParty().getPartyMembers().getFirst().getName());
- + statement.setInt(7, 1);
- + statement.setInt(8, 1);
- + statement.execute();
- + statement.close();
- +
- + activeChar.sendMessage("Succesfull");
- +
- + }
- + catch (Exception e)
- + {
- + }
- + finally
- + {
- +
- + try
- + {
- + con.close();
- + }
- + catch (SQLException e)
- + {
- + // TODO Auto-generated catch block
- + e.printStackTrace();
- + }
- + }
- + }
- +
- + else if (command.startsWith("five"))
- + {
- + activeChar.sendMessage("Registration Successful");
- + LeagueOfElo.svs5.add(activeChar);
- + if (LeagueOfElo.svs5.size() == 2)
- + {
- + LeagueOfElo.Solo5vs5();
- + }
- + }
- + }
- +
- + @Override
- + public void showChatWindow(L2PcInstance player, int val)
- + {
- + TextBuilder tb = new TextBuilder();
- + tb.append("<html><title>League Of Elo</title><body><center><br>");
- + tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">");
- + tb.append("<tr>");
- + tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>");
- + tb.append("<td valign=\"top\"><font color=\"FF6600\">LeagueOfElo</font>");
- + tb.append("<br1><font color=\"FF6600\">" + player.getName() + " </font>Your current ranking is " + player.getRank() + "<br1></td>");
- + tb.append("</tr>");
- + tb.append("</table>");
- + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1\"><br>");
- + tb.append("<button value=\"Create Ranked Team\" action=\"bypass -h createt\" width=160 height=32 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\">");
- + tb.append("<button value=\"Register 5vs5 Solo Match\" action=\"bypass -h npc_" + this.getObjectId() + "_five\" width=160 height=32 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\">");
- + tb.append("<button value=\"Register 5v5 Team Match\" action=\"bypass -h npc_" + this.getObjectId() + "_teamm\" width=160 height=32 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\">");
- + tb.append("<button value=\"Team Info\" action=\"bypass -h npc_" + this.getObjectId() + "_team\" width=160 height=32 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\">");
- + tb.append("<button value=\"My Status\" action=\"bypass -h npc_" + this.getObjectId() + "_status\" width=160 height=32 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\">");
- +
- + NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId());
- + msg.setHtml(tb.toString());
- + player.sendPacket(msg);
- + }
- +
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment