Easycore

[Guide] Adding custom Random Options

Recommended Posts

[Guide] Adding custom Random Options

Introduction:

In this guide I will introduce you how to implement custom Random Options.

I will use as an example the bonus "bAddEff".

7nP3ugI.png

--------------------------------------------------------------------

- Server-Side -

First of all we will add our custom option to item_randomopt_db (db\import\item_randomopt_db.txt)

When opening this file will appear:

// Items Random Option Database    
//
// Structure of Database:
// ID,{ Bonus Script }

So we add this:

RDMOPT_WEAPON_FREEZE,{ bonus2 bAddEff,Eff_Freeze,getrandomoptinfo(ROA_VALUE)*100; }

In this case getrandomoptinfo(ROA_VALUE) is multiplied by 100, because 100 means 1% in bAddEff.

Also, we need to add the constant, opening db\const.txt.

Find:

"//RDMOPT_ATTR_TOLERACE_ALL    193"

And add below:

RDMOPT_WEAPON_FREEZE	194

Server side is finished~

--------------------------------------------------------------------

- Client-Side -

For display our custom options we must adding to enumvar.lub and addrandomoptionnametable.lub, located in (luafiles514\lua files\datainfo\)

Editing enumvar.lub:

Find:

ATTR_TOLERACE_ALL = { 193, 10 },

And add:

WEAPON_FREEZE = {194, 0},

*The first number must be same that added in const.txt*

 

Editing addrandomoptionnametable.lub:

Find:

[EnumVAR.MDAMAGE_SIZE_LARGE_USER[1]] = "Magical resistance Large size monster +%d%%",

And add:

[EnumVAR.WEAPON_FREEZE[1]] = "Freeze an enemy when attacking +%d%%",

%d% is equal to ROA_VALUE.

--------------------------------------------------------------------

After completing all of the above your Random Option is ready to use.

Remember that there is documentation of how to add random options to items and a sample npc.

If you have doubts, write on the comments.

  • Upvote 3

Share this post


Link to post
Share on other sites

thanks now it makes sense! thank you!
can you make a sample item script using random options?

Share this post


Link to post
Share on other sites

Hi, can anyone tell me what i did wrong?

cons = 

RDMOPT_CLASS_CHANGE     206

 

item_randomopt_db =

RDMOPT_CLASS_CHANGE,{ bonus bClassChange,getrandomoptinfo(ROA_VALUE)*100; }

 

error i got:

[Warning]: Skipping line '6', invalid constant definition
[Error]: sv_readdb: Could not process contents of line 24 of "db/import/const.txt".

[Error]: itemdb_read_randomopt: Invalid Random Option ID 'RDMOPT_CLASS_CHANGE' in line 6 of "db/import/item_randomopt_db.txt", skipping.
[Error]: itemdb_read_randomopt_group: Invalid random group id 'RDMOPT_CLASS_CHANGE' in column 3!
[Error]: itemdb_read_randomopt_group: Invalid random group id 'RDMOPT_CLASS_CHANGE' in column 3!
[Error]: itemdb_read_randomopt_group: Invalid random group id 'RDMOPT_CLASS_CHANGE' in column 3!

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

Loading...