diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-02-25 18:06:53 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-02-25 18:06:53 +0000 |
commit | 7369c775464aa9eae7a98bb935442b2fa2992f8e (patch) | |
tree | e046657dfed8ec899ca2c1fc0cd05e02d0fc1433 /docs/items.txt | |
parent | c35cee2c5741b28ffdb9af83f1ddd6b046fb7faa (diff) | |
download | mana-7369c775464aa9eae7a98bb935442b2fa2992f8e.tar.gz mana-7369c775464aa9eae7a98bb935442b2fa2992f8e.tar.bz2 mana-7369c775464aa9eae7a98bb935442b2fa2992f8e.tar.xz mana-7369c775464aa9eae7a98bb935442b2fa2992f8e.zip |
Server development docs update
Diffstat (limited to 'docs/items.txt')
-rw-r--r-- | docs/items.txt | 139 |
1 files changed, 121 insertions, 18 deletions
diff --git a/docs/items.txt b/docs/items.txt index beaa2ab1..e31f4904 100644 --- a/docs/items.txt +++ b/docs/items.txt @@ -4,34 +4,137 @@ THE MANA WORLD INVENTORY SYSTEM 1. INTRODUCTION 2. DATABASE -3. EQUIPMENT +3. INVENTORY +4. EQUIPMENT +5. IMPLEMENTATION +6. SPECIAL ITEMS +7. PROTOCOL +An item will have the following properties: + +C means info is used only by the client +S means info is used only by the server +C&S means info is used by both -1. INTRODUCTION +- id (C&S) -> unsigned int + + a positive integer uniquely identifying an item. -The inventory system will be based client side on a database realized by an XML -document. The database will contain a list of all the items available ingame. +- image (C) -> unsigned int + + used if same images are used for different items. + Maybe we need more image ids to tell which image (bigger one) to show in + equipment window or when equipping items in weapon slot. +- name (C) -> char[30] -2. DATABASE + to be shown in inventory. + +- description (C) -> char[100] + + a brief description shown in shops, or in the inventory + +- type (S) -> unsigned char + + server uses it to check if is an item or an equipment and send the + appropriate packet. + + * USABLE_ITEM (food, potions, ...) + * EQUIPMENT_ITEM (weapons, armors, ...) + * SLOT_ITEM (cards, materias, summoned beings, ...) + * SLOTTED_ITEM (bags, small chests, ...) + +- identify (S) -> unsigned char + + the server will check this flag if the items can be identified by the + player. + + * IDENTIFIED no need to identify the item + * IDENTIFY_ITEM you can identify it by using a special item + * IDENTIFY_MAGIC you can identify it by using a particular spell + * BLACKSMITH needs a blacksmith to be identified + * WIZARD needs a wizard to be identified (enchanted items) + * ANCIENT_BLACKSMITH + * ANCIENT_WIZARD + * NOT_IDENTIFIABLE reserved for future use + +- weigth (S) -> unsigned short + + used by server to calculate if the being can carry more items. + +- # of slots (C&S) -> unsigned char + + if this field is greater than 0 it means this one is a slotted item. + (Probably we can remove SLOTTED_ITEM from the type enumeration) + For example a bag will have 4 slots, while a chest about 10. + +- script (S) -> probably a file name to reference the script file + + script to be executed when item is used/equipped. + -The XML document (name to be defined, suggested items.xml) will contain a list -of items. An item can have the following properties: +3. INVENTORY -- id (a positive integer uniquely identifying an item) -- image (used if same images are used for different items) -- name -- description (a brief description shown in shops, or in the inventory) -- type (weapon, food, armor, stone, and so on...) -- properties (probably a series of flags) +Inventory will contain any kind of weapons including non equipped items and +slotted items. Every being will have a variable number of slots to store items. +For example a maggot won't have any slot, while players could have a number of +slots depending on his strength. A pet could have one slot used to add a bag and +help the player carrying items. -3. EQUIPMENT +4. EQUIPMENT Every being will have a variable number of slots to equip items. For a player we will have 6 slots: head, upper body, lower body, feet, left hand, right -hand. +hand. We can also add slots to equip rings, whistlet and elbowpad. + + +5. IMPLEMENTATION + +Since both client and server will only need to store item ids, inventory and +equipment can be easily coded as unsigned int arrays. The only problem is +about slotted items. They for sure can't store another slotted item, but it's +hard to represent them as an int. Probably a more complex structure is needed. + +struct ITEM_HOLDER { + int id; + int quantity; + ITEM_HOLDER *item; +} + +ITEM_HOLDER inventory[number_of_slots]; +ITEM_HOLDER equipment[number_of_slots]; + +If item is not NULL it will reference an array of items stored in the slotted +item. + +How to limit the quantity of items? We could have a fixed number of slots in the +inventory. In one slot you can store only items with the same id (except slotted +items which need separate slots). When you pick up/receive a new item, total +weigth you can carry is checked if the item can be stored. + +6. SPECIAL ITEMS + +A special case is represented by arrows holder. Three solutions will apply: + + - equipment will have a special slot where you can equip only arrows + (or stones) + + - item with one slot + + - arrows can be simply stored in inventory + +Weapons can store a limited number of items in their slots. In this kind of +slots you can store materia, demons or arrows. Some examples: + + * arrows holder = max 100 arrows (1 slot) + + * sword = max 1 materia + 1 demon (2 slot) + + * magic sword = max 2 materias (1 slot) + + * sword of cahos = max 1 materia + 2 demons (2 slot) + +7. PROTOCOL -To equip an item you should go to the inventory, select the desired item and -push the "Equip" button. To unequip, push the "Unequip" button in the equipment -window. Unequipped items should automatically go back in the inventory. +To be defined.
\ No newline at end of file |