This is the description of fields of the object structure, and what they are used to. See also [[dev:objects]] FIXME fill in the blanks :) add sharedstring info FIXME maybe this should be part of the object.h file directly? FIXME make a script to either do object.h -> this page, or this page -> object.h * IMHO one should put this data into object.h, in doxygen format, and make a script to do object.h -> this page --- //[[users:rednaxela|Alex Schultz]] 2007/01/03 12:50// ===== object fields ===== ==== contr ==== Type: pl * Meaning: * pointer to the player which control this object. Will only be set for the player's object itself, and not items in inventory. ==== next ==== Type: obj * Meaning: * pointer to the next object in the free/used list. Should not be used much. FIXME check ''server/c_object.c:840'', line ''for (tmp=op->below; tmp!=NULL; tmp=tmp->next)'' sounds suspicious (should probably be ''tmp->below''). ==== prev ==== Type: obj * Meaning: * pointer to the next object in the free/used list. Should not be used much. ==== active_next ==== Type: obj * Meaning: * next object in the 'active' list. This is used in process_events() so that the entire object list does not need to be gone through. Should not be used much. ==== active_prev ==== Type: obj * Meaning: * previous object in the 'active list This is used in process_events so that the entire object list does not need to be gone through. Should not be used much. ==== below ==== Type: obj * Meaning: * pointer to the object stacked below this one. Will link items on a same spot, or in the same container. ==== above ==== Type: obj * Meaning: * pointer to the object stacked above this one. Will link items on a same spot, or in the same container. ==== inv ==== Type: object * pointing to the first item in inventory. Other items are available through ''below'' chaining. Meaning: * for spellbooks, rods, wands, horns, this is the spell that the object teaches/fires. * for generators with the FLAG_CONTENT_ON_GEN flag it is the item generated. * for living things and containers {FIXME flags for that}, what this holds. ==== container ==== Type: obj * Meaning: Current container being used. I think this is only used by the player right now. ==== env ==== Type: obj * Meaning: Pointer to the object which is the environment. This is typically the container that the object is in. ==== more ==== Type: obj * Meaning: Pointer to the rest of a large body of objects ==== head ==== Type: obj * Meaning: Points to the main object of a large body ==== map ==== Type: mapdef * Meaning: Pointer to the map in which this object is present ==== count ==== Type: tag_t Meaning: Unique object number for this object ==== name ==== Type: const char * (shared string) Meaning: The name of the object, obviously... ==== name_pl ==== Type: const char * (shared string) Meaning: The plural name of the object. Shared string. ==== title ==== Type: const char * (shared string) Meaning: Of foo, etc. ==== race ==== Type: const char * (shared string) * for living things: Human, goblin, dragon, etc. * for SPELL with SP_RAISE_DEAD subtype, if set, then this is the name of a treasurelist of possible races in which the character will be reincarnated into ==== slaying ==== Type: const char * (shared string) Meaning: * which race to do double damage to. * for EXITs, this is the filename. !/ means 'random map', message then contains parameters. * for DOORs, means it's locked. * for KEYs, they will unlock DOORs with matching slaying * for DETECTOR, what item to check for FIXME many more uses ==== skill ==== Type: const char * (shared string) Meaning: Name of the skill this object uses/grants ==== msg ==== Type: const char * (shared string) Meaning: * for BOOK/SIGN/MAGICMOUTH/etc. what is displayed when activated. * for EXITs pointing to random maps, map parameters. * for races players can select, description of the race FIXME check other uses. ==== lore ==== Type: const char * (shared string) Meaning: Obscure information about this object, to get put into books and the like. ==== x ==== Type: sint16 Meaning: ==== y ==== Type: sint16 Meaning: ==== ox ==== Type: sint16 Meaning: For debugging: Where it was last inserted ==== oy ==== Type: sint16 Meaning: For debugging: Where it was last inserted ==== speed ==== Type: float Meaning: ==== speed_left ==== Type: float Meaning: ==== nrof ==== Type: uint32 Meaning: ==== face ==== Type: New_Face * Meaning: ==== direction ==== Type: sint8 Meaning: ==== facing ==== Type: sint8 Meaning: ==== type ==== Type: uint8 Meaning: See Also: [[dev:object types|dev:object types]] ==== subtype ==== Type: uint8 Meaning: ==== client_type ==== Type: uint16 Meaning: ==== resist ==== Type: sint16[NROFATTACKS] Meaning: ==== attacktype ==== Type: uint32 Meaning: ==== path_attuned ==== Type: uint32 Meaning: ==== path_repelled ==== Type: uint32 Meaning: ==== path_denied ==== Type: uint32 Meaning: ==== material ==== Type: uint16 Meaning: ==== materialname ==== Type: const char * (shared string) Meaning: ==== magic ==== Type: sint8 Meaning: ==== state ==== Type: uint8 Meaning: ==== value ==== Type: sint32 Meaning: ==== level ==== Type: sint16 Meaning: ==== last_heal ==== Type: sint32 Meaning: * for DISEASE, if 1 then this disease won't grant immunity when cured naturally * for SPELL of type SP_RAISE_DEAD, if set then the spell can resurrect without a body. If 0 the body is required ==== last_sp ==== Type: sint32 Meaning: * for MOOD_FLOOR, how to change the mood of a monster on it: * 0: furious--make all monsters mad * 1: angry -- get neutral monsters mad * 2: calm -- pacify unfriendly monsters * 3: make all monsters fall asleep * 4: charm all monsters * new sp for praying skill when changing god? FIXME check what it means when praying * for CHECK_INV, 0 means player must have object, else player must not have object * for healing, how many sp to regenerate * for TRIGGER_ALTAR ?? FIXME * for DISEASEs, the SYMPTOM's last_sp FIXME * for objects being thrown, the max number of moves to exist * for monsters, regenerate sp ==== last_grace ==== Type: sint16 Meaning: ==== last_eat ==== Type: sint16 Meaning: ==== invisible ==== Type: sint16 Meaning: ==== pick_up ==== Type: uint8 Meaning: ==== item_power ==== Type: sint8 Meaning: ==== gen_sp_armour ==== Type: sint8 Meaning: ==== weight ==== Type: sint32 Meaning: ==== weight_limit ==== Type: sint32 Meaning: ==== carrying ==== Type: sint32 Meaning: ==== glow_radius ==== Type: sint8 Meaning: ==== stats ==== Type: living Meaning: ==== perm_exp ==== Type: sint64 Meaning: ==== current_weapon_script ==== Type: const char * (shared string) Meaning: ==== current_weapon ==== Type: obj * Meaning: ==== weapontype ==== Type: uint32 Meaning: ==== tooltype ==== Type: uint32 Meaning: ==== body_info ==== Type: sint8[NUM_BODY_LOCATIONS] Meaning: ==== body_used ==== Type: sint8[NUM_BODY_LOCATIONS] Meaning: ==== owner ==== Type: obj * Meaning: ==== ownercount ==== Type: tag_t Meaning: ==== enemy ==== Type: obj * Meaning: ==== attacked_by ==== Type: obj * Meaning: ==== attacked_by_count ==== Type: tag_t Meaning: ==== randomitems ==== Type: treasureliststruct * Meaning: ==== run_away ==== Type: uint16 Meaning: ==== chosen_skill ==== Type: obj * Meaning: ==== hide ==== Type: uint32 Meaning: ==== move_status ==== Type: sint32 Meaning: ==== attack_movement ==== Type: uint16 Meaning: ==== will_apply ==== Type: uint8 Meaning: ==== spellitem ==== Type: obj * Meaning: ==== expmul ==== Type: double Meaning: ==== duration ==== Type: sint16 Meaning: ==== duration_modifier ==== Type: uint8 Meaning: ==== casting_time ==== Type: sint16 Meaning: ==== spell ==== Type: obj * Meaning: ==== start_holding ==== Type: uint16 Meaning: ==== spellarg ==== Type: char * Meaning: ==== dam_modifier ==== Type: uint8 Meaning: ==== range ==== Type: sint8 Meaning: ==== range_modifier ==== Type: uint8 Meaning: ==== arch ==== Type: archt * Meaning: ==== other_arch ==== Type: archt * Meaning: ==== flags ==== Type: uint32[4] Meaning: ==== animation_id ==== Type: uint16 Meaning: ==== anim_speed ==== Type: uint8 Meaning: ==== last_anim ==== Type: uint8 Meaning: ==== elevation ==== Type: sint32 Meaning: ==== smoothlevel ==== Type: uint8 Meaning: ==== map_layer ==== Type: uint8 Meaning: ==== move_type ==== Type: MoveType Meaning: ==== move_block ==== Type: MoveType Meaning: Prevents a character or monster from moving onto a tile occupied by the object. * Each part of a multi-tile object may have a unique setting, unlike many other modifiers that are omitted or ignored in non-head parts. ==== move_allow ==== Type: MoveType Meaning: ==== move_on ==== Type: MoveType Meaning: ==== move_off ==== Type: MoveType Meaning: ==== move_slow ==== Type: MoveType Meaning: ==== move_slow_penalty ==== Type: float Meaning: ==== custom_name ==== Type: const char * (shared string) Meaning: ==== key_values ==== Type: key_value * Meaning: ==== no_save ==== Type: uint8 Meaning: ===== "living" structure fields ===== ==== Str ==== Type: sint8 Meaning: ==== Dex ==== Type: sint8 Meaning: ==== Con ==== Type: sint8 Meaning: ==== Wis ==== Type: sint8 Meaning: ==== Cha ==== Type: sint8 Meaning: ==== Int ==== Type: sint8 Meaning: ==== Pow ==== Type: sint8 Meaning: ==== wc ==== Type: sint8 Meaning: ==== ac ==== Type: sint8 Meaning: ==== hp ==== Type: sint16 Meaning: * for living things, hitpoints (<0 => dead). * for exits, x coordinates of destination. * for ROD or HORNs, spellpoints the item has to cast the spell. ==== maxhp ==== Type: sint16 Meaning: ==== sp ==== Type: sint16 Meaning: * for player, spellpoints. * for exits, y coordinates of destination. * for glowing crystals, stored spellpoints. * for WEAPON_IMPROVER, what to improve * for PLAYERMOVER, the direction to move objects ==== maxsp ==== Type: sint16 Meaning: ==== grace ==== Type: sint16 Meaning: ==== maxgrace ==== Type: sint16 Meaning: ==== exp ==== Type: sint64 Meaning: * added speed for some items? ==== food ==== Type: sint16 Meaning: * for WAND, number of charges left. * for player, food. * for healing spells, food to give to the player. * for FORCEs, duration (in object moves) of the force. * for swamps {FIXME type}, how deep the player is in the swamp (see move_deep_swamp()). * for DISEASEs, the duration of the disease. * for GATEs, whether it's opening or closing. ==== dam ==== Type: sint16 Meaning: ==== luck ==== Type: sint8 Meaning: ===== Key/value fields ===== Those fields are not part of the ''object'' or ''Stats'' structures, but used through the key/value mechanism. ==== price_adjustment, price_adjustment_buy and price_adjustment_sell ==== Those control the price the item should have. They are a ratio from the item's raw value, and are applied without any bargaining / charism / shop specialization effect. Values should be a valid float (as recognized by ''atof''). If price_adjustment is set, it will override the other 2 keys. Else any of the 2 can be not set without any side effect. ==== divine_giver_name ==== For god-given items, name of the god that gave the item. Used to remove them if player switches cult. ==== divine_blessing_name ==== Specified god has blessed the item. Used to avoid accumulating blessings. ==== item_owner ==== Player owning the item, so other players can't bless it. If set, the item can't be applied by another player unless he has enough experience (see item_willpower). ==== generator_code ==== For GENERATOR ({FIXME} real flag) objects, a key to copy to generated monsters, so they can be tracked. ==== generator_max ==== For GENERATOR ({FIXME} ditto) objects, the maximum number of generated monsters allowed at the same time. ==== generator_name ==== Name of the generator {FIXME}, used for generator_code value. If unset will use generator's name, else ''generator''. ==== on_use_yield ==== Should be the name of an archetype. When containing object is applied, this specific object is generated, and inserted at the same place as the containing object. Used mostly for giving empty bottles when drinking stuff. ==== item_willpower ==== If set incombination with item_owner, an item will refuse to be applied by another player who doesn't have at least that much experience. ==== passenger_limit ==== For TRANSPORT ({FIXME} real type), the maximum players can board at the same time. ==== face_full and anim_full ==== For TRANSPORT, face to use when it's full. ==== weight_speed_ratio and base_speed ==== Control the max speed of the TRANSPORT, based on the formula speed = base_speed - (base_speed * weight the transport is carrying * weight_speed_ratio) / (transport's weight_limit * 100 ==== spell_expiry_warn_1 and spell_expiry_warn_2 ==== Those are used by spell effects, to store when player should be warned of effect expiration. Player will get a message when spell's duration reaches the first value, then the second. Will be set by the code automatically, should be a number parsable via atoi().