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