Jump to content

Recommended Posts

Posted

New code  :D

Index: /trunk/L2J-Game/config/main/custom.properties
===================================================================
--- /trunk/L2J-Game/config/main/custom.properties (revision 1639)
+++ /trunk/L2J-Game/config/main/custom.properties (revision 1680)
@@ -266,2 +266,9 @@
PvpRewardItemName = Adena
PvpRewardAmmount = 100
+
+# Allow custom starter items?
+AllowCustomStarterItems = false
+
+# You must allow custom starter items!
+# Usage: id,count;id,count;
+CustomStarterItems = 57,1000;
Index: /trunk/L2J-Game/src/main/java/net/l2jserver/gameserver/network/clientpackets/CharacterCreate.java
===================================================================
--- /trunk/L2J-Game/src/main/java/net/l2jserver/gameserver/network/clientpackets/CharacterCreate.java (revision 1634)
+++ /trunk/L2J-Game/src/main/java/net/l2jserver/gameserver/network/clientpackets/CharacterCreate.java (revision 1680)
@@ -19,4 +19,5 @@
import net.sf.l2j.gameserver.datatables.CharNameTable;
import net.sf.l2j.gameserver.datatables.CharTemplateTable;
+import net.sf.l2j.gameserver.datatables.ItemTable;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.datatables.SkillTreeTable;
@@ -29,4 +30,5 @@
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.model.itemcontainer.PcInventory;
import net.sf.l2j.gameserver.model.quest.Quest;
import net.sf.l2j.gameserver.model.quest.QuestState;
@@ -154,4 +156,27 @@
		if (Config.STARTING_AA > 0)
			newChar.addAncientAdena("Init", Config.STARTING_AA, null, false);
+		
+		// L2EMU_CUSTOM - START
+		for (int[] startingItems : Config.CUSTOM_STARTER_ITEMS)
+		{
+			if (newChar == null)
+			{
+				continue;
+			}
+			PcInventory inv = newChar.getInventory();
+			if (ItemTable.getInstance().createDummyItem(startingItems[0]).isStackable())
+			{
+				inv.addItem("Starter Items", startingItems[0], startingItems[1], newChar, null);
+			} 
+			else
+			{
+				for (int i = 0; i < startingItems[1]; i++)
+				{
+					inv.addItem("Starter Items", startingItems[0], 1, newChar, null);
+				}
+			}
+		}
+		// L2EMU_CUSTOM - END
+		
		//L2EMU_ADD
		newChar.getPosition().setXYZInvisible(template.getSpawnX(), template.getSpawnY(), template.getSpawnZ());
Index: /trunk/L2J-Game/src/main/java/net/l2jserver/Config.java
===================================================================
--- /trunk/L2J-Game/src/main/java/net/l2jserver/Config.java (revision 1664)
+++ /trunk/L2J-Game/src/main/java/net/l2jserver/Config.java (revision 1680)
@@ -25,4 +25,5 @@
import java.math.BigInteger;
import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -867,4 +868,7 @@
	public static String        PVP_REWARD_ITEM_NAME;
	public static int           PVP_REWARD_ITEM_AMMOUNT;
+	
+	public static boolean		ALLOW_CUSTOM_STARTER_ITEMS;
+	public static List<int[]> 	CUSTOM_STARTER_ITEMS = new FastList<int[]>();

	//*********************************************************
@@ -940,4 +944,36 @@
		 	PVP_REWARD_ITEM_NAME = customSettings.getProperty("PvpRewardItemName", "Adena");
		 	PVP_REWARD_ITEM_AMMOUNT = Integer.parseInt(customSettings.getProperty("PvpRewardAmmount", "100"));
+		 	ALLOW_CUSTOM_STARTER_ITEMS = Boolean.parseBoolean(customSettings.getProperty("AllowCustomStarterItems", "false"));
+		
+		 	
+			if (ALLOW_CUSTOM_STARTER_ITEMS)
+			{
+			    String[] propertySplit = customSettings.getProperty("CustomStarterItems", "0,0").split(";");
+			    for (String starteritems : propertySplit)
+			    {
+			    	String[] starteritemsSplit = starteritems.split(",");
+			    	if (starteritemsSplit.length != 2)
+			    	{
+			    		ALLOW_CUSTOM_STARTER_ITEMS = false;
+			    		System.out.println("StarterItems[Config.load()]: invalid config property -> starter items \""+ starteritems + "\"");
+			    	} 
+			    	else
+			    	{
+			    	try
+				    {
+						CUSTOM_STARTER_ITEMS.add(new int[] { Integer.valueOf(starteritemsSplit[0]), Integer.valueOf(starteritemsSplit[1]) });
+				    } 
+				    	catch (NumberFormatException nfe)
+				    	{
+				    		if (!starteritems.equals(""))
+				    		{
+				    			ALLOW_CUSTOM_STARTER_ITEMS = false;
+				    			System.out.println("StarterItems[Config.load()]: invalid config property -> starter items \"" + starteritems + "\"");
+				    		}
+				    	}
+			    	}
+			    }
+			}
+		 	
		}
		catch (Exception e)

Posted

when I create acc i have your custom ytemes:

#Default is 0

StartingAdena = 0

 

+ #Custom item for newChar

+ #(seperated by ",")

+ StartingCustomItems = 3470,1147,425,1146  yes?

 

Posted

Good Work but I think that there are these options in some custom serverpacks.

 

Nope, I found on the forum like this but edit from navicat

 

Credits to me !

Posted

Nice work xAddytzu,thx.

You can tell me how to make a option for fighter and mage plzzz ???

 

Example:

StartingCustomItemsFighters = 3470,1147,425,1146      (Itens only for fighters characters)

StartingCustomItemsMages = 3470,1147,425,1146    (Itens only for mages characters)

I'm searching for this option a long time, but not found =/.

Thx in advanced friend :) !

Posted

Nice work xAddytzu,thx.

You can tell me how to make a option for fighter and mage plzzz ???

 

Example:I'm searching for this option a long time, but not found =/.

Thx in advanced friend :) !

 

hmmm I can make your option

 

after coming from school..today I have test

 

Have a nice day`

Posted

Hey xAddytzu,thx so much friend,i'm very happy :D !

Well , let's go.

 

1 - This patch works nice with Gracia CT2 ?

If yes,look this error:

compile:
   [javac] Compiling 1250 source files to C:\eclipse\L2JSERVER_PT2\L2J_Gameserv
er_PT2\build\classes
   [javac] C:\eclipse\L2JSERVER_PT2\L2J_Gameserver_PT2\java\net\sf\l2j\gameserv
er\network\clientpackets\CharacterCreate.java:190: cannot find symbol
   [javac] symbol  : method addItem(java.lang.String,java.util.List<java.lang.I
nteger>,int,net.sf.l2j.gameserver.model.actor.instance.L2PcInstance,<nulltype>)
   [javac] location: class net.sf.l2j.gameserver.model.itemcontainer.PcInventor
y
   [javac]             newChar.getInventory().addItem("Init", Config.LIST_START
ING_CUSTOMITEMSF, 1, newChar, null);
   [javac]                                   ^
   [javac] C:\eclipse\L2JSERVER_PT2\L2J_Gameserver_PT2\java\net\sf\l2j\gameserv
er\network\clientpackets\CharacterCreate.java:194: cannot find symbol
   [javac] symbol  : method addItem(java.lang.String,java.util.List<java.lang.I
nteger>,int,net.sf.l2j.gameserver.model.actor.instance.L2PcInstance,<nulltype>)
   [javac] location: class net.sf.l2j.gameserver.model.itemcontainer.PcInventor
y
   [javac]             newChar.getInventory().addItem("Init", Config.LIST_START
ING_CUSTOMITEMSM, 1, newChar, null);
   [javac]                                   ^
   [javac] 2 errors

BUILD FAILED
C:\eclipse\L2JSERVER_PT2\L2J_Gameserver_PT2\build.xml:74: Compile failed; see th
e compiler error output for details.

 

2 - Checkout the patch in the download . May be useful for you :) .

http://www.4shared.com/file/106960328/36aa71e8/Custom_Starter_Itens.html

 

3 - I forgot to talk about the amount of item.

Example:

# Usage: id,count;id,count; etc... (1835 = Soulshot: No Grade) (3947 = Blessed Spiritshot: No Grade )

 

StartingCustomItemsFighter = 1835,1000;

StartingCustomItemsMage = 3947,1000;

 

Well,it's all.

Sorry for a lot of questions friend,and thx so much for attention.

Posted

newChar.getInventory().addItem("Init", Config.LIST_STARTING_CUSTOMITEMSF, 1, newChar, null);

 

as i see on the error message heres the problem also i dont understand why newChar.getInventory().addItem since you can use only newChar.addItem...this code needs to look like

 

newChar.addItem("Init", Config.LIST_STARTING_CUSTOMITEMSF, 1, null, false);

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Posts

    • never met a programmer that doesnt know english xD and as he said his knowledge and skills are beyond our imagination xD
    • nice work, welcome back to world of lineage development @melron 😄
    • He's likely baiting you to download his source full of backdoors indeed
    • Yeah inside router i had to enable udnp services 
    • Hello cheaters, As a team of avid developers and enthusiasts of Lineage 2, we are excited to present the L2 Control Hub, a groundbreaking plugin designed by myself and my collaborator, StinkyMadness. This innovative tool equips server administrators with powerful automation capabilities directly within the game's community board. L2 Control Hub simplifies the creation and management of automations, enabling you to customize your server operations without the need to modify the source code.   Key Features of L2 Control Hub: Robust Automation Triggers: Select from a plethora of triggers currently available, with continuous additions in the works to enhance your control options. Dynamic Conditions and Actions: Tailor your server operations with an extensive range of conditions and actions, ensuring flexible and precise control over game events and player interactions. Customizable Variables: Easily integrate server-specific variables from your database to further personalize and streamline your automations. Utilize these variables across various automation scenarios to cater to your specific server requirements. JavaScript Integration: Execute custom JavaScript codes that interact seamlessly with Java classes, bringing advanced functionalities to your server's ecosystem.   Explore L2 Control Hub in Action: We've prepared a series of video tutorials to demonstrate the capabilities of L2 Control Hub: Control Hub - Create a Simple Flow with 1 Condition and 1 Action: Get started with basic automations. Control Hub - Multiple Conditions with Multiple Actions: Explore more complex automations for detailed server management. Control Hub - Using Variables: Discover how to implement and use custom variables for tailored automations. Control Hub - Using JavaScript: Experience the power of custom scripts in enhancing your server functionality.   L2 Control Hub is currently about 70% complete, and we are actively developing and refining features. We invite you to join our ➡️ Discord community ⬅️ to engage with the development process, provide feedback, and be the first to test new features. Additionally, any updates or changes to the plugin are seamlessly delivered to all customers directly from our web server, ensuring your system is always up-to-date without the need for manual downloads.   Your game, your rules, automated. Join us in redefining server management in Lineage 2 and elevate your gaming community with unmatched automation capabilities. For more details, contact us directly to get started with L2 Control Hub.   Currently, the plugin is developed using aCis sources. We will continue with these sources until we finalize all the necessary details before proceeding to integrate with the more prominent sources available.       The L2 Control Hub is designed to extend beyond mere functional additions to your server. We are in the process of implementing a suite of advanced mechanisms, such as a vote manager capable of interfacing with any Lineage 2 voting site without requiring configuration, live statistics to provide admins with real-time insights, and an event engine that can generate any desired event within seconds. All these features will be seamlessly integrated into the module, enhancing your server management experience significantly.     Please note that L2 Control Hub will be a premium tool, reflecting the extensive features and benefits it offers. While we are finalizing the pricing structure, rest assured that we aim to deliver great value for your investment. We will announce the cost details soon on our platforms to ensure everyone is well-informed and can plan accordingly. Join us to take your server management to the next level with L2 Control Hub.     
  • Topics

×
×
  • Create New...