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);

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • You think you have good “l2j” files until you try running a low-rate server.   Saying “there’s not a single L2 server out there worth mentioning” just shows you probably only know the first 10 servers on voting sites, the same voting sites that owned by them. You call the forum dead, yet you’re here discussing your next projects… From my perspective, you don’t seem ready to run any L2 server in 2025. Around 70% of players are here for RMT or ask for payment just to bring their clan, and you really think the community cares about Premium or donations or files quality? The other 20% spend their time downloading and deleting servers all day, playing for one day, then quitting for whatever random reason. And finally, the last 10% are the only ones who actually play because they genuinely like your features, your server files, and your overall project. Good luck 🙂
    • I genuinely admire your bravery - in an age where AI can whip up something better in under a minute, you still stubbornly try to sell these "projects" of yours on a forum that’s been clinically dead for years. That’s no longer determination, that’s digital archaeology. I just can’t tell whether you’re actually trying to make money, or simply testing how much we can endure before we ask an AI to generate you some actual talent.   And ofc AI will make it for free, $220 saved.
    • I’m glad I’m not the only one who appreciates Maxthor’s involvement in group gay orgies, he can’t be bothered to reply to messages, but covering the entire forum in gay lights is absolutely no issue for him. As for the project - the forum is packed with feedback from the testers, the lads are spending every spare moment fixing even the tiniest typo in an NPC’s text. I’ll share the links as soon as I get the green light. Edit: I forgot to add that the GM recruitment will begin once the links are released. Three people will be accepted, and they’ll work in a three-shift rotation so that there’s always a GM available online.
    • Added: a brand-new default dashboard template. You can now add multiple game/login server builds. Full support for running both PTS & L2J servers simultaneously, with switching between them. Payment systems: added OmegaPay and Pally (new PayPal-style API). Account history now stores everything: donations, items delivered to characters, referrals, transfers between game accounts, and coin transfers to another master account. Personal Promo Code System: you can create a promo code and assign it to a user or promoter. When donating, a player can enter this promo code to receive bonus coins, and the promo code owner also receives a bonus — all fully configurable in the admin panel.     Look demo site: demo
    • One of best project i play last few years
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock