Jump to content
  • 0

How to dynamically display item's description by server-side ? How to edit Lua ?


EXPPOC

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  11/12/22
  • Last Seen:  

Posted (edited)

Can you teach me how to get the value from the server and dynamically display it in the item's description?

How to write iteminfo.lua to get the server value?

like this

 

01.jpg

Edited by EXPPOC
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  919
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

On 5/14/2024 at 8:28 AM, EXPPOC said:

Can you teach me how to get the value from the server and dynamically display it in the item's description?

How to write iteminfo.lua to get the server value?

like this

 

01.jpg

Open you client files goto System folder find Iteminfo.lua you can change the information there so your server will display the data that you have been change . You just simply re-open your client and login your account once you change something and see if it goes thru

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  11/12/22
  • Last Seen:  

9 hours ago, Poring King said:

Open you client files goto System folder find Iteminfo.lua you can change the information there so your server will display the data that you have been change . You just simply re-open your client and login your account once you change something and see if it goes thru

Are there any examples? I know that I need to modify the main function of iteminfo.lua. I can get the value of the item tpl hash table defined by the client, but how do I get the value which sent from the server? For example, attack value, which variable is it?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   4
  • Joined:  06/29/22
  • Last Seen:  

Posted (edited)
2 hours ago, EXPPOC said:

Are there any examples? I know that I need to modify the main function of iteminfo.lua. I can get the value of the item tpl hash table defined by the client, but how do I get the value which sent from the server? For example, attack value, which variable is it?

For item descriptions, it's purely clientside. That data is set up in ItemInfo.lua—Item descriptions never get any information from the server. If you edit the ATK of an item on the server, you must make a corresponding edit to the client description. The entire tbl{ } in ItemInfo.lua is loaded into memory at launch time.

In your initial post, you show properties for Random Options, which are separate from the item descriptions.

If you _really_ want dynamic item descriptions from the server, you could try to find a way to call AddItemIdentifiedDesc which is a function referenced in main() at the bottom of ItemInfo.lua. But as this doesn't appear to be a global function, and the item descriptions are set in memory at launch time, it will require you figuring out a clever injection point that has access to this function to see if you can overwrite the runtime value. I propose a few alternatives;

If you are making a server where item stats can "grow", e.g. you get a Club and its ATK can be evolved, then I think you're best off making separate Item IDs for each Club iteration and making npc script to copy overall the properties.

If you are making a server where the ATK of an item can change dynamically, frequently, then I think you're best off making an item that checks the stat of your items via npcscript, e.g. a usable called "Stat Sheet" that calls a mes window, and that shows you the dynamic properties on your items in an item function that uses getitemdata.

If you are doing one-off edits then I think editing ItemInfo.lua is best, you could write a quick script that crawls your yaml item db and inserts the correct values into the lua file for you.

Otherwise you might consider enchant or ropt slots for this data, which do read from the server.

Edited by ckx_
formatting
Link to comment
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
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

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