You're asking a lot from people by necro-posting this thread.
No, it's literally
the point of the thread. The alternative would be to post a new thread with the question in Plugin Support and link back to here, which makes no beneficial difference.
My advice is to copy and paste the plugin's instructions into Chat GPT and ask your questions there. It will give you advice on how to use the plugin.
...
Most coding questions can be handled with any number of AI tools now.
This is very poor advice.
AI does
not correctly understand code, and can not reliably interpret and explain what it does. It often gives incorrect instructions on how to use plugins (you can find multiple posts here where ChatGPT gave notetags that are combined from multiple plugins or just don't exist at all).
The majority of people who have tried to do what you describe end up posting here again with completely nonfunctional code that AI generators made up - because that's what generation is.
And then if you
do run into trouble getting your generated code to work - which is very likely - the rules of the forum prohibit you posting it to request help with. So this recommendation is a good way to get left out in the cold, not knowing any more than you did before.
Always remember to never alter code without the author's permission.
This is also functionally pointless. You should not
distribute modified code unless the author's terms permit it, but there's no reason not to tweak a plugin to work the way you need it to for your game. Also, the terms in the first post of this thread explicitly allow it, so I'm not sure what you're getting at.
I wonder how to had random element rate as bonus in suffix / affix. Can you please help me ?
You would use the Prefix Suffix Effect to construct and apply the trait to the item.
I'm not sure from your question whether you're asking for the element to be random, the rate to be random, or both. So I'll give you a demonstration using both and you just take whatever you need from it.
Code:<Prefix Suffix Effect>
// List the element IDs you want to choose from
let elemIds = [2, 4, 5, 7];
// Define the minimum and maximum for the rate, in integer
let rateMin = 25, rateMax = 70;
// Determine a random value between the minimum and maximum rates
let randomRate = Math.randomInt(rateMax - rateMin + 1) + rateMin;
// Turn it into a decimal rate
randomRate /= 100;
// Construct the trait object
let trait = {code: 11,
dataId: elemIds[Math.randomInt(elemIds.length)],
value: randomRate};
// Add the trait to the item
newItem.traits.push(trait);
</Prefix Suffix Effect>
The above code is untested, but looks like it should work - if you need any further help, feel free to ask any of the humans on the forum who are very willing to assist
:stickytongue: