Jump to content
×
×
  • Create New...
  • 0

[Lua] Get attr bonus from item


kforce

Question

With the function item.set_value() we can set a attr bonus to an item, but my question is if we can get what bonus are on that item, i know that exists a function called item.get_value() but this doesn't seem to return the attr bonus. Alto, the argument that we need to set on that function is limited to 5.

7N8r4.jpg

 

 

quest test begin
	state start begin
		when 9003.take begin
			for i = 0,5 do
				say(i..": "..item.get_value(i))
			end
		end
	end
end

I used this simple code to get all the values of a item, and thats what i got from a black steel armour+9 without any attr:

7Na6s.jpg

 

 

Am i using it right? Or this function simply doesn't return the attr bonus?

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Answers 5
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

5 answers to this question

Recommended Posts

  • 0

Try this:

quest test begin
    state start begin
        when 9003.take begin
             chat(i..": "..item.get_value(item.get_vnum()))
        end
    end
end

You do it wrong because you set on the function item.get_value the integer 'i' so the function takes the id's from 0-5.

 

Regards.

Link to comment
Share on other sites

  • 0
  • Premium
quest test begin
    state start begin
        when 9003.take begin
             chat(i..": "..item.get_value(item.get_vnum()))
        end
    end
end

chat(i.." ???

 

you did not call that variable, how do you pretend to use it?

 

 

quest test begin
    state start begin
        when 9003.take begin
             chat(item.get_value(item.get_vnum()))
        end
    end
end

try this.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Answer this question...

×   Pasted as rich text.   Restore formatting

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.