Jump to content

[Guide] Adding custom Random Options


Easycore

Recommended Posts


  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   251
  • Joined:  04/08/13
  • Last Seen:  

[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 4
  • MVP 1
Link to comment
Share on other sites

  • 8 months later...

  • Group:  Members
  • Topic Count:  90
  • Topics Per Day:  0.02
  • Content Count:  361
  • Reputation:   18
  • Joined:  01/09/13
  • Last Seen:  

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

Link to comment
Share on other sites

  • 7 months later...

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   0
  • Joined:  05/28/14
  • Last Seen:  

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!

Link to comment
Share on other sites

  • 3 years later...

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   1
  • Joined:  08/18/13
  • Last Seen:  

for rAthena 2021? mode pre-rene? how to confire? thanks

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

×
×
  • Create New...