Jump to content
  • 0
Sign in to follow this  
kforce

[Lua] Get attr bonus from item

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?

Share this post


Link to post

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.

Share this post


Link to post
  • 0
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.

Share this post


Link to post
  • 0

I think he means the attr's of the item. But the function does only returns value0-value5, not the attr's in it.

Share this post


Link to post
  • 0

I think he means the attr's of the item. But the function does only returns value0-value5, not the attr's in it.

Yep, thats the problem. There aren't a way to do it without modify the source right?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

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.