Jump to content

Question

Posted (edited)

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

6 answers to this question

Recommended Posts

  • 0
Posted

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
  • 0
Posted (edited)

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
  • 0
Posted (edited)

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
  • 0
Posted

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

  • 0
Posted

 

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

  • 0
Posted
           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.

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
Answer this question...

×   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

    • For exact same reason - there were accusation that I scammed. When was it? 2016? But in that time, admins actually didn't listen. I got banned, then unbaned (when I prooved I've refunded) but I was trash talking to mods. When few months later same shit happened, Grisom (?) old global mod, banned me anyway. You can read somewhere on forum how I was shitting on him for doing that (from other account because original account was banned) - which was banned too. He is not here anymore I think. Back in the days I was well know for not carring that much if I was talking to mod or admin, I didn't hold my tongue. Now You know. Just like You know - if I delay, I deliver or refund. I'm not a scammer, even if my old time haterz love to repeat themselfs like mantra. I don't care.
    • Okay I respect that but why is your other account banned?   I don't think this happened just because you delayed somebodys work even in 2012
    • Do You understand the fact, I won't scam anyone? Can You grasp such idea?  Second of all, if a random restaurant on Google Maps has 599 positive reviews and few negative ones with 4,8* score, do You ask Google to block it's profile and burn the place down? No? Then why the fuck You are crying about my random delays? If someone can't get a CUSTOM DESIGN on time, I refund. I'm not 16  y.o. anymore. I don't make living out of this L2 bullshit. Never did. Since 2012 I've made shit tons of projects. How many delays did I have? 12? 15? Out of hundrets of projects. Calm Your tits please. If I would actually take 4k euro and NOT deliver and NOT refund - admins can ban me. So don't compare me to Simple. And just so You know, Celestine sent me customers, so it's not like I've worked with him on his account all the time. That's another thing You won't understand. I won't waste anymore time on You and any other cunt who never was my customer but is bitching just because he has nothing better to do in his life. You don't like my work? Hove along, I don't give a shit. 
    • So he's like unsimple you would say? Cherry picking who's getting scammed.   Deliver 5 projects, don't deliver/delay the other 2 projects. Of course he won't scam you because he know what's gonna happen after since he's dealing with the admin himself.
  • Topics

×
×
  • Create New...