Jump to content
  • 0

[help]Deite to topic plz!!!


Question

Posted

Soz guys exei ksanagine to topic alla to locked... Thelw na arxizoun oi new chars me items pou tha tous vazw egw..To erwtima einai pos mporw na ta valw auta ta items..Milame se Freya client..Enas me eipe meso tou char_template sto tellos leei item1, item2 ktlp..alla dn me leei tpt...plz help

5 answers to this question

Recommended Posts

  • 0
Posted

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)

 

credits to xAddytzu  ..........

elpizw na helpara

  • 0
Posted

Soz guys exei ksanagine to topic alla to locked... Thelw na arxizoun oi new chars me items pou tha tous vazw egw..To erwtima einai pos mporw na ta valw auta ta items..Milame se Freya client..Enas me eipe meso tou char_template sto tellos leei item1, item2 ktlp..alla dn me leei tpt...plz help

Kala sou eipan.apo tn database 8a pas sto table char_template.Ekei 8a deis kapoies stiles m name items1,items2.items3,items4,items5. Ekei vazeis to id tou item pou 8eleis!etc ginete an dn gnwrizeis apo java
  • 0
Posted

Kala sou eipan.apo tn database 8a pas sto table char_template.Ekei 8a deis kapoies stiles m name items1,items2.items3,items4,items5. Ekei vazeis to id tou item pou 8eleis!etc ginete an dn gnwrizeis apo java

 

me to  na peraseis ta id ton items pou 8eleis  stin navicat den einai to poio  efkolo  pragma giati 8a 8eleis na peraseis sigkekrimena items kai ektos apo ayto  den mporeis na  perasei to  orio enno me to java code mporeis na valeis ta id pou 8eleis xwris kanena provlima...

  • 0
Posted

Kala sou eipan.apo tn database 8a pas sto table char_template.Ekei 8a deis kapoies stiles m name items1,items2.items3,items4,items5. Ekei vazeis to id tou item pou 8eleis!etc ginete an dn gnwrizeis apo java

 

Sto freya dn exei sto char_template to item1,item2 kai etsi.. einai se allo table to vrika telika!!!

  • 0
Posted

einai se allo table to vrika telika!!!

 

Άμα θες κάτι άλλο κάνε με πμ να το κάνω unlock.

Guest
This topic is now closed to further replies.
×
×
  • Create New...