Crimson Weapon and Item Random Options

Crimson Weapon

Have you hear about Crimson Weapon in iRO? Crimson Weapons are new item system that use random option to enchant the weapon. In iRO, the Crimson Weapon can be gained by killing certain monsters. When the monster is killed, you can obtained special unidentified weapon, and you will get random endow/element as random option for that weapon. It’s Crimson Weapon.

Item Random Options

This crimson weapon is using system called random options by kRO as stated in their client side file, data/luafiles514/lua files/datainfo/addrandomoptionnametable.lub. This file contains list of available random options, also for Crimson Weapon in iRO.

That file is used to give information to player about the bonus given to weapon or other equipment. The random option description will be showed when the extra slot is hovered, like compounded cards. But, it’s only working for 2015-02-26 client or newer. So, if you are using old client, 2013-08-07 as example, the random option information is not available although the bonus is still giving effects.

Beside addrandomoptionnametable.lub file, there is also important file, data/luafiles514/lua files/datainfo/enumvar.lub. The enumvar.lub file is used to listing the random option ID. As always, you need to define the ID first before defining its usaged, like for accessoryid.lub and accname.lub.

In example, iRO’s Crimson Weapons are using WEAPON_ATTR_NOTHING, WEAPON_ATTR_WATER, WEAPON_ATTR_GROUND, WEAPON_ATTR_FIRE, WEAPON_ATTR_WIND, WEAPON_ATTR_POISON, WEAPON_ATTR_SAINT, WEAPON_ATTR_DARKNESS, WEAPON_ATTR_TELEKINESIS, and WEAPON_ATTR_UNDEAD. Those enum names must be unique, and the ID also unique.

  WEAPON_ATTR_NOTHING = {175, 0},
  WEAPON_ATTR_WATER = {176, 1},
  WEAPON_ATTR_GROUND = {177, 2},
  WEAPON_ATTR_FIRE = {178, 3},
  WEAPON_ATTR_WIND = {179, 4},
  WEAPON_ATTR_POISON = {180, 5},
  WEAPON_ATTR_SAINT = {181, 6},
  WEAPON_ATTR_DARKNESS = {182, 7},
  WEAPON_ATTR_TELEKINESIS = {183, 8},
  WEAPON_ATTR_UNDEAD = {184, 9},

So, when you have Crimson Weapon with WEAPON_ATTR_WIND, the description will be displayed as “Grant weapon with Wind property”.

  [EnumVAR.WEAPON_ATTR_NOTHING[1]] = "Grant weapon with Neutral property",
  [EnumVAR.WEAPON_ATTR_WATER[1]] = "Grant weapon with Water property",
  [EnumVAR.WEAPON_ATTR_GROUND[1]] = "Grant weapon with Earth property",
  [EnumVAR.WEAPON_ATTR_FIRE[1]] = "Grant weapon with Fire property",
  [EnumVAR.WEAPON_ATTR_WIND[1]] = "Grant weapon with Wind property",
  [EnumVAR.WEAPON_ATTR_POISON[1]] = "Grant weapon with Poison property",
  [EnumVAR.WEAPON_ATTR_SAINT[1]] = "Grant weapon with Holy property",
  [EnumVAR.WEAPON_ATTR_DARKNESS[1]] = "Grant weapon with Shadow property",
  [EnumVAR.WEAPON_ATTR_TELEKINESIS[1]] = "Grant weapon with Ghost property",
  [EnumVAR.WEAPON_ATTR_UNDEAD[1]] = "Grant weapon with Undead property",

How to use Item Random Options?

Then, if you are rAthena user, you must be know about Item Random Option implementation in rAthena by Secret. By using that feature, you can also make Crimson Option -like for your server.

First, you must compile your server with one of these client version. Make sure you are using Ragexe, not RagexeRE!

packet_db_ver: 52 // 2015-05-13
packet_db_ver: 53 // 2015-09-16
packet_db_ver: 54 // 2015-10-01
packet_db_ver: 55 // 2015-11-04

But I choose

packet_db_ver: 55 // 2015-11-04aRagexe

Then, you must know what are inside the db/[pre-]re/item_randomopt_db.txt. Make sure there are bonuses like iRO’s Crimson Weapons.

RDMOPT_WEAPON_ATTR_NOTHING,{ bonus bAtkEle,Ele_Neutral; }
RDMOPT_WEAPON_ATTR_WATER,{ bonus bAtkEle,Ele_Water; }
RDMOPT_WEAPON_ATTR_GROUND,{ bonus bAtkEle,Ele_Earth; }
RDMOPT_WEAPON_ATTR_FIRE,{ bonus bAtkEle,Ele_Fire; }
RDMOPT_WEAPON_ATTR_WIND,{ bonus bAtkEle,Ele_Wind; }
RDMOPT_WEAPON_ATTR_POISON,{ bonus bAtkEle,Ele_Poison; }
RDMOPT_WEAPON_ATTR_SAINT,{ bonus bAtkEle,Ele_Holy; }
RDMOPT_WEAPON_ATTR_DARKNESS,{ bonus bAtkEle,Ele_Dark; }
RDMOPT_WEAPON_ATTR_TELEKINESIS,{ bonus bAtkEle,Ele_Ghost; }
RDMOPT_WEAPON_ATTR_UNDEAD,{ bonus bAtkEle,Ele_Undead; }

As an important note, the ID in that db file is using constant, and the values must be same with enumvar.lub values. If not, the client will shows wrong description for your Crimson Weapon.

RDMOPT_WEAPON_ATTR_NOTHING	175
RDMOPT_WEAPON_ATTR_WATER	176
RDMOPT_WEAPON_ATTR_GROUND	177
RDMOPT_WEAPON_ATTR_FIRE	178
RDMOPT_WEAPON_ATTR_WIND	179
RDMOPT_WEAPON_ATTR_POISON	180
RDMOPT_WEAPON_ATTR_SAINT	181
RDMOPT_WEAPON_ATTR_DARKNESS	182
RDMOPT_WEAPON_ATTR_TELEKINESIS	183
RDMOPT_WEAPON_ATTR_UNDEAD	184

After your server is running, try make a NPC to set your empty Crimson Weapon. For example, try add this NPC script. Actually you can learn this script command.

*setrandomoption(<equipment slot>,<index>,<id>,<value>,<param>{,<char id>});

Sets <index+1>th random option for equipment equipped at <equipment slot>
to <id>, <value> and <param>.

See 'getequipid' for a full list of valid equipment slots.

index parameter can be 0 to MAX_ITEM_RDM_OPT-1 (default 0-4).

ID - ID of random option. See db/const.txt for constants.
Value - Value of random option
Param - Parameter of random option

And here is the result! Enjoy the item random option for your own Crimson Weapon!

Tell your friends

Leave a Reply