Jump to content
Home

SetItemAttr

Recommended Posts

Hi Pirates

 

Explanation

Im trying to make an apparel unfusion script. It works well with unseal items like Blade of Enigma... But im having problem when unfusing items with random bonus attrs. Ex: Shoes giving +3str, 1spr. The script supposed to SetItemAttr on a new made item, but the SetItemAttr function does not actually works in attrs that does not cames in the original item.

 

Example

SetItemAttr(item, ITEMATTR_VAL_STR, 99)

It will not work if the item does not comes with some STR bonus already.

 

Question

Do someone know how to SetItemAttr an attr that does not comes with the item?

 

Share this post


Link to post
Share on other sites

Hello, Home. I didn't get how your unfusion script works, it supposed to give to players the original item "ITEMATTR_VAL_FUSIONID" and apparel. Anyway, to create a new attr to a item you can use the function Creat_Item_Tattr(), located in AttrCalculate.lua. Keep in mind that you can set up to 5 new attrs to a item..
 

	if item_event == 88 then
		for i = ITEMATTR_VAL_STR, ITEMATTR_VAL_STA do
			Add_Item_Attr(i, 0);
		end
	end

This example above, when item created with quality 88, normal attrs (str, con, agi, spr, dex) will set equal 0. After that you can use SetItemAttr normally

  • Like 1

lelouch_signature_by_vahntheknight-d4uafwj.png

Share this post


Link to post
Share on other sites

Thank you @Satan, it finally works. But now i got a new problem...

Since since it has a limit of attrs, i cannot use an item_event that covers attrs of each randomly attr item.

Edited by Home

Share this post


Link to post
Share on other sites
В 21.12.2017 в 16:59, Satan сказал:

Hello, Home. I didn't get how your unfusion script works, it supposed to give to players the original item "ITEMATTR_VAL_FUSIONID" and apparel. Anyway, to create a new attr to a item you can use the function Creat_Item_Tattr(), located in AttrCalculate.lua. Keep in mind that you can set up to 5 new attrs to a item..
 


	if item_event == 88 then
		for i = ITEMATTR_VAL_STR, ITEMATTR_VAL_STA do
			Add_Item_Attr(i, 0);
		end
	end

This example above, when item created with quality 88, normal attrs (str, con, agi, spr, dex) will set equal 0. After that you can use SetItemAttr normally

So good, but why only 5 attrs available?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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


×
×
  • Create New...