
BlackKiss
Members-
Posts
169 -
Credits
0 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by BlackKiss
-
to proto error den xero gt me kani dsconnecte mipos den exo arketi ram exo 3 GB kai sikono game server console login server console ena l2 kai to antivirus to kaspersky mipos ftei to system den xero ginete auto kai otan katebazo to parathiro tou l2 mou skai DC to deutero malon einai me enan code pou ebala gia to set hero code einai aftos Index: /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java =================================================================== --- /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java (revision 40) +++ /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java (revision 45) @@ -55,5 +55,5 @@ private static final String[] ADMIN_COMMANDS = {"admin_admin", "admin_admin1", "admin_admin2", "admin_admin3", "admin_admin4", "admin_admin5", "admin_gmliston", "admin_gmlistoff", "admin_silence", "admin_diet", "admin_tradeoff", "admin_reload", "admin_set", "admin_set_menu", "admin_set_mod", - "admin_saveolymp", "admin_sethero", "admin_manualhero"}; + "admin_saveolymp", "admin_manualhero"}; private static final int REQUIRED_LEVEL = Config.GM_MENU; @@ -102,18 +102,4 @@ catch(Exception e){e.printStackTrace();} activeChar.sendMessage("olympiad stuff saved!!"); - } - else if(command.startsWith("admin_sethero")){ - L2PcInstance target = null; - - if (activeChar.getTarget() != null && activeChar.getTarget() instanceof L2PcInstance) - { - target = (L2PcInstance)activeChar.getTarget(); - target.setHero(target.isHero()? false : true); - } - else - { - target = activeChar; - target.setHero(target.isHero()? false : true); - } } else if(command.startsWith("admin_manualhero")) Index: /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHero.java =================================================================== --- /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHero.java (revision 45) +++ /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHero.java (revision 45) @@ -0,0 +1,132 @@ +/* + * 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 net.sf.l2j.gameserver.handler.admincommandhandlers; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import net.sf.l2j.Config; +import net.sf.l2j.L2DatabaseFactory; +import net.sf.l2j.gameserver.GmListTable; +import net.sf.l2j.gameserver.handler.IAdminCommandHandler; +import net.sf.l2j.gameserver.model.L2Object; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.serverpackets.SystemMessage; + +public class AdminHero implements IAdminCommandHandler{ + private static String[] _adminCommands = {"admin_sethero"}; + private final static Log _log = LogFactory.getLog(AdminHero.class.getName()); + private static final int REQUIRED_LEVEL = Config.GM_MENU; + + public boolean useAdminCommand(String command, L2PcInstance activeChar){ + if (!Config.ALT_PRIVILEGES_ADMIN){ + if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM())){ + return false; + } + } + if (command.startsWith("admin_sethero")){ + L2Object target = activeChar.getTarget(); + L2PcInstance player = null; + SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2); + if (target instanceof L2PcInstance){ + player = (L2PcInstance)target; + }else{ + player = activeChar; + } + + if (player.isHero()){ + player.setHero(false); + sm.addString("You are no longer a server hero."); + GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" removed hero stat of player"+ target.getName()); + Connection connection = null; + try{ + connection = L2DatabaseFactory.getInstance().getConnection(); + + PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?"); + statement.setString(1,target.getName()); + ResultSet rset = statement.executeQuery(); + int objId = 0; + if (rset.next()){ + objId = rset.getInt(1); + } + rset.close(); + statement.close(); + + if (objId == 0) {connection.close(); return false;} + + statement = connection.prepareStatement("UPDATE characters SET hero=0 WHERE obj_id=?"); + statement.setInt(1, objId); + statement.execute(); + statement.close(); + connection.close(); + } + catch (Exception e){ + _log.warn("could not set Hero stats of char:", e); + } + finally{ + try { connection.close(); } catch (Exception e) {} + } + }else{ + player.setHero(true); + sm.addString("You are now a server Hero, Congratulations!"); + GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" has given Hero status to "+target.getName()+"."); + Connection connection = null; + try{ + connection = L2DatabaseFactory.getInstance().getConnection(); + + PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?"); + statement.setString(1,target.getName()); + ResultSet rset = statement.executeQuery(); + int objId = 0; + if (rset.next()){ + objId = rset.getInt(1); + } + rset.close(); + statement.close(); + + if (objId == 0) {connection.close(); return false;} + + statement = connection.prepareStatement("UPDATE characters SET hero=1 WHERE obj_id=?"); + statement.setInt(1, objId); + statement.execute(); + statement.close(); + connection.close(); + } + catch (Exception e){ + _log.warn("could not set Hero stats of char:", e); + } + finally{ + try { connection.close(); } catch (Exception e) {} + } + + } + player.sendPacket(sm); + player.broadcastUserInfo(); + if(player.isHero() == true){} + } + return false; + } + public String[] getAdminCommandList() { + return _adminCommands; + } + private boolean checkLevel(int level){ + return (level >= REQUIRED_LEVEL); + } +} Index: /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/GameServer.java (revision 30) +++ /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/GameServer.java (revision 45) @@ -92,4 +92,5 @@ import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHeal; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHelpPage; +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHero; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminInvul; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminKick; @@ -529,4 +530,5 @@ _adminCommandHandler.registerAdminCommandHandler(new AdminHeal()); _adminCommandHandler.registerAdminCommandHandler(new AdminHelpPage()); + _adminCommandHandler.registerAdminCommandHandler(new AdminHero()); _adminCommandHandler.registerAdminCommandHandler(new AdminShutdown()); _adminCommandHandler.registerAdminCommandHandler(new AdminSpawn());
-
xriazome developer! >.<
BlackKiss replied to KillingYouSoftly's question in Request Server Development Help [Greek]
paidia to thema xekinise apo texure kai eftase dos lol re killingyousoftly file pou ta exis di afta thes kai tsampa na sou kani texture egw tora prosfata ixa di kati video tou critical error pos na ftixis ena weapon apo mideniki basi tex kai animasion kai mou efige o takos etc thes o alos pou ta exi mathi na sou ta dosi sto piato ti se exi filaraki skase to 50riko edw sto forum kai tha ta exis milame gia Development oxi mlkies kai otan den xeris file min les gia ton alon pou den ton xeris gt o Flash™ einai para poli kairo sto forum Posts: 2.558 to lei kai to MxC kai ton exo di egw o idios se kathe post exi pi kai mia kali koubenta kai se kathe post pou exi kani aftos einai apo ta pio xrisma sto MxC AKOU EDW TA AKOUO KAI GELAO TO TEXTURE SE MIA PERIOXI NA BGALIS TIS PETRES THA PARI 5 LEPTA LOL MIN TA LES AFTA GT THA SE PARO ME TIS PETRES den xeris ti simeni texture mourle gia afto ta les afta. kai enas server den ftiaxnete se 1 ora palio nooba ektos an thes na einai san kai aftous tous nooboserver pou einai sto hopzone killingyousoftly pragmatika re file mou eftiaxes to kefi paidia diabaste to ti lei o tipas {tha klasete sto gelioOooOOo} -
lol re boydes me kanate maga doulebi o code
-
na sou po file ton perasa tora to koment tha //set_hero kai etc gia na ginome hero
-
mia erotisi file na sou po afta ta - edw na ta sbiso ( - ) mono i na sbiso oloklira ta line ( - else if(command.startsWith("admin_sethero")){ ) asap mia apantisi catch(Exception e){e.printStackTrace();} activeChar.sendMessage("olympiad stuff saved!!"); - } - else if(command.startsWith("admin_sethero")){ - L2PcInstance target = null; - - if (activeChar.getTarget() != null && activeChar.getTarget() instanceof L2PcInstance) - { - target = (L2PcInstance)activeChar.getTarget(); - target.setHero(target.isHero()? false : true); - } - else - { - target = activeChar; - target.setHero(target.isHero()? false : true); - } } else if(command.startsWith("admin_manualhero"))
-
Boydes thelo ena help me class master
BlackKiss replied to BlackKiss's question in Request Server Development Help [Greek]
kala file xigithikes orea -
TownWarEvent
BlackKiss replied to BlackDevilDev's question in Request Server Development Help [Greek]
//admin_townwar_start gia pata mia afto re file kai pes mou aa nai ty gia to event //admin_townwar_end -
Boydes thelo ena help me class master
BlackKiss posted a question in Request Server Development Help [Greek]
lipon boydes exw ena problima to pack to ftiaxno egw pos mporo na kano ton class master otan kanis to class na sou dini lvl ala pseftiko lvl dld otan alazis class den sou dixni ta skill amesos prepi na paris lvl gia na sou dosi ta skill pos tha kanoume ton class master na sou dini pseftiko lvl i opos alios theli gia na fixaristi mipos xeri kanis tha aktimousa para poli na me boithisete -
t tattoo beni sto chest...HELP!
BlackKiss replied to KillingYouSoftly's question in Request Server Development Help [Greek]
mpa file no den mpenoun eki kanonika ta tattoo file -
re file gt den zitas boithia apo tin pay safe na sou poun apo pou mporis na tis exargirosis
-
pou kolai edo re file i pay safe einai kapio development i pay safe kai den to xero kapios mod na to metaferi kai afto sikoni dekarma gt file kai deka xronon na eisai afta den ta les edw :P
-
t tattoo beni sto chest...HELP!
BlackKiss replied to KillingYouSoftly's question in Request Server Development Help [Greek]
tha mpis mesa sto navicat file meta sta armors kai meta tha patisis find tha patisis tattoo kai tha sou anfanistoune ola meta pas sto tattoo of power tha dis to bodypart tha sbisis to chest kai tha balis underwear ok re boy gia oti alo mila :P -
paidia psaxno to html tou L2WeddingManager
BlackKiss replied to BlackKiss's question in Request Server Development Help [Greek]
ti les re.. les na min to exo kani ala blepo exis orexi gia spam kai den pezi file to html den exi mono to id tou npc exipnakia mpori kai na tou exoun bali kapio name aa kai min xana spamaris sto post efoson den xeris ba ne help to mono pou kanis enai na spamaris -
paidia psaxno to html tou L2WeddingManager
BlackKiss replied to BlackKiss's question in Request Server Development Help [Greek]
kapios pou na xeri paidia -
paidia psaxno to html tou L2WeddingManager
BlackKiss replied to BlackKiss's question in Request Server Development Help [Greek]
popo re file ti les to html tou npc sou leo -
paidia psaxno to html tou L2WeddingManager
BlackKiss posted a question in Request Server Development Help [Greek]
psaxno to html tou L2WeddingManager pou tha to bro sta \data\html pou den mporo na to bro to html tou npc -
[Share] L2Skill Editor XML by Eternity
BlackKiss replied to vaggos500's topic in Server Development Discussion [Greek]
euxaristo file gamai apla den ixera oti ipepirxe tetio program -
pedia stilte kanena max link pos ftiaxnis ena skill
-
pou brisko ta safe skill kai ta rates skill
BlackKiss replied to BlackKiss's question in Request Server Development Help [Greek]
l2j server einai re file ti xrisimopioun edo sto maxcheater auto einai aftonoito re file esi ti nomizes l2off den to exo xasi akoma to mialo mou gia na to xrisimoiso -
pou brisko ta safe skill kai ta rates skill
BlackKiss replied to BlackKiss's question in Request Server Development Help [Greek]
mpa file min kanis askopa post otan den xeris sta rates den iparxi kati tetio gia to etchant skill i ta rate -
pou brisko ta safe skill kai ta rates skill
BlackKiss posted a question in Request Server Development Help [Greek]
pedia mesa sto config pios fakelos einai gia na bro ta safe skill kai ta rates skill ? opios xeri as apantisi den einai kai kati diskolo