| 1 |
/* |
| 2 |
Copyright (C) 1999 The Adonthell Team. |
| 3 |
|
| 4 |
This program is free software; you can redistribute it and/or modify |
| 5 |
it under the terms of the GNU General Public License. |
| 6 |
This program is distributed in the hope that it will be useful, |
| 7 |
but WITHOUT ANY WARRANTY. |
| 8 |
See the COPYING file for more details. |
| 9 |
|
| 10 |
*/ |
| 11 |
|
| 12 |
1) Item Structure |
| 13 |
|
| 14 |
The item structure is: |
| 15 |
|
| 16 |
typedef struct |
| 17 |
{ |
| 18 |
u_int16 number; |
| 19 |
u_int16 pattern; |
| 20 |
u_int16 event_walk; |
| 21 |
u_int16 event_action; |
| 22 |
lstr name; |
| 23 |
u_int8 status; |
| 24 |
} item; |
| 25 |
|
| 26 |
number: number of the item as stored in the items array |
| 27 |
pattern: pattern of the item to be used in order to display it |
| 28 |
event_walk: event that occurs when the character (or maybe any character) walks on the item (more on events further in this document). |
| 29 |
event_action: event that occurs when the player is facing the item and when he presses the action key (more on events further in this document). |
| 30 |
name: the name of the item |
| 31 |
status: can be one of the following value |
| 32 |
ITEM_OPENED: the item can be opened/used etc... It can be closed as well |
| 33 |
ITEM_CLOSED: the item can be opened |
| 34 |
ITEM_UNLOCKED: the item can be opened. However, if an item that controls the operture of this item is removed from the inventory of the player, then the items status will go to ITEM_LOCKED |
| 35 |
ITEM_LOCKED: the item is unusable in this state. Getting an item that controls its opening decreases n. If n already equals 0, the the status of the item is changed to ITEM_UNLOCKED [+n], n can be any integer from 0: Dropping an item that controls the opening of this item increases n. |
| 36 |
|
| 37 |
2) Item Events |
| 38 |
The current available values for event_walk or event_action are currently: |
| 39 |
EVENT_TELEPORT |
| 40 |
EVENT_MODIF_PICT |
| 41 |
EVENT_GET |
| 42 |
EVENT_GET_KEY |
| 43 |
EVENT_WALK_FLAG |
| 44 |
EVENT_OPEN |
| 45 |
EVENT_PLACE_ITEM |
| 46 |
|
| 47 |
3) Item text file |
| 48 |
# comment line |
| 49 |
ITEM name_of_item |
| 50 |
POS x y |
| 51 |
EVENT event_type1 arg0 [arg1] [arg2...] |
| 52 |
EVENT event_type2 arg0 [arg1] [...] |
| 53 |
[EVENT etc.] |
| 54 |
[OTHEREVENT] |
| 55 |
END |
| 56 |
|
| 57 |
event_type can be on of |
| 58 |
TELEPORT |
| 59 |
MODIF_PICT |
| 60 |
GET |
| 61 |
GET_KEY |
| 62 |
WALK_FLAG |
| 63 |
OPEN |
| 64 |
ITEM_MAP |
| 65 |
|
| 66 |
with the associated EVENT |
| 67 |
|
| 68 |
4) Description of keywords |
| 69 |
ITEM name_of_item |
| 70 |
. |
| 71 |
. |
| 72 |
. |
| 73 |
END |
| 74 |
|
| 75 |
Those two keywords are used to describe an Item of name name_of_item and its associated characteristics. |
| 76 |
|
| 77 |
POS x y |
| 78 |
Sets up the position of the item on the map as beeing (x,y) |
| 79 |
|
| 80 |
EVENT event_type1 arg0 [arg1] [arg2...] |
| 81 |
EVENT event_type2 arg0 [arg1] [...] |
| 82 |
|
| 83 |
This is the heart of the event script |
| 84 |
|
| 85 |
4) Description of events: |
| 86 |
TELEPORT x y [x1 y1] |
| 87 |
indicates that the players teleports to (x,y). If the optional parameters x1 and y1 are indicated, it means that the new map will be centered on (x1,y1) instead of (x,y) |
| 88 |
|
| 89 |
FRAMEFACTOR x |
| 90 |
changes the framefactor to x |