Jump to content

valanths1990

Members
  • Posts

    517
  • Credits

  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Everything posted by valanths1990

  1. sto ekana alliws egw, eam to target pou exei den einai gm kai einai aplos char trwei akuro /* * 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 handlers.admincommandhandlers; import java.util.logging.Logger; import com.l2jserver.Config; import com.l2jserver.gameserver.handler.IAdminCommandHandler; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.itemcontainer.Inventory; import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.CharInfo; import com.l2jserver.gameserver.network.serverpackets.ExBrExtraUserInfo; import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.network.serverpackets.UserInfo; /** * This class handles following admin commands: * - enchant_armor * * @version $Revision: 1.3.2.1.2.10 $ $Date: 2005/08/24 21:06:06 $ */ public class AdminEnchant implements IAdminCommandHandler { private static Logger _log = Logger.getLogger(AdminEnchant.class.getName()); private static final String[] ADMIN_COMMANDS = { "admin_seteh",//6 "admin_setec",//10 "admin_seteg",//9 "admin_setel",//11 "admin_seteb",//12 "admin_setew",//7 "admin_setes",//8 "admin_setle",//1 "admin_setre",//2 "admin_setlf",//4 "admin_setrf",//5 "admin_seten",//3 "admin_setun",//0 "admin_setba",//13 "admin_setbe", "admin_enchant" }; @Override public boolean useAdminCommand(String command, L2PcInstance activeChar) { if (command.equals("admin_enchant")) { showMainPage(activeChar); } else { int armorType = -1; if (command.startsWith("admin_seteh")) armorType = Inventory.PAPERDOLL_HEAD; else if (command.startsWith("admin_setec")) armorType = Inventory.PAPERDOLL_CHEST; else if (command.startsWith("admin_seteg")) armorType = Inventory.PAPERDOLL_GLOVES; else if (command.startsWith("admin_seteb")) armorType = Inventory.PAPERDOLL_FEET; else if (command.startsWith("admin_setel")) armorType = Inventory.PAPERDOLL_LEGS; else if (command.startsWith("admin_setew")) armorType = Inventory.PAPERDOLL_RHAND; else if (command.startsWith("admin_setes")) armorType = Inventory.PAPERDOLL_LHAND; else if (command.startsWith("admin_setle")) armorType = Inventory.PAPERDOLL_LEAR; else if (command.startsWith("admin_setre")) armorType = Inventory.PAPERDOLL_REAR; else if (command.startsWith("admin_setlf")) armorType = Inventory.PAPERDOLL_LFINGER; else if (command.startsWith("admin_setrf")) armorType = Inventory.PAPERDOLL_RFINGER; else if (command.startsWith("admin_seten")) armorType = Inventory.PAPERDOLL_NECK; else if (command.startsWith("admin_setun")) armorType = Inventory.PAPERDOLL_UNDER; else if (command.startsWith("admin_setba")) armorType = Inventory.PAPERDOLL_CLOAK; else if (command.startsWith("admin_setbe")) armorType = Inventory.PAPERDOLL_BELT; if (armorType != -1) { try { int ench = Integer.parseInt(command.substring(12)); L2Object target = activeChar.getTarget(); if (target == null) target = activeChar; L2PcInstance player = null; if (target instanceof L2PcInstance) { player = (L2PcInstance) target; } else { activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET); return false; } if (!player.isGM()) { activeChar.sendMessage("You cannot enchant items to non GM players."); activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT)); return false; } // check value if (ench < 0 || ench > 65535) activeChar.sendMessage("You must set the enchant level to be between 0-65535."); else setEnchant(activeChar, ench, armorType); } catch (StringIndexOutOfBoundsException e) { if (Config.DEVELOPER) _log.warning("Set enchant error: " + e); activeChar.sendMessage("Please specify a new enchant value."); } catch (NumberFormatException e) { if (Config.DEVELOPER) _log.warning("Set enchant error: " + e); activeChar.sendMessage("Please specify a valid new enchant value."); } } // show the enchant menu after an action showMainPage(activeChar); } return true; } private void setEnchant(L2PcInstance activeChar, int ench, int armorType) { // get the target L2Object target = activeChar.getTarget(); if (target == null) target = activeChar; L2PcInstance player = null; if (target instanceof L2PcInstance) { player = (L2PcInstance) target; } else { activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET); return; } // now we need to find the equipped weapon of the targeted character... int curEnchant = 0; // display purposes only L2ItemInstance itemInstance = null; // only attempt to enchant if there is a weapon equipped L2ItemInstance parmorInstance = player.getInventory().getPaperdollItem(armorType); if (parmorInstance != null && parmorInstance.getLocationSlot() == armorType) { itemInstance = parmorInstance; } if (itemInstance != null) { curEnchant = itemInstance.getEnchantLevel(); // set enchant value player.getInventory().unEquipItemInSlot(armorType); itemInstance.setEnchantLevel(ench); player.getInventory().equipItem(itemInstance); // send packets InventoryUpdate iu = new InventoryUpdate(); iu.addModifiedItem(itemInstance); player.sendPacket(iu); player.broadcastPacket(new CharInfo(player)); player.sendPacket(new UserInfo(player)); player.broadcastPacket(new ExBrExtraUserInfo(player)); // informations activeChar.sendMessage("Changed enchantment of " + player.getName() + "'s " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + "."); player.sendMessage("Admin has changed the enchantment of your " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + "."); } } private void showMainPage(L2PcInstance activeChar) { AdminHelpPage.showHelpPage(activeChar, "enchant.htm"); } @Override public String[] getAdminCommandList() { return ADMIN_COMMANDS; } } PS. L2jserver Beta last rev
  2. DELETE FROM spawnlist; alla den yparxei periptwsh na ton help, isa isa perisotero karkino 8a vgalei na ta perasei ola xaxaax
  3. gt den pernas apla enan kodika apo ta pvp zones pou exoun ginei share, wste me to pou pe8ainei kapoios ekei mesa na ton kanei aftomata to game rez, eite se ena meros eite se random meroi apo to zone pou 8eleis
  4. me tous mlkes pou mpleksame ola einai dinata, ena paradeigma an enas gonios valei sthn akrh kapia lefta gia ton gio tou paradeigma ta opoia ta exoun forologisi hdh.... kai ta dwsei ston gio tou 8a prepei na ta dhlwsei gia na ta forologisoun pali, sthn GTP xwra pou zoume ta panta einai dinata, edw lene 8a forologoun kai an exeis khpo sto spiti sou kai sperneis ntomates... ti na leme twra
  5. pes kai ti pack exeis.... telos panton yparxei config gia to start level opws kai ta start adena an exeis l2jserver
  6. kata defteron delete windows kai perna linux kai ma8e na xrhsimopoieis to iptables.......koinos to firewall
  7. ti 8a allaksei an to kanei compile ksana? den exei nohma
  8. to firewall ton windows?, an exei kai to antivirus kleisto kai afto
  9. kala asto, pes mou ligo, grapse sto command line ipconfig kai pata enter kai des ti ip exei twra to pc sou kai des an exeis valei thn idia ip sto router gia to forward ton ports
  10. dokimase afto #Top Online Info if event == "1" : st.takeItems(Precio_ID,0) total_asesinados = 0 htmltext_ini = "<html><head><title>Top Online Info</title></head><body><table width=300><tr><td><font color =\"FF00FF\"></td><td><center><font color =\"FFFF00\">Player</color></center></td><td><center>Online Time</center></td></tr>" htmltext_info ="" color = 1 pos = 0 con = L2DatabaseFactory.getInstance().getConnection() ontime = con.prepareStatement("SELECT char_name,onlinetime FROM characters WHERE accesslevel=0 order by onlinetime desc limit 30") rs = ontime.executeQuery() while (rs.next()) : char_name = rs.getString("char_name") char_ontime = rs.getString("onlinetime") total_asesinados = total_asesinados + int(char_ontime) pos = pos + 1 posstr = str(pos) if color == 1: color_text = "<font color =\"00FFFF\">" color = 2 htmltext_info = htmltext_info + "<tr><td><center><font color =\"FF00FF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_ontime + "</center></td></tr>" elif color == 2: color_text = "<font color =\"FF0000\">" color = 1 htmltext_info = htmltext_info + "<tr><td><center><font color =\"FF00FF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_ontime + "</center></td></tr>" htmltext_end = "</table></body></html>" htmltext_toponlinelist = htmltext_ini + htmltext_info + htmltext_end con.close() return htmltext_toponlinelist edit
  11. kane ligo post to arxeio me to error na dw pou ekana to la8os
  12. thn internal ip tou pc sou... stis ri8miseis tis kartas diktuou
  13. mhpws exei firewall to antivirus? kai defteron ekanes static thn internal ip tou pc? wste na thn peraseis sto router?
  14. ekei pou leei if event="1" prepei na to tairiakseis me ton ipolipo kodika diladi to if event="1" antistixi sto top pk px to event="2" sto top pvp ara afto 8a prepei na ginei if event = "3" an me katalaves kai an sou einai efkolo kane post olo ton kodika mazi me to eero pou sou evgale
  15. exw vare8ei na vlepw ta idia kai ta idia post alh8eia, telos pantwn, 8a prepei na anoikseis file mou kai ta ports sto firewall, h kleise to firewall, an exeis antivirus me firewall prepei na ta tis anoikseis kai ekei
  16. to omorfa einai kati teleiws sxetiko, o ka8enas exei ta dika tou gousta.....
  17. for top lists you should create a threadpool manager, to reload top lists every 30 mins for example, so players want access database directly ;)
  18. dude one suggestion, you should change something in TopPlayer.java, String adenas = getAdenas(result.getInt("SUM(it.count)")); to this String adenas = getAdenas(result.getLong("SUM(it.count)")); and make this: public String getAdenas(long adena) { String adenas = ""; if (adena >= 1000000000) adenas = Long.toString(adena / 1000000000) + " Billion " + Long.toString((adena % 1000000000) / 1000000) + " million"; else adenas = Long.toString(adena / 1000000) + " Million " + Long.toString((adena % 1000000) / 1000) + " k"; return adenas; } btw nice work!!
  19. activeChar.sendMessage("Welcome to L2Destiny " + charName); h parapanw grammh einai gia to vgazei sta texts kai afth activeChar.sendPacket(new ExShowScreenMessage("Welcome to L2Destiny " + charName, 8000)); gia na to vgazei sthn othonh twra gt den sou douleyei den kserw
  20. nai ontos exeis dikio, paradeigma ama exei perasei dika tou libs, 8a prepei na ta parei ena ena, to patch apla vgazei tis allages pou eginan sta files
  21. ean kaneis deksi click panw to sta arxeia tou game server paradeigma, kai pathseis team create patch 8a dhmiourghsei ena arxeio me oti allages exeis kanei panw sto pack soy
  22. den kserw an ksexasa kati den to ekana test, se txt to ekana tis allages #Top Online Info if event == "1" and cantidad_pago >= 0 : st.takeItems(Precio_ID,0) total_asesinados = 0 htmltext_ini = "<html><head><title>Top Online Info</title></head><body><table width=300><tr><td><font color =\"FF00FF\"></td><td><center><font color =\"FFFF00\">Player</color></center></td><td><center>Online Time</center></td></tr>" htmltext_info ="" color = 1 pos = 0 con = L2DatabaseFactory.getInstance().getConnection() ontime = con.prepareStatement("SELECT char_name,onlinetime FROM characters WHERE accesslevel=0 order by onlinetime desc limit 30") rs = ontime.executeQuery() while (rs.next()) : char_name = rs.getString("char_name") char_ontime = rs.getString("onlinetime") total_asesinados = total_asesinados + int(char_ontime) pos = pos + 1 posstr = str(pos) if color == 1: color_text = "<font color =\"00FFFF\">" color = 2 htmltext_info = htmltext_info + "<tr><td><center><font color =\"FF00FF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_ontime + "</center></td></tr>" elif color == 2: color_text = "<font color =\"FF0000\">" color = 1 htmltext_info = htmltext_info + "<tr><td><center><font color =\"FF00FF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_ontime + "</center></td></tr>" htmltext_end = "</table><center><font color=\"FFFFFF\">" + "A Total of " + str(total_asesinados) + " Pk's.</center></body></html>" htmltext_toponlinelist = htmltext_ini + htmltext_info + htmltext_end con.close() return htmltext_toponlinelist elif event == "1" and cantidad_pago < 0 : htmltext = "<html><head><title>=Online Info</title></head><body><font color =\"FF0000\">Primero pagame...!! son 0 adenas.</body></html>" return htmltext
  23. 8a kaneis ena patch, me ola ta diffs kai apla 8a katevaseis to svn sto pc ths etairias.. kai apla 8a peraseis to patch gia na mhn stelneis olo to workspace
×
×
  • Create New...