From The Mana World
Revision as of 11:23, 4 September 2008 by Exceptionfault (talk | contribs) (added content)

Outdated template, please use Template:Status Under Construction to mark pages as unfinished.

Customizable Item Attributes

Clarification

Currently the client supports the dynamic dyeing of item graphics at runtime. This is used to simulate different items while using the same item image. Each of the recolored items is defined as a new item type which could have different attributes. This makes sense if we think about potions as a green one does only light healing, while a red one maybe heals you completely. But what if we think about cotton shirts? A blue shirt doesn´t have different attributes as a green shirt so it is senseless to define a different item type for each different color.


Proposal

Each item can have multiple attributes. Some attributes correspond to the item type (like the strength of a potion). Others, like the color of a shirt are stored individually per instance of an item type. While the attributes of item types are fixed during runtime, the individual attributes could be changed by players, npcs or quests. Think about a pot containing natural color from plants, e.g dark red (possible are all thinksable true color values, right?). Why not let the player combine his white shirt with the red color and dye his shirt on his own? The pot items is removed from inventory, or changed into an "empty pot" item which can be reused. The custom attribute "white" of the shirt gets modified into "dark red".


Further Possibilities

The system of customizable attributes gives you another chance of extending gameplay: Adding a factor like quality to weapons:

  * The more the weapon is used, the weaker the quality gets.
  * The weaker the quality the lesser damage the weapon does in fights until the weapon breaks and gets completely unuseable.
  * Damaged weapons can be repaired by users with skills in blacksmithing or something. The higher the skill of the smith, the higher the quality of the produced weapon. Not each sword is a sharp und unbreakable sword, isn't it?


Implementation

To store the custom attributes, an additional table in the database is necessary. Each custom attribute equals one line in the table consisting of

  * Id of the item references to tmw_inventories
  ** You have to be aware of items with more amount on one slot! Comparism has to include the attributes of the items to see if they are different.
  * Id of the attribute
  * custom value of the attribute as string

Which custom attributes are availabke per item type has to be defined in the items.xml file.