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

    • someone ban again this piece of shit this guy is a virus we should make an antikara or karabytes
    • 🍂 The cost on Vibe-sms is dropping, like autumn leaves falling from the trees.     It’s a little sad to watch the last days of summer fade away with its warmth, but that’s how the world works  every season has its own rules. The same goes for our prices: they are gradually but steadily going down, opening up new opportunities and great deals. 💸   🌍 USA is already at the minimum, and Europe, Asia, and dozens of other countries will follow soon. Don’t miss out  fresh rates are waiting for you!   Website link — https://vibe-sms.net/ Our Telegram channel — https://t.me/vibe_sms
    • You didn't tell me anywhere that you wanted core.jar as proof, I have everything ready for an independent developer to review. All the conversations, all your edits. I won't settle anything with you, so you can threaten me again and damage my name.
    • So what? Did i say anything wrong? You have no idea what source/compile is. I still wait for your .jar or source to be posted since you say i destroyed the compiled version of yours. Why you don't post it? Are you afraid that people will just see few addon lines and you did not even know that your source and compiled had different things? I should not even waste 2 minute to fix your raidboss_spawnlist thing.    Your mentally ill. What you posted is our primary deal nothing against me.  Because all he does is post whatever i write as if i hide and i did not say any mod to join and check my discord. i want him actual post something against me or any offenses i did. I also requested him several hours ago to post his .jar where my code "HACKED" his server but he wont post.    Nobody should allow open a random topic and cause issues to other's life without proofs. I demand punishment and soon unless he post evidence that i hurt his server or left him or did not make what he asked. 
  • 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