Skip to content

Added Newbie Items

Featured Replies

Hi everybody,

 

i try at the moment to add some items for newbies.

But it doesnt work and i think i do something wroung.

It tried this:

ItemTable.getInstance();
        L2Item[] items = template.getItems();
        for (L2Item item2 : items)
        {
            L2ItemInstance item = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null);
            L2ItemInstance item1 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null);
            L2ItemInstance item11 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null);
            if (item.getItemId() == 5588)
            {
                if (item1.getItemId() == 3470)
                {
                    if (item11.getItemId() == 5134)
                    {
                    }
                    
                }

But it dont know what i need to do exactly.

Thanks in advance.

sir

Edited by sirreaven

go to CharacterCreate.java and add this

			}
		}
		
+		/** Custom Starting Items */
+		if (Config.ENABLE_NEWCHAR_ITEMS)
+		 {
+			 newChar.getInventory().addItem("New Item", Config.STARTING_ITEM_ID , Config.STARTING_ITEM_COUNT, newChar, null);
+		 }
		
		for (L2SkillLearn skill : SkillTreeTable.getInstance().getAvailableSkills(newChar, newChar.getClassId()))
		{

and the configs

    /** New Char Items */
    public static boolean ENABLE_NEWCHAR_ITEMS;
    public static int STARTING_ITEM_ID;
    public static int STARTING_ITEM_COUNT;
/** New Char Items */
ENABLE_NEWCHAR_ITEMS = Boolean.parseBoolean(customstarting.getProperty("EnableNewcharItems", "False"));
STARTING_ITEM_ID = Integer.parseInt(customstarting.getProperty("StartingItemId", "50000"));
STARTING_ITEM_COUNT = Integer.parseInt(customstarting.getProperty("StartingItemCount", "1"));
# ----------------------------------
# Custom Starting Item
# ----------------------------------
# Enable Custom Starting Item?
# Default: False
EnableNewcharItems = True
StartingItemId = 50005
StartingItemCount = 1

Hi everybody,

 

i try at the moment to add some items for newbies.

But it doesnt work and i think i do something wroung.

It tried this:

ItemTable.getInstance();
        L2Item[] items = template.getItems();
        for (L2Item item2 : items)
        {
            L2ItemInstance item = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null);
            L2ItemInstance item1 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null);
            L2ItemInstance item11 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null);
            if (item.getItemId() == 5588)
            {
                if (item1.getItemId() == 3470)
                {
                    if (item11.getItemId() == 5134)
                    {
                    }
                    
                }

But it dont know what i need to do exactly.

Thanks in advance.

sir

bist du deutcher oder?? and you can add items with xml's

Edited by Reborn12

First line is useless, then you decide to iterate over template items, and for each item you decide to add 3 items on player inventory.

            if (item.getItemId() == 5588)
            {
                if (item1.getItemId() == 3470)
                {
                    if (item11.getItemId() == 5134)
                    {
                    }

is a logcial nonsense, because if your item got 5588, it can't be 3470, and if it's 3470, it can't be 5134. You also have to refer to item2, as it's the current name you give on the for loop to iterate over the template items. So you probably meant :

if (item2.getItemId() == X)
doSomething();
else if (item2.getItemId() == Y)
doAnotherThing();
else if (item2.getItemId() == Z)
doCrappyThing();

I also guess you misunderstand the use of for loop. Maybe it's time to read about it...?

Edited by Tryskell

  • Author

bist du deutcher oder?? and you can add items with xml's

 

Guten Abend,

genau das bin ich :)

Wie kann ich Newbie Items mit ner simplen xml hinzufügen?

 

 

 

Thank you all for the help :)

Im happy no flame or trash :)

Just some helpful comments :)

 

go to CharacterCreate.java and add this

			}
		}
		
+		/** Custom Starting Items */
+		if (Config.ENABLE_NEWCHAR_ITEMS)
+		 {
+			 newChar.getInventory().addItem("New Item", Config.STARTING_ITEM_ID , Config.STARTING_ITEM_COUNT, newChar, null);
+		 }
		
		for (L2SkillLearn skill : SkillTreeTable.getInstance().getAvailableSkills(newChar, newChar.getClassId()))
		{

and the configs

    /** New Char Items */
    public static boolean ENABLE_NEWCHAR_ITEMS;
    public static int STARTING_ITEM_ID;
    public static int STARTING_ITEM_COUNT;
/** New Char Items */
ENABLE_NEWCHAR_ITEMS = Boolean.parseBoolean(customstarting.getProperty("EnableNewcharItems", "False"));
STARTING_ITEM_ID = Integer.parseInt(customstarting.getProperty("StartingItemId", "50000"));
STARTING_ITEM_COUNT = Integer.parseInt(customstarting.getProperty("StartingItemCount", "1"));
# ----------------------------------
# Custom Starting Item
# ----------------------------------
# Enable Custom Starting Item?
# Default: False
EnableNewcharItems = True
StartingItemId = 50005
StartingItemCount = 1

 

this will add item not items

           L2ItemInstance item = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null);
            L2ItemInstance item1 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null);
            L2ItemInstance item11 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null);
            if (item.getItemId() == 5588)
            {
                if (item1.getItemId() == 3470)
                {
                    if (item11.getItemId() == 5134)
                    {
                    }
                    
                }

It's dead code because item == item1 == item11.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.