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?

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

  • 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?

Link to comment
Share on other sites

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


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.