Jump to content

T9Text

Members
  • Posts

    145
  • Credits

  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Everything posted by T9Text

  1. Donate = Dwrea :) (To kiriotero) Defteron ta lefta pou 8a pareis (osa kai na einai) to lamvaneis san Donate-Gift dn nomizw na prepei na pliroseis Φ.Π.Α gia na stileis lefta se kapiona :) Apla kapios sou kanei dwrea lefta... (an iksera oti kratane Φ.Π.Α. apo to 50lepto pou rixnw gia tin Unicef sto koutaki sta Everest, dn 8a ksanarixna :P )
  2. Me tetio laptop kai kalo connection kai Live server anigeis :P (To periexomeno apo auto to sxolio einai xioumoristikou tipou)
  3. [share]Smart Enchanted Item Shop « on: January 17, 2013, 05:26:55 PM »
  4. You want to chane it with your own? or you want to use Interlude logo ?
  5. Omg ... he want Donate NPC.... and he this called "SmartShop" cuz elfo named SmartShop /* 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.l2jfrozen.gameserver.model.actor.instance; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.StringTokenizer; import com.l2jfrozen.gameserver.ai.CtrlIntention; import com.l2jfrozen.gameserver.datatables.sql.ItemTable; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.CharInfo; import com.l2jfrozen.gameserver.network.serverpackets.InventoryUpdate; import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage; import com.l2jfrozen.gameserver.network.serverpackets.UserInfo; import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; import com.l2jfrozen.util.CloseUtil; import com.l2jfrozen.util.database.L2DatabaseFactory; import javolution.text.TextBuilder; /** * * @author Elfocrash * */ public class L2SmartMultisellInstance extends L2FolkInstance { public L2SmartMultisellInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(L2PcInstance player, String command) { if(player == null) { return; } if(command.startsWith("buyItem ")) { String itemId = null; StringTokenizer st = new StringTokenizer(command, " "); while (st.hasMoreTokens()) { itemId = st.nextToken(); } int id = Integer.parseInt(itemId); if(player.getInventory().getItemByItemId(getItemCostId(id)).getCount() >= getItemCostCount(id)) { player.getInventory().destroyItemByItemId("delete", getItemCostId(id), getItemCostCount(id), player, null); L2ItemInstance item = null; item = player.getInventory().addItem("Elfo", getItemId(id), 1, null, null); item.setEnchantLevel(getItemEnchant(id)); // send packets InventoryUpdate iu = new InventoryUpdate(); iu.addItem(item); player.sendPacket(iu); player.broadcastPacket(new CharInfo(player)); player.sendPacket(new UserInfo(player)); SystemMessage sm = new SystemMessage(SystemMessageId.YOU_PICKED_UP_S1_S2); sm.addItemName(item.getItemId()); sm.addNumber(1); player.sendPacket(sm); iu = null; } else { player.sendMessage("You don't have enough items in order to buy this one"); return; } } } @Override public void onAction(L2PcInstance player) { if (!canTarget(player)) { return; } if (this != player.getTarget()) { player.setTarget(this); player.sendPacket(new MyTargetSelected(getObjectId(), 0)); player.sendPacket(new ValidateLocation(this)); } else if (!canInteract(player)) { player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this); } else { showHtmlWindow(player); } player.sendPacket(new ActionFailed()); } private void showHtmlWindow(L2PcInstance activeChar) { NpcHtmlMessage nhm = new NpcHtmlMessage(5); TextBuilder tb = new TextBuilder(""); tb.append("<html><head><title>Smart Shop</title></head><body>"); tb.append("<center>"); 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\">Smart Shop</font>"); tb.append("<br1><font color=\"00FF00\">"+activeChar.getName()+"</font>, Here you can buy Enchanted Gear.</td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("</center>"); tb.append("<center>"); for(int i = 1; i<= getRowsCount(); i++) tb.append("<br><a action=\"bypass -h npc_" + getObjectId() + "_buyItem " + i + "\">Item name: " + ItemTable.getInstance().getTemplate(getItemId(i)).getName() + " Enchant: +"+ getItemEnchant(i) + " Cost: " + getItemCostCount(i) + " " + ItemTable.getInstance().getTemplate(getItemCostId(i)).getName() + "</a>"); tb.append("</center>"); tb.append("<center>"); tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>"); tb.append("<font color=\"FF6600\">By Elfocrash</font>"); tb.append("</center>"); tb.append("</body></html>"); nhm.setHtml(tb.toString()); activeChar.sendPacket(nhm); activeChar.sendPacket(new ActionFailed()); } private int getRowsCount() { int rows = 0; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT * FROM smart_shop"); ResultSet rset = statement.executeQuery(); while (rset.next()) { rows++; } rset.close(); statement.close(); } catch(Exception e) { e.printStackTrace(); }finally{ CloseUtil.close(con); con = null; } return rows; } private int getItemId(int itemId) { int itemIdd = 0; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT item_id FROM smart_shop WHERE id=?"); statement.setInt(1, itemId); ResultSet rset = statement.executeQuery(); while (rset.next()) { itemIdd = rset.getInt("item_id"); } rset.close(); statement.close(); } catch(Exception e) { e.printStackTrace(); }finally{ CloseUtil.close(con); con = null; } return itemIdd; } private int getItemCostId(int costid) { int costIt = 0; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT cost_item_id FROM smart_shop WHERE id=?"); statement.setInt(1, costid); ResultSet rset = statement.executeQuery(); while (rset.next()) { costIt = rset.getInt("cost_item_id"); } rset.close(); statement.close(); } catch(Exception e) { e.printStackTrace(); }finally{ CloseUtil.close(con); con = null; } return costIt; } private int getItemCostCount(int costid) { int costIt = 0; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT cost_item_count FROM smart_shop WHERE id=?"); statement.setInt(1, costid); ResultSet rset = statement.executeQuery(); while (rset.next()) { costIt = rset.getInt("cost_item_count"); } rset.close(); statement.close(); } catch(Exception e) { e.printStackTrace(); }finally{ CloseUtil.close(con); con = null; } return costIt; } private int getItemEnchant(int id) { int itemEnch = 0; Connection con = null; PreparedStatement statement = null; try { con = L2DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("SELECT item_enchant FROM smart_shop WHERE id=?"); statement.setInt(1, id); ResultSet rset = statement.executeQuery(); while (rset.next()) { itemEnch = rset.getInt("item_enchant"); } rset.close(); statement.close(); } catch(Exception e) { e.printStackTrace(); }finally{ CloseUtil.close(con); con = null; } return itemEnch; } }
  6. He ask to adapt Elfocrash Smartshop npc -.-
  7. You mean THIS ? http://img.prntscr.com/img?url=http://i.imgur.com/EVSiGyx.png or http://i.imgur.com/1aieCPr.png ???
  8. you know what i mean and if you dont like my recommendations its all at you :) Your Server/Your Rules Keep going
  9. On me looks like another L2Gold / L2Pride. But thats cuz i rly hate customs :) and i won't play as player on server. But looks rly good. i recomm to edit a bit your npc (like GK / Buffer) :) Keep goiing.
  10. I was "muted" on my main account cuz i was "Moderator" on another forum. Long time ago..... Can you Un-mute my account ? (StinkyMadness)
  11. i think its to bad to try help people with my "low" java skill... Better just take Reply with Flame & Hate. {GR} Etc einai h zwh xoris ka8reftes maga mou. ka8ese kai krazeis tous alous. Egw toulaxiston ka8ome na tous help. Gt olou otan bikan edo etc htan. Pote dn dilosa ton eaftom L2JDeveloper... Client asxoloumouna pada. Apla mono me to 1 dn kaneis pola. Opote min mou les pos to paizw Dev. To main acc mou exei ban epidi eimouna Client Developer se alo forum. Kai parolou pou dn eimai pia sunexizoun ton xavale me to ban edo. Kai edometaksi exei nekrosei to L2Section alla akoma 10-15 atoma prospa8oun na voh8ane. Filakia. {/GR}
  12. File psaxnw polu kairo ena gamimeno Community... kai dn edine kaneis oute shared oute bugged :P sto telos vrika ena pou tou lipane ta misa java kai to epidior8osa... etc ema8a na ftiaxnw diko m :P Kai eipa na to paw ligo sta akra. Alazodas tou mege8os... pirazodas to apo patch kai oxi mono html/java :) Molis vrw xronw 8a to kanw Video :)
  13. Euxaristo... pistevw eisai apo ta agapita atoma olon edo mesa....
  14. Na ksexase na pei to paidi posoi to paizoune eksipnoi edo mesa. Bravo vrikes mia leksh la8os... otan grafeis apo kinito einai diskolo na grapseis kati la8os... sunxaritiria... mia pepsi sto paidi apo edo.
  15. e tote sto XML tin exeis kanei tin pata :P (Skype : RedPhoenixOfficial)
  16. Katarxas o Baggos voi8aei komso.... Sou ipe na deis guild epidi 8a se voh8isei an sou ksefige kati... Prosopika voh8aw para polu kai free... so opion aksizei... an kapios dn exei idea apo server kai 8elei code profanos kai 8a plirosei... kai dn 8a plirosei ton code.. alla tin varemara tou pou dn ka8ete na ma8enei... egw mazi sou help tous pades se oti borw... an omos se enan asxeto vriaksw 3-4 gamatous codes gia ton server tou ton treksei kai meta kapou to vgei ena 8ema ... se alo code/error ti 8a kanei ? 8a me vrei kai 8a mou zitisei na to ftiaksw ? An kapios variete na ma8ei dn aksizei na ton Help... kai episis pistevw oti apadises me 8rasos kai molis exases polous po 8a se help. To oti zitas voh8ia dn sumenei oti 8a stin dosoune... borei na sou fenete alokoto alla kapios ekatse kai diavase gia na ta ma8ei na ta kanei kai 8a einai adikia na se help free. Telos padon egw otan kolaga kapou... Delete ola kai Install again
  17. Fist give as a Info. Client/Project 3) If you mean to store shop you can make a no store zones on locations
  18. Ta programata pou 8es einai : To Project katarxas (Source/Pack) Java JDK kit ( 7 h' 8 ) MySQL ( 5.5 Reccom ) Navicat (Gia tin database sou) Eclipse (Gia to Source) Extra: NotePat++ (Gia anesh sto coding) Ta ri8mizeis.. kai apla trexeis LoginServerConsole GameServerConsole
  19. A ok an ein na to kaneis abebablom psakse prota ta report list. Na doume posei se kanane add Tes pa... kserw apo frozen pes m se pm ti zitas...
  20. Proton... Client ? defteron... Project ? kai telefteo... grapse ti akrivos zitas... dn ginete na se kanoune 10 atoma kai na to paikseis abebablom :) Grapse edo ti 8es h' stile m pm
×
×
  • Create New...