Page 3 of 4

Re: Teleporting Item

Posted: Wed Mar 17, 2010 2:46 pm
by janiii
your Config.java is somehow wrong, probably you added the code on wrong place.

Re: Teleporting Item

Posted: Wed Mar 17, 2010 3:45 pm
by Abyssal
BiggBoss wrote:no, what i mean is that you are not understanding what i wrote :roll:
but the only difference i see between the old code and your code is the space between is and =. :D
janiii wrote:your Config.java is somehow wrong, probably you added the code on wrong place.
i cant find where i should add it, a guy here said it doesnt matter where but only if its in the right file so i added it somewhere i thought it fits.

i know i am not that good in java and thats why i am asking for your help.

thank you (again :P)

Re: Teleporting Item

Posted: Wed Mar 17, 2010 4:01 pm
by janiii
what code do you need to add to Config.java ? check how other settings are declared, defined and set in Config.java. look for pther public static final fields, check where other settings from given config file are read out, etc.

or post here your original Config.java and the code you need to add in there.

Re: Teleporting Item

Posted: Wed Mar 17, 2010 5:04 pm
by Abyssal
this is my config.java:
http://www.4shared.com/file/243219832/8 ... onfig.html

and this is the code i want to add:

Code: Select all

Index: C:/Documents and Settings/Albion/workspace/Gracia Core/java/net/sf/l2j/Config.java===================================================================--- C:/Documents and Settings/Albion/workspace/Gracia Core/java/net/sf/l2j/Config.java	(revision 2787)+++ C:/Documents and Settings/Albion/workspace/Gracia Core/java/net/sf/l2j/Config.java	(working copy)@@ -79,7 +79,11 @@     public static final String  SIEGE_CONFIGURATION_FILE						= "./config/siege.properties";     /** Properties file for telnet configuration */     public static final String  TELNET_FILE								= "./config/telnet.properties";-+    /** Properties file for customs configuration */+    public static final String  CUSTOMS_FILE								= "./config/Customs.properties"; @@ -570,7 +573,59 @@+    /** ************************************************** **/+    /** Customs Settings -Begin **/+    /** ************************************************** **/++    public static boolean 	ENABLE_FREE_TELEPORT_SPELLBOOK;+    +      /** ************************************************** **/     /** NPC Settings -Begin                                **/     /** ************************************************** **/ @@ -1897,15 +1954,84 @@ 	                    } 	                } 	              } 	            catch (Exception e) 	            { 	                e.printStackTrace(); 	                throw new Error("Failed to Load "+L2JMOD_CONFIG_FILE+" File."); 	            } +	            // Custom Section Starting +	            /*********************************************************************************************/+	            try+	            {+	                Properties CustomSettings  = new Properties();+	                is                         = new FileInputStream(new File(CUSTOMS_FILE));+	                CustomSettings.load(is);+	              +	              	ENABLE_FREE_TELEPORT_SPELLBOOK	= Boolean.parseBoolean(CustomSettings.getProperty("EnableTeleportSpellbook", "false")); +	                +	            }+	            catch (Exception e)+	            {+	                e.printStackTrace();+	                throw new Error("Failed to Load "+CUSTOMS_FILE+" File.");+	            }  +	             	            // pvp config 	            try 	            {@@ -2333,6 +2477,21 @@         else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;         else if (pName.equalsIgnoreCase("TradeChat"))  DEFAULT_TRADE_CHAT = pValue;         else if (pName.equalsIgnoreCase("MenuStyle"))  GM_ADMIN_MENU_STYLE = pValue; +        else if (pName.equalsIgnoreCase("EnableTeleportSpellbook")) ENABLE_FREE_TELEPORT_SPELLBOOK = Boolean.parseBoolean(pValue);++        ++                 else return false;         return true;     } 

Re: Teleporting Item

Posted: Wed Mar 17, 2010 6:39 pm
by BiggBoss
as i said, where's is declared?

Re: Teleporting Item

Posted: Wed Mar 17, 2010 11:30 pm
by Abyssal
BiggBoss wrote:as i said, where's is declared?
what do you mean "declared"?

Re: Teleporting Item

Posted: Thu Mar 18, 2010 12:57 am
by BiggBoss
over Properties CustomSettings = new Properties(); add:

[java] FileInputStream is; [/java]
and, after ENABLE_FREE_TELEPORT_SPELLBOOK = Boolean.parseBoolean(CustomSettings.getProperty("EnableTeleportSpellbook", "false"));

add

[java] try { is.close();}catch(IOException ioe){ ioe.printStackTrace();} [/java]

Re: Teleporting Item

Posted: Thu Mar 18, 2010 1:37 am
by Abyssal
thank you BigBoss!

but unfortunately only one error was fixed. i hope i added the code correctly look:

Code: Select all

	              	ENABLE_FREE_TELEPORT_SPELLBOOK	= Boolean.parseBoolean(CustomSettings.getProperty("EnableTeleportSpellbook", "false")); +                     try+		     {+		    is.close();+		    }+ 		    catch(IOException ioe)+		    {+		    ioe.printStackTrace();+		    }  	            }	            catch (Exception e)
if this wasnt mistaken look at the error in eclipse:

Code: Select all

    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2010: cannot find symbol    [javac] symbol  : class IOException    [javac] location: class net.sf.l2j.Config    [javac]  		    catch(IOException ioe)    [javac]  		          ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\gameserver\handler\itemhandlers\FreeTeleportItem.java:53: cannot find symbol    [javac] symbol  : variable STATIC_PACKET    [javac] location: class net.sf.l2j.gameserver.serverpackets.ActionFailed    [javac] 		activeChar.sendPacket( ActionFailed.STATIC_PACKET );    [javac] 		                                   ^    [javac] Note: C:\workspace\L2_GameServer_It\java\net\sf\l2j\gameserver\GeoEngine.java uses or overrides a deprecated API.    [javac] Note: Recompile with -Xlint:deprecation for details.    [javac] 2 errors
i guess i dont need to thank you again (but i do anyway :P)

Re: Teleporting Item

Posted: Thu Mar 18, 2010 5:50 am
by janiii
here, your config and the added code: http://www.pastebin.cz/34538

or only the part of code where you had problems:

Code: Select all

            // Custom Settings            try            {                Properties CustomSettings = new Properties();                InputStream is = new FileInputStream(new File(CUSTOMS_FILE));                CustomSettings.load(is);                is.close();                 ENABLE_FREE_TELEPORT_SPELLBOOK = Boolean.parseBoolean(CustomSettings.getProperty("EnableTeleportSpellbook", "false"));            }            catch (Exception e)            {                e.printStackTrace();                throw new Error("Failed to Load " + CUSTOMS_FILE + " File.");            }

Re: Teleporting Item

Posted: Thu Mar 18, 2010 2:08 pm
by Abyssal
thank you for your help man, but you know too many errors this time:

Code: Select all

compile:    [javac] Compiling 1224 source files to C:\workspace\L2_GameServer_It\build\classes    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2013: 'catch' without 'try'    [javac] 	            catch (Exception e)    [javac] 	            ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2013: ';' expected    [javac] 	            catch (Exception e)    [javac] 	                              ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2021: illegal start of type    [javac]             try    [javac]             ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2055: illegal start of type    [javac]             catch (Exception e)    [javac]             ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2055: ';' expected    [javac]             catch (Exception e)    [javac]                               ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2062: illegal start of type    [javac]             try    [javac]             ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2121: illegal start of type    [javac]             catch (Exception e)    [javac]             ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2121: ';' expected    [javac]             catch (Exception e)    [javac]                               ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2127: illegal start of type    [javac]             try    [javac]             ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2136: illegal start of type    [javac]             catch (Exception e)    [javac]             ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2136: ';' expected    [javac]             catch (Exception e)    [javac]                               ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2141: class, interface, or enum expected    [javac]         else if(Server.serverMode == Server.MODE_LOGINSERVER)    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2144: class, interface, or enum expected    [javac]             try    [javac]             ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2147: class, interface, or enum expected    [javac]                 InputStream is               = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2148: class, interface, or enum expected    [javac]                 serverSettings.load(is);    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2149: class, interface, or enum expected    [javac]                 is.close();    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2151: class, interface, or enum expected    [javac]                 GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname","*");    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2152: class, interface, or enum expected    [javac]                 GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9013"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2154: class, interface, or enum expected    [javac]                 LOGIN_BIND_ADDRESS     = serverSettings.getProperty("LoginserverHostname", "*");    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2155: class, interface, or enum expected    [javac]                 PORT_LOGIN            = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2157: class, interface, or enum expected    [javac]                 DEBUG        = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2158: class, interface, or enum expected    [javac]                 DEVELOPER    = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2159: class, interface, or enum expected    [javac]                 ASSERT       = Boolean.parseBoolean(serverSettings.getProperty("Assert", "false"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2161: class, interface, or enum expected    [javac]                 ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer","True"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2162: class, interface, or enum expected    [javac]                 REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2163: class, interface, or enum expected    [javac]                 ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2165: class, interface, or enum expected    [javac]                 LOGIN_TRY_BEFORE_BAN    = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2166: class, interface, or enum expected    [javac]                 LOGIN_BLOCK_AFTER_BAN   = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2167: class, interface, or enum expected    [javac]                 GM_MIN          = Integer.parseInt(serverSettings.getProperty("GMMinLevel", "100"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2169: class, interface, or enum expected    [javac]                 DATAPACK_ROOT    = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile(); //FIXME: in login?    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2171: class, interface, or enum expected    [javac]                 INTERNAL_HOSTNAME   = serverSettings.getProperty("InternalHostname", "localhost");    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2172: class, interface, or enum expected    [javac]                 EXTERNAL_HOSTNAME   = serverSettings.getProperty("ExternalHostname", "localhost");    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2174: class, interface, or enum expected    [javac]                 DATABASE_DRIVER             = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2175: class, interface, or enum expected    [javac]                 DATABASE_URL                = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2176: class, interface, or enum expected    [javac]                 DATABASE_LOGIN              = serverSettings.getProperty("Login", "root");    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2177: class, interface, or enum expected    [javac]                 DATABASE_PASSWORD           = serverSettings.getProperty("Password", "");    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2178: class, interface, or enum expected    [javac]                 DATABASE_MAX_CONNECTIONS    = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2180: class, interface, or enum expected    [javac]                 SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2181: class, interface, or enum expected    [javac]                 IP_UPDATE_TIME                = Integer.parseInt(serverSettings.getProperty("IpUpdateTime","15"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2182: class, interface, or enum expected    [javac]                 FORCE_GGAUTH = Boolean.parseBoolean(serverSettings.getProperty("ForceGGAuth", "false"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2184: class, interface, or enum expected    [javac]                 AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts","True"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2186: class, interface, or enum expected    [javac]                 FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection","True"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2187: class, interface, or enum expected    [javac]                 FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit","15"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2188: class, interface, or enum expected    [javac]                 NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime","700"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2189: class, interface, or enum expected    [javac]                 FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime","350"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2190: class, interface, or enum expected    [javac]                 MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP","50"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2191: class, interface, or enum expected    [javac]             }    [javac]             ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2195: class, interface, or enum expected    [javac]                 throw new Error("Failed to Load "+CONFIGURATION_FILE+" File.");    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2196: class, interface, or enum expected    [javac]             }    [javac]             ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2202: class, interface, or enum expected    [javac]                 InputStream is              = new FileInputStream(new File(TELNET_FILE));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2203: class, interface, or enum expected    [javac]                 telnetSettings.load(is);    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2204: class, interface, or enum expected    [javac]                 is.close();    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2206: class, interface, or enum expected    [javac]                 IS_TELNET_ENABLED   = Boolean.valueOf(telnetSettings.getProperty("EnableTelnet", "false"));    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2207: class, interface, or enum expected    [javac]             }    [javac]             ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2211: class, interface, or enum expected    [javac]                 throw new Error("Failed to Load "+TELNET_FILE+" File.");    [javac]                 ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2212: class, interface, or enum expected    [javac]             }    [javac]             ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2218: class, interface, or enum expected    [javac]         }    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2229: class, interface, or enum expected    [javac]     public static boolean setParameterValue(String pName, String pValue)    [javac]                   ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2233: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2234: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2235: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2236: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RateQuestsReward")) RATE_QUESTS_REWARD = Float.parseFloat(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2237: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RateDropAdena")) RATE_DROP_ADENA = Float.parseFloat(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2238: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RateConsumableCost")) RATE_CONSUMABLE_COST = Float.parseFloat(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2239: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RateDropItems")) RATE_DROP_ITEMS = Float.parseFloat(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2240: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RateDropSpoil")) RATE_DROP_SPOIL = Float.parseFloat(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2241: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RateDropManor")) RATE_DROP_MANOR = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2242: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RateDropQuest")) RATE_DROP_QUEST = Float.parseFloat(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2243: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RateKarmaExpLost")) RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2244: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice")) RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2246: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("PlayerDropLimit")) PLAYER_DROP_LIMIT = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2247: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("PlayerRateDrop")) PLAYER_RATE_DROP = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2248: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("PlayerRateDropItem")) PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2249: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("PlayerRateDropEquip")) PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2250: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon")) PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2252: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("KarmaDropLimit")) KARMA_DROP_LIMIT = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2253: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("KarmaRateDrop")) KARMA_RATE_DROP = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2254: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("KarmaRateDropItem")) KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2255: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("KarmaRateDropEquip")) KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2256: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon")) KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2258: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter")) AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2259: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem")) DESTROY_DROPPED_PLAYER_ITEM = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2260: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("DestroyEquipableItem")) DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2261: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("SaveDroppedItem")) SAVE_DROPPED_ITEM = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2262: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad")) EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2263: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("SaveDroppedItemInterval")) SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2264: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("ClearDroppedItemTable")) CLEAR_DROPPED_ITEM_TABLE = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2266: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2267: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2268: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2269: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2271: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2272: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("AllowFreight")) ALLOW_FREIGHT = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2273: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("AllowWarehouse")) ALLOW_WAREHOUSE = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2274: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("AllowWear")) ALLOW_WEAR = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2275: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("WearDelay")) WEAR_DELAY = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2276: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("WearPrice")) WEAR_PRICE = Integer.parseInt(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2277: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("AllowWater")) ALLOW_WATER = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2278: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("AllowRentPet")) ALLOW_RENTPET = Boolean.valueOf(pValue);    [javac]         ^    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\Config.java:2279: class, interface, or enum expected    [javac]         else if (pName.equalsIgnoreCase("AllowBoat")) ALLOW_BOAT = Boolean.valueOf(pValue);    [javac]         ^    [javac] 100 errors BUILD FAILEDC:\workspace\L2_GameServer_It\build.xml:67: Compile failed; see the compiler error output for details. Total time: 2 seconds
did i do something wrong?

PS: i added the code manually because with copy / paste the line numbers were pasted too and i couldnt delete 2516 numbers.

Re: Teleporting Item

Posted: Thu Mar 18, 2010 2:18 pm
by janiii
just get the Config.java from the pastebin link. at the bottom there is an edit window, where you can copy the code without the line numbers.

in the code tag, you have a link "LINE NUMBER ON/OFF" and "SELECT ALL" . try that when copying code. or hit on quote of the post where the code is, and copy the code from the quote edit box.

Re: Teleporting Item

Posted: Thu Mar 18, 2010 3:04 pm
by Abyssal
thank you man!!!!

1 error left now...

Code: Select all

compile:    [javac] Compiling 1224 source files to C:\workspace\L2_GameServer_It\build\classes    [javac] C:\workspace\L2_GameServer_It\java\net\sf\l2j\gameserver\handler\itemhandlers\FreeTeleportItem.java:53: cannot find symbol    [javac] symbol  : variab[code]
le STATIC_PACKET [javac] location: class net.sf.l2j.gameserver.serverpackets.ActionFailed [javac] activeChar.sendPacket( ActionFailed.STATIC_PACKET ); [javac] ^ [javac] Note: C:\workspace\L2_GameServer_It\java\net\sf\l2j\gameserver\GeoEngine.java uses or overrides a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] 1 error BUILD FAILEDC:\workspace\L2_GameServer_It\build.xml:67: Compile failed; see the compiler error output for details. Total time: 7 seconds[/code]

this is the code in FreeTeleportItem.java:

Code: Select all

package net.sf.l2j.gameserver.handler.itemhandlers; import net.sf.l2j.Config;import net.sf.l2j.gameserver.cache.HtmCache;import net.sf.l2j.gameserver.handler.IItemHandler;import net.sf.l2j.gameserver.model.L2ItemInstance;import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;import net.sf.l2j.gameserver.serverpackets.ActionFailed;import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;   /** * @author Cobra * */ public class FreeTeleportItem implements IItemHandler{	private static final int[] ITEM_IDS =	{     13015	}; 	public void useItem(L2PlayableInstance playable, L2ItemInstance item)	{		if (!(playable instanceof L2PcInstance)) return;		L2PcInstance activeChar = (L2PcInstance) playable; 		String filename = "data/html/custom/items/Teleports.htm";		String content = HtmCache.getInstance().getHtm(filename); 		if (Config.ENABLE_FREE_TELEPORT_SPELLBOOK)		{			if (content == null)			{				NpcHtmlMessage html = new NpcHtmlMessage(1);				html.setHtml("<html><body>The File is Missing, Please Report it To Admin.</body></html>");				activeChar.sendPacket(html);			}			else			{				NpcHtmlMessage itemReply = new NpcHtmlMessage(5);				itemReply.setHtml(content);				activeChar.sendPacket(itemReply);			}		}		else		{			activeChar.sendMessage("The Teleport Spellbook is currently disabled.");		} 		activeChar.sendPacket( ActionFailed.STATIC_PACKET );	} 	public int[] getItemIds()	{		return ITEM_IDS;	}} 
man! if you can help me fix this error too you are the BEST OF THE BEST!

thank you (again :P)

btw im sure the previous one was much harder, i know this is too easy for you...

Re: Teleporting Item

Posted: Thu Mar 18, 2010 3:45 pm
by janiii
change

Code: Select all

ActionFailed.STATIC_PACKET
to

Code: Select all

new ActionFailed()

Re: Teleporting Item

Posted: Thu Mar 18, 2010 4:14 pm
by Abyssal
do you know what is the funny part? that i wasnt expecting it to work...

THANK YOU SO MUCH ALL!

problem solved :D

Re: Teleporting Item

Posted: Thu Mar 18, 2010 5:03 pm
by Abyssal
btw something last (no, really this time :P)...

how can i add chats? you know... teleport.htm, teleport-1.htm etc.

im sorry if you guys got tired with me really... :D