Jump to content

[Share]Starting custom items


Recommended Posts

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)

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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 :) !

Link to comment
Share on other sites

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`

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

    • OUR OFFICIAL WEBSITE / FORUM - MILLENNIUM-HOOK.NET CHEAT DESCRIPTION: Our cheat for Fortnite game has proven itself in the best way among players, the cheat has good optimization, a beautiful visual appearance and has extensive functionality. And reliable protection and HWID Spoofer give our cheat even more advantages over competitors! SUPPORTED ANTI-CHEATS: (read more on official website) - Easy Anti-Cheat (EAC): Undetected & Safe - BattlEye AC: Undetected & Safe - Hyperion AC: Undetected & Safe Our Fortnite cheat has a limited number of slots to ensure greater product security! (Available slots check on official website) FEATURES: AIMBOT: - Aim bone - Silent aim - Smooth - Fov - Distance - Key ESP: - Players - Loot - Vehicles - Traps - Other MISC: - No bloom - No spread - Vehicle flight - Instarevive - Aim while Jumping - Teleport to players within 4m (10m with pickaxe) or teleport downed players to you. - Teleport key - Fov changer REQUIREMENTS: - Included HWID Spoofer: Yes - Stream Bypass: No (Engineering works. Will be available again soon). - Supported game modes: Windowed, Borderless - Supported platforms: Steam / Uplay / Epic Games - Supported CPU: Intel & AMD - Supported OS: Windows 10 (1903,1909,2004,20H2,21H1, 22H2), Windows 11 (All version). Supported OS change and are added periodically. More check on official website.   IN-GAME SCREENSHOTS:   - Check on the official website.
    • OUR OFFICIAL WEBSITE / FORUM - MILLENNIUM-HOOK.NET CHEAT DESCRIPTION: We are offering the best in market Division 2 hacks without detection. If you are wondering where to get the best cheats and hacks for The Division 2, you are at the right place! Our private TD2  hack has been completely undetected since we released it! Also, our cheat has all the most necessary functions such as aimbot, esp, etc. And the limited slots will give even more security to our product. SUPPORTED ANTI-CHEATS: (read more on official website) - Easy Anti-Cheat (EAC): Undetected & Safe - FairFight AC: Undetected & Safe Our The Division 2 cheat has a limited number of slots to ensure greater product security! (Available slots check on official website) FEATURES: AIMBOT: - Enable aim - No recoil - Silent aim - Aim distance - Aim fov - Draw aim fov - Fov change - Weakspot - Aim hitbox - Head - Neck - Chest - Random ESP: - Enable visuals - Enable radar - Skeleton - Weakspot - Pre-rendering - ESP distance - Radar distance - Auto - Enemy - Name - Blacklist - Whitelist - Custom color - Clear whitelist - Clear blacklist MISC: - Auto fire/Triggerbot - Rapid of fire rate - Shotgun of fire rate - Magic bullets - Fast reload - Unlimited ammo - Shoot in safehouse - Accelerate - Noclip REQUIREMENTS: - Included HWID Spoofer: Yes - Stream Bypass: Yes - Supported game modes: Windowed, Borderless - Supported platforms: Steam / Uplay / Epic Games - Supported CPU: Intel & AMD - Supported OS: Windows 10 (1903,1909,2004,20H2,21H1, 22H2), Windows 11 (All version). Supported OS change and are added periodically. More check on official website.   IN-GAME SCREENSHOTS:   - Check on the official website.
    • 50% discount for the next 3 copies Price 150 , will try for test server not guaranteed
    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hoodservices https://campsite.bio/utchihaamkt  
  • Topics

×
×
  • Create New...