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
Hello, lovely people, how are you? I just finished compiling the L2jFrozen project Rev: 1132 (very old).
I don't mind it being too old, since the project is for me and my children. (LAN/Offline) it's not meant to be put online. I want to learn and give my children more comfort when playing. And for my part, I also experiment with the game.
My problem is that I don't know much about the subject. I was able to make some basic configurations to my liking and that of my children, but it never compiles or anything like that... I would really need help from you, the community... I simply want to remove all subclass restrictions, remove the restriction on "Overlord, Warsmith, and Dark Elf subclasses with White Elves and vice versa." Thank you very much in advance! Greetings, community.
Warriors, prepare for a new era!
We are pleased to announce that on July 12, with the morning restart, Airin will be updated to Chronicle 4: Scions of Destiny.
- Open Beta Testing (OBT) will begin on July 9. Everyone will be able to test the update in advance, including class mechanics, quests, and new content.
- The Clan Hall Auction will take place on July 13.
We’ve also prepared a traditional bonus start - details will be shared in the coming days.
The full list of changes is available in the official patch notes.
Thank you for your support and participation in the project. See you in Chronicle 4!
The game client download will be available soon.
Question
SQL Developer
Hey can someone fix for me this code .. i use L2JFrozen latest version
Problem is :
7 answers to this question
Recommended Posts