From The Mana World
(netcode notes) |
(script api) |
||
Line 3: | Line 3: | ||
{{beginsqltable|tmw_customitem}} | {{beginsqltable|tmw_customitem}} | ||
{{sqltablerow | id | INTEGER | PRIMARY KEY | tmw_customitem_modifiers.id, tmw_customitem_runes.id | unique identifier}} | {{sqltablerow | id | INTEGER | PRIMARY KEY | tmw_customitem_modifiers.id, tmw_customitem_runes.id | unique identifier}} | ||
{{sqltablerow | archetype-id | INTEGER | | | entry from items.xml to determine the slot the item is equipped in, the used sprite, item icon and description. In case of weapons it also affects the weapon category (used skill) and the attack zone.}} | |||
{{sqltablerow | archetype-id | INTEGER | | | entry from items.xml to determine the used sprite, item icon and description. In case of weapons it also affects the weapon category (used skill) and the attack zone.}} | |||
{{sqltablerow | color | TEXT | | | colorization string}} | {{sqltablerow | color | TEXT | | | colorization string}} | ||
{{sqltablerow | name | TEXT | | | item name}} | {{sqltablerow | name | TEXT | | | item name}} | ||
Line 37: | Line 36: | ||
* When sending the inventory data to a character, every high id is followed by its archetype-id and colorization string. All other information about the item can be requested on demand with an additional message. | * When sending the inventory data to a character, every high id is followed by its archetype-id and colorization string. All other information about the item can be requested on demand with an additional message. | ||
* When sending look information about other characters the archetype-id and the colorisation are transfered | * When sending look information about other characters the archetype-id and the colorisation are transfered | ||
== Script API == | |||
;tmw.create_custom_item(archetype-id, color, name, inscription, durability, initial-durability, weight, value, runeslots): Creates a custom item in the server database. Returns the ID of the item. | |||
;tmw.change_custom_item(id, archetype-id, color, name, inscription, durability, initial-durability, weight, value, runeslots): Changes the values of a custom item in the server database. Every argument may be NULL to leave it as it is. | |||
;tmw.add_modifier_to_item(id, attribute, absolute, multiplier, time): Adds a modifier to an item. | |||
;tmw.add_rune_to_item(id, spell): Adds a spell rune to an item. | |||
;tmw.get_custom_item(id): Returns a table with the attributes of the item. | |||
;tmw.get_custom_item_modifiers(id): Returns a table of tables with the modifier data of the item. | |||
;tmw.get_custom_item_runes(id): Returns a table of tables with the rune data of the item. | |||
(function names not checked for consistency with the rest of the api) |
Revision as of 16:19, 7 May 2009
Database
Layout for the SQL table to store customized equipment
|
Stat modifiers during item creation. Also includes elemental modifiers.
|
Spell runes engraved in the item.
|
Netcode
- Item IDs are 32 bit unsigned integers
- Item IDs 1 - 65.535 are non-customized generic items which may exist multiple times
- Item IDs 65.536 - 4.294.967.296 are unique equipment items which may only exist once in the game.
- When sending the inventory data to a character, every high id is followed by its archetype-id and colorization string. All other information about the item can be requested on demand with an additional message.
- When sending look information about other characters the archetype-id and the colorisation are transfered
Script API
- tmw.create_custom_item(archetype-id, color, name, inscription, durability, initial-durability, weight, value, runeslots)
- Creates a custom item in the server database. Returns the ID of the item.
- tmw.change_custom_item(id, archetype-id, color, name, inscription, durability, initial-durability, weight, value, runeslots)
- Changes the values of a custom item in the server database. Every argument may be NULL to leave it as it is.
- tmw.add_modifier_to_item(id, attribute, absolute, multiplier, time)
- Adds a modifier to an item.
- tmw.add_rune_to_item(id, spell)
- Adds a spell rune to an item.
- tmw.get_custom_item(id)
- Returns a table with the attributes of the item.
- tmw.get_custom_item_modifiers(id)
- Returns a table of tables with the modifier data of the item.
- tmw.get_custom_item_runes(id)
- Returns a table of tables with the rune data of the item.
(function names not checked for consistency with the rest of the api)