Jump to content

[Lua] Get attr bonus from item


Recommended Posts

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

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • Recently Browsing

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