Jump to content

SQL Developer

VIP Member
  • Posts

    727
  • Credits

  • Joined

  • Last visited

  • Days Won

    2
  • Feedback

    0%

Everything posted by SQL Developer

  1. R.I.P kai apo emena .. ta silipitiria mou ... se olous osous diavazoun afto to post kai ton kseran prosopika san anthropo ..
  2. Hey mates,i am making a PvP server and i think to avoid bugs to delete all NPC exept the standard like classmanager,dye manager,wherehouse etc. *Clan quest items *Noble Status item I will have any problem if i delete all the npc's on quest's or on sieges? someone who have allready delete all npcs answer me .. thanks
  3. L2JFrozen Rev:1004 com.l2jfrozen.gameserver.network.clientpackets.RequestRestartPoint.java if (activeChar.getKarma() > 0 && Config.ALT_KARMA_TELEPORT_TO_FLORAN) { loc = new Location(17836, 170178, -3507);// Floran Village break; } - loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town); + loc = new Location(11135, 15788, -4611); break; } // Stand up and teleport, proof dvp video. activeChar.setIsIn7sDungeon(false); i want pass this but on sieges death respawn will be normal .. how is work ?
  4. Today i try pass a code for a custom Vip/Donate item but code have some wrong's sweets correct them from me and i decide to re-share it Credits on Original post: here For people who dont know how to find the item id is the : 6673 .. ### Eclipse Workspace Patch 1.0 #P L2jFrozen_Gs Index: head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java =================================================================== --- head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java (revision 946) +++ head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java (working copy) @@ -65,6 +66,7 @@ import com.l2jfrozen.gameserver.handler.itemhandlers.SpecialXMas; import com.l2jfrozen.gameserver.handler.itemhandlers.SpiritShot; import com.l2jfrozen.gameserver.handler.itemhandlers.SummonItems; +import com.l2jfrozen.gameserver.handler.itemhandlers.VipItem; /** * This class manages handlers of items @@ -144,6 +147,7 @@ registerItemHandler(new ExtractableItems()); registerItemHandler(new SpecialXMas()); registerItemHandler(new SummonItems()); + registerItemHandler(new VipItem()); registerItemHandler(new BeastSpice()); registerItemHandler(new JackpotSeed()); registerItemHandler(new NobleCustomItem()); ### Eclipse Workspace Patch 1.0 #P L2jFrozen_Gs Index: head-src/com/l2jfrozen/gameserver/handler/itemhandlers/VipItem.java =================================================================== --- head-src/com/l2jfrozen/gameserver/handler/itemhandlers/VipItem.java (revision 0) +++ head-src/com/l2jfrozen/gameserver/handler/itemhandlers/VipItem.java (working copy) @@ -0,0 +1,145 @@ +/* + * 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 com.l2jfrozen.gameserver.handler.itemhandlers; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import com.l2jfrozen.Config; +import com.l2jfrozen.gameserver.handler.IItemHandler; +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance; +import com.l2jfrozen.util.CloseUtil; +import com.l2jfrozen.util.database.L2DatabaseFactory; + +/** + * @author Crystalia + * + */ +public class VipItem implements IItemHandler +{ + + private static final int ITEM_IDS[] = { + 6673 + }; + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private void updateDatabase(L2PcInstance player, boolean newDonator) + { + Connection con = null; + try + { + // prevents any NPE. + // ---------------- + if(player == null) + return; + + // Database Connection + //-------------------------------- + con = L2DatabaseFactory.getInstance().getConnection(false); + PreparedStatement stmt = con.prepareStatement(newDonator ? INSERT_DATA : DEL_DATA); + + // if it is a new donator insert proper data + // -------------------------------------------- + if(newDonator) + { + stmt.setInt(1, player.getObjectId()); + stmt.setString(2, player.getName()); + stmt.setInt(3, player.isHero() ? 1 : 0); + stmt.setInt(4, player.isNoble() ? 1 : 0); + stmt.setInt(5, 1); + stmt.execute(); + stmt.close(); + stmt = null; + } + else + // deletes from database + { + stmt.setInt(1, player.getObjectId()); + stmt.execute(); + stmt.close(); + stmt = null; + } + } + catch(Exception e) + { + if(Config.ENABLE_ALL_EXCEPTIONS) + e.printStackTrace(); + + + } + finally + { + CloseUtil.close(con); + } + } + + // Updates That Will be Executed by MySQL + // ---------------------------------------- + String INSERT_DATA = "REPLACE INTO characters_custom_data (obj_Id, char_name, hero, noble, donator) VALUES (?,?,?,?,?)"; + String DEL_DATA = "UPDATE characters_custom_data SET donator = 0 WHERE obj_Id=?"; + + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + if(activeChar.isDonator()) + { + activeChar.sendMessage("You are already a donator.You cannot use that item."); + return; + } + playable.destroyItem("Consume", item.getObjectId(), 1, null, false); + activeChar.setDonator(true); + updateDatabase(activeChar, true); + activeChar.sendMessage("Thanks for using our item in order to be server's donator."); + activeChar.broadcastUserInfo(); + + + } + +} \ No newline at end of file
  5. ok thanks both of you i will test it sweets and i will reply thanks for support :)
  6. Done and new error come out of the box ... [javac] C:\Users\George\workspace\trunk\gameserver\head-src\com\l2jfrozen\gameserver\handler\itemhandlers\VipItem.java:110: error: unreachable statement [javac] playable.destroyItem("Consume", item.getObjectId(), 1, null, false); [javac] ^ [javac] 1 error what is wrong -.- bad bad bad code
  7. Hey can someone fix for me this code .. i use L2JFrozen latest version =================================================================== --- head-src/com/l2jfrozen/gameserver/handler/itemhandlers/VipItem.java (revision 0) +++ head-src/com/l2jfrozen/gameserver/handler/itemhandlers/VipItem.java (working copy) @@ -0,0 +1,145 @@ +/* + * 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 com.l2jfrozen.gameserver.handler.itemhandlers; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import com.l2jfrozen.Config; +import com.l2jfrozen.gameserver.handler.IItemHandler; +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance; +import com.l2jfrozen.util.CloseUtil; +import com.l2jfrozen.util.database.L2DatabaseFactory; + +/** + * @author Crystalia + * + */ +public class VipItem implements IItemHandler +{ + + private static final int ITEM_IDS[] = { + 6673 + }; + + @Override + public int[] getItemIds() + { + return ITEM_IDS; + } + + private void updateDatabase(L2PcInstance player, boolean newDonator) + { + Connection con = null; + try + { + // prevents any NPE. + // ---------------- + if(player == null) + return; + + // Database Connection + //-------------------------------- + con = L2DatabaseFactory.getInstance().getConnection(false); + PreparedStatement stmt = con.prepareStatement(newDonator ? INSERT_DATA : DEL_DATA); + + // if it is a new donator insert proper data + // -------------------------------------------- + if(newDonator) + { + stmt.setInt(1, player.getObjectId()); + stmt.setString(2, player.getName()); + stmt.setInt(3, player.isHero() ? 1 : 0); + stmt.setInt(4, player.isNoble() ? 1 : 0); + stmt.setInt(5, 1); + stmt.execute(); + stmt.close(); + stmt = null; + } + else + // deletes from database + { + stmt.setInt(1, player.getObjectId()); + stmt.execute(); + stmt.close(); + stmt = null; + } + } + catch(Exception e) + { + if(Config.ENABLE_ALL_EXCEPTIONS) + e.printStackTrace(); + + + } + finally + { + CloseUtil.close(con); + } + } + + // Updates That Will be Executed by MySQL + // ---------------------------------------- + String INSERT_DATA = "REPLACE INTO characters_custom_data (obj_Id, char_name, hero, noble, donator) VALUES (?,?,?,?,?)"; + String DEL_DATA = "UPDATE characters_custom_data SET donator = 0 WHERE obj_Id=?"; + + @Override + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + if(!(playable instanceof L2PcInstance)) + return; + L2PcInstance activeChar = (L2PcInstance)playable; + + if(activeChar.isDonator()) + { + activeChar.sendMessage("You are already a donator.You cannot use that item."); + return; + playable.destroyItem("Consume", item.getObjectId(), 1, null, false); + activeChar.setDonator(true); + updateDatabase(activeChar, true); + activeChar.sendMessage("Thanks for using our item in order to be server's donator."); + activeChar.broadcastUserInfo(); + + + } + +} \ No newline at end of file Problem is : [javac] C:\Users\George\workspace\trunk\gameserver\head-src\com\l2jfrozen\gameserver\handler\itemhandlers\VipItem.java:119: error: reached end of file while parsing [javac] } [javac] ^ [javac] 1 error
  8. btw if you use frozen have allready this configuration
  9. [javac] Compiling 1476 source files to C:\Users\George\workspace\trunk\gameserver\build\classes [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7 [javac] C:\Users\George\workspace\trunk\gameserver\head-src\com\l2jfrozen\gameserver\handler\itemhandlers\VipItem.java:119: error: reached end of file while parsing [javac] } [javac] ^ [javac] 1 error [javac] 1 warning can someone help?
  10. it was very helpfull for me i will use it on my pack
  11. Hey i am try to add a code on eclipse but i fail on it because i can find the correct line number,can someone help me to learn about line numbers? for example the code who i want pass tells: The line @@ -843,4 +844,57 @@ .. what means? which line is it? @@ -843,4 +844,57 @@ } + public L2ItemInstance[] getWeaponsList() + { + FastList<L2ItemInstance> list = FastList.newInstance(); + for (L2ItemInstance item : _items) + { + if ((item != null) && (item.isEnchantable()) && item.isWeapon()) + { + int enchantLevel = Config.weaponEnchantLevel; + if (Config.modifyItemEnchant) + { + if (Config.modifyItemEnchantList.containsKey(item.getItemId())) + { + enchantLevel = Config.modifyItemEnchantList.get(item.getItemId()); + } + } + + if(item.getEnchantLevel() < enchantLevel) + list.add(item); + } + } + + L2ItemInstance[] result = list.toArray(new L2ItemInstance[list.size()]); + FastList.recycle(list); + return result; + } + + public L2ItemInstance[] getArmorsList() + { + FastList<L2ItemInstance> list = FastList.newInstance(); + for (L2ItemInstance item : _items) + { + if ((item != null) && (item.isEnchantable()) && item.isArmor()) + { + int enchantLevel = Config.armorEnchantLevel; + if (Config.modifyItemEnchant) + { + if (Config.modifyItemEnchantList.containsKey(item.getItemId())) + { + enchantLevel = Config.modifyItemEnchantList.get(item.getItemId()); + } + } + + if(item.getEnchantLevel() < enchantLevel) + { + list.add(item); + } + } + } + + L2ItemInstance[] result = list.toArray(new L2ItemInstance[list.size()]); + FastList.recycle(list); + return result; + } }
  12. tote kaneis kati la9os stis rithmiseis tou modem sou alla dustixos den exw idea apo to modem .. giati den pairneis thn wind na se voithisei ?
  13. Des afto to post mou kai pigene sto simeio pou kaneis setup to modem kai koita an ta ekanes ola kala
  14. pinakas elenxou->teixos prostasias twn windows->rithmiseis gia proxorimenous->kanones eiserxomenon->dimiourgia kanona->thura->epomeno->sigkekrimenes topikes thires(vazeis prwta to 80 p.x meta ksana kaneis afthn thn diadikasia kai vazeis kai ta upoloipa ports) kathos kaneis thn diadikasia pros to telos tis 9a sou valei "onoma thuras:" esy vale to idio onoma pou evales kai sta ports tou modem sou .. elpizo afto na htan to provlima
  15. Hey i would like to sell my lol account on EUNE if you are interesting contact me on forum. "i wont give account 1st in randoms,only in trusted buyers|sellers" Account have: 48 champion | 13 Skins alistar Skin. annie evelin ez Skin. akali amumu anivia ashe veigar vel'koz yiorik garen ww Skin. mundo eliz Skin. zyra x2 Skin. xin zhao karma kayle Skin. kenen cassiopia Skin. katarina leblan malphite master yi morgana blitz nasus nidali nunu pantheon Skin. popi ryze saion sako Skin. sivir sidge soraka sona Skin. tarik teemo janna Skin. jax trinda tristana Skin. fiddle Skin. fizz olaf Skin. Also got 4 runes page and 15 different runes. x3-7 Paywar:Paypal Account cost:60euro Photo is on Greek sorry about that
  16. well both of java projects on 2015 after 8 years of creation they are in so hight level and soon we will see java will be like L2OFF PvP server:Frozen Low/Mid server:Acis(acis latest updates,with payment will be the best) (why? because on acis many quest is working and in my opinion soon .. 1years +- will be stable as L2OFF)
  17. so i need and the same gb .. i will call tomorrow to the shop to ask
  18. Hello,before some days i bought new desktop Motherboard have x2 ram channels so x4 ram slot When i bought pc i bought also 8gb ram ddr3 1600hz and i put it on 1st channel 1st ram slot Today i bought one more ram 2gb ddr 1600 (same company with other) same features just gb differents I try put it on same channel with 8gb but nothink pc dont even open i try put in on other channel 1st ram slot .. also nothink pc dont open I try put in on other channel 2nd ram slot and finaly open but i have a warning System configuration warning: Try put your DDR1 ram on DDR2 or DD3 .. i try it but nothink pc dont open .. So now i have 8gb ram on DDR1 and 2gb on DDR4 and open normaly(with warning) but on computer say: 10GB ram,8 for use .. i try fix it on msconfig but nothink .. Any idea what i have to do? BTW Ram 8gb is black collor 2gb is green .. this is important maybe? i have Motherboard: GIGABYTE 78LMT-USB3 .. i hope you will help me .. thanks
  19. Hello i am searching a tool to make some donators npcs who only them can use it .. Using L2JFrozen , //setdonator allready code passed
  20. i bought AMD FX 6 CORE 3.5Ghz 8GB ram Graphic GEFORCE GTX 750 And motherboard Gigabyte 78LMT-USB3 550W i think it was a good set but also i think i need a better cpu cooler and more 4 gb ram so people who will buy AMD remember AMD need a good cooler
×
×
  • Create New...