--- deliantra/server/include/define.h 2006/02/03 07:12:48 1.1 +++ deliantra/server/include/define.h 2006/09/11 12:08:01 1.9 @@ -87,8 +87,8 @@ #define MAX_STAT 30 /* The maximum legal value of any stat */ #define MIN_STAT 1 /* The minimum legal value of any stat */ -#define MAX_BUF 256 /* Used for all kinds of things */ -#define VERY_BIG_BUF 1024 +#define MAX_BUF 1024 /* Used for all kinds of things */ +#define VERY_BIG_BUF 2048 #define HUGE_BUF 4096 /* Used for messages - some can be quite long */ #define SOCKET_BUFLEN 4096 /* Max length a packet could be */ @@ -120,7 +120,7 @@ /* type 0 will be undefined and shows a non valid type information */ #define PLAYER 1 -/*#define BULLET 2 */ +#define TRANSPORT 2 /* see doc/Developers/objects */ #define ROD 3 #define TREASURE 4 #define POTION 5 @@ -137,7 +137,7 @@ #define ARMOUR 16 #define PEDESTAL 17 #define ALTAR 18 -#define CONFUSION 19 +/*#define CONFUSION 19 */ #define LOCKED_DOOR 20 #define SPECIAL_KEY 21 #define MAP 22 @@ -163,8 +163,8 @@ #define CREATOR 42 #define SKILL 43 /* also see SKILL_TOOL (74) below */ #define EXPERIENCE 44 /* This is basically obsolete now. It used to contain */ - /* experience for broad skill categories. This value */ - /* is now automatically converteed at load time. */ + /* experience for broad skill categories. This value */ + /* is now automatically converteed at load time. */ #define EARTHWALL 45 #define GOLEM 46 /*#define BOMB 47 */ @@ -173,33 +173,33 @@ #define GOD 50 #define DETECTOR 51 /* peterm: detector is an object */ - /* which notices the presense of */ - /* another object and is triggered */ - /* like buttons. */ + /* which notices the presense of */ + /* another object and is triggered */ + /* like buttons. */ #define TRIGGER_MARKER 52 /* inserts an invisible, weightless */ - /* force into a player with a specified string WHEN TRIGGERED. */ + /* force into a player with a specified string WHEN TRIGGERED. */ #define DEAD_OBJECT 53 #define DRINK 54 #define MARKER 55 /* inserts an invisible, weightless */ - /* force into a player with a specified string. */ + /* force into a player with a specified string. */ #define HOLY_ALTAR 56 #define PLAYER_CHANGER 57 #define BATTLEGROUND 58 /* battleground, by Andreas Vogl */ #define PEACEMAKER 59 /* Object owned by a player which can convert */ - /* a monster into a peaceful being incapable of attack. */ + /* a monster into a peaceful being incapable of attack. */ #define GEM 60 /*#define FIRECHEST 61*/ /* FIRECHEST folded into FIREWALL */ #define FIREWALL 62 #define ANVIL 63 #define CHECK_INV 64 /* by b.t. thomas@nomad.astro.psu.edu */ #define MOOD_FLOOR 65 /* by b.t. thomas@nomad.astro.psu.edu - * values of last_sp set how to change: - * 0 = furious, all monsters become aggressive - * 1 = angry, all but friendly become aggressive - * 2 = calm, all aggressive monsters calm down - * 3 = sleep, all monsters fall asleep - * 4 = charm, monsters become pets */ + * values of last_sp set how to change: + * 0 = furious, all monsters become aggressive + * 1 = angry, all but friendly become aggressive + * 2 = calm, all aggressive monsters calm down + * 3 = sleep, all monsters fall asleep + * 4 = charm, monsters become pets */ #define EXIT 66 #define ENCOUNTER 67 #define SHOP_FLOOR 68 @@ -284,14 +284,17 @@ #define DISEASE 158 #define SYMPTOM 159 - #define BUILDER 160 /* Generic item builder, see subtypes */ #define MATERIAL 161 /* Material for building */ /* #define GPS 162 Ground positionning system, moved to Python plugin */ #define ITEM_TRANSFORMER 163 /* Transforming one item with another */ #define QUEST 164 /* See below for subtypes */ +#define SAFE_GROUND 165 /* This is a safe ground, means that neither bombs, + potions, alchemy, or magic works here (elmex) */ /* END TYPE DEFINE */ +#define NUM_SUBTYPES 64 // maximum supported subtype number + 1, can be increased to 256 + /* Subtypes for BUILDER */ #define ST_BD_BUILD 1 /* Builds an item */ #define ST_BD_REMOVE 2 /* Removes an item */ @@ -301,17 +304,6 @@ #define ST_MAT_WALL 2 /* Wall */ #define ST_MAT_ITEM 3 /* All other items, including doors & such */ -/* Subtypes for QUEST */ -#define QUEST_IN_PROGRESS 1 -#define QUEST_DONE_QUEST 2 -#define QUEST_DONE_TASK 3 -#define QUEST_START_QUEST 4 -#define QUEST_END_QUEST 5 -#define QUEST_START_TASK 6 -#define QUEST_END_TASK 7 -#define QUEST_OVERRIDE 8 -#define QUEST_ON_ACTIVATE 9 - /* definitions for weapontypes */ #define WEAP_HIT 0 /* the basic */ @@ -420,37 +412,37 @@ */ /* Basic routines to do above */ #define SET_FLAG(xyz, p) \ - ((xyz)->flags[p/32] |= (1U << (p % 32))) + ((xyz)->flags[p/32] |= (1U << (p % 32))) #define CLEAR_FLAG(xyz, p) \ - ((xyz)->flags[p/32] &= ~(1U << (p % 32))) + ((xyz)->flags[p/32] &= ~(1U << (p % 32))) #define QUERY_FLAG(xyz, p) \ - ((xyz)->flags[p/32] & (1U << (p % 32))) + ((xyz)->flags[p/32] & (1U << (p % 32))) #define COMPARE_FLAGS(p,q) \ - ( \ - ((p)->flags[0] == (q)->flags[0]) && \ - ((p)->flags[1] == (q)->flags[1]) && \ - ((p)->flags[2] == (q)->flags[2]) && \ - ((p)->flags[3] == (q)->flags[3]) \ - ) + ( \ + ((p)->flags[0] == (q)->flags[0]) && \ + ((p)->flags[1] == (q)->flags[1]) && \ + ((p)->flags[2] == (q)->flags[2]) && \ + ((p)->flags[3] == (q)->flags[3]) \ + ) /* convenience macros to determine what kind of things we are dealing with */ #define IS_WEAPON(op) \ - (op->type == ARROW || op->type == BOW || op->type == WEAPON) + (op->type == ARROW || op->type == BOW || op->type == WEAPON) #define IS_ARMOR(op) \ - (op->type == ARMOUR || op->type == SHIELD || op->type == HELMET || \ - op->type == CLOAK || op->type == BOOTS || op->type == GLOVES || \ - op->type == BRACERS || op->type == GIRDLE) + (op->type == ARMOUR || op->type == SHIELD || op->type == HELMET || \ + op->type == CLOAK || op->type == BOOTS || op->type == GLOVES || \ + op->type == BRACERS || op->type == GIRDLE) #define IS_LIVE(op) \ - ((op->type == PLAYER || QUERY_FLAG(op, FLAG_MONSTER) || \ - (QUERY_FLAG(op, FLAG_ALIVE) && !QUERY_FLAG(op, FLAG_GENERATOR) && \ - !op->type == DOOR)) && (!QUERY_FLAG(op,FLAG_IS_A_TEMPLATE))) + ((op->type == PLAYER || QUERY_FLAG(op, FLAG_MONSTER) || \ + (QUERY_FLAG(op, FLAG_ALIVE) && !QUERY_FLAG(op, FLAG_GENERATOR) && \ + !op->type == DOOR)) && (!QUERY_FLAG(op,FLAG_IS_A_TEMPLATE))) #define IS_ARROW(op) \ - (op->type==ARROW || \ - (op->type==SPELL_EFFECT && \ - (op->subtype == SP_BULLET || op->subtype == SP_MAGIC_MISSILE))) + (op->type==ARROW || \ + (op->type==SPELL_EFFECT && \ + (op->subtype == SP_BULLET || op->subtype == SP_MAGIC_MISSILE))) /* This return TRUE if object has still randomitems which * could be expanded. @@ -510,9 +502,9 @@ #define FLAG_IS_LIGHTABLE 43 /* object can be lit */ #define FLAG_TEAR_DOWN 44 /* at->faces[hp*animations/maxhp] at hit */ #define FLAG_RUN_AWAY 45 /* Object runs away from nearest player \ - but can still attack at a distance */ + but can still attack at a distance */ /*#define FLAG_PASS_THRU 46*/ /* Objects with can_pass_thru can pass \ - thru this object as if it wasn't there */ + thru this object as if it wasn't there */ /*#define FLAG_CAN_PASS_THRU 47*/ /* Can pass thru... */ #define FLAG_PICK_UP 48 /* Can pick up */ @@ -573,24 +565,24 @@ /* Start of values in flags[3] */ #define FLAG_NO_STEAL 96 /* Item can't be stolen */ #define FLAG_ONE_HIT 97 /* Monster can only hit once before going - * away (replaces ghosthit) - */ + * away (replaces ghosthit) + */ #define FLAG_CLIENT_SENT 98 /* THIS IS A DEBUG FLAG ONLY. We use it to - * detect cases were the server is trying - * to send an upditem when we have not - * actually sent the item. - */ + * detect cases were the server is trying + * to send an upditem when we have not + * actually sent the item. + */ #define FLAG_BERSERK 99 /* monster will attack closest living - object */ + object */ #define FLAG_NEUTRAL 100 /* monster is from type neutral */ #define FLAG_NO_ATTACK 101 /* monster don't attack */ #define FLAG_NO_DAMAGE 102 /* monster can't be damaged */ #define FLAG_OBJ_ORIGINAL 103 /* NEVER SET THIS. Item was loaded by - * load_original_map() */ + * load_original_map() */ #define FLAG_OBJ_SAVE_ON_OVL 104 /* this object should be saved on - * the overlay, and is not subject to - * decay. */ + * the overlay, and is not subject to + * decay. */ #define FLAG_ACTIVATE_ON_PUSH 105 /* connected object is activated when 'pushed' */ #define FLAG_ACTIVATE_ON_RELEASE 106 /* connected object is activated when 'released' */ #define FLAG_IS_WATER 107 @@ -629,7 +621,8 @@ #define MOVE_FLY_HIGH 0x4 /* High flying object */ #define MOVE_FLYING 0x6 /* Combo of fly_low and fly_high */ #define MOVE_SWIM 0x8 /* Swimming object */ -#define MOVE_ALL 0xf /* Mask of all movement types */ +#define MOVE_BOAT 0x10 /* Boats/sailing */ +#define MOVE_ALL 0x1f /* Mask of all movement types */ /* the normal assumption is that objects are walking/flying. * So often we don't want to block movement, but still don't want @@ -699,12 +692,12 @@ /* for use by the lighting code */ #define MAX_LIGHT_RADII 4 /* max radii for 'light' object, really - * large values allow objects that can - * slow down the game */ + * large values allow objects that can + * slow down the game */ #define MAX_DARKNESS 5 /* maximum map darkness, there is no - * practical reason to exceed this */ + * practical reason to exceed this */ #define BRIGHTNESS(xyz) (xyz)->glow_radius>MAX_LIGHT_RADII? \ - MAX_LIGHT_RADII:(xyz)->glow_radius; + MAX_LIGHT_RADII:(xyz)->glow_radius; #define F_BUY 0 #define F_SELL 1 @@ -919,7 +912,7 @@ AP_NO_MERGE = 16, AP_IGNORE_CURSE = 32, AP_PRINT = 64 /* Print what to do, don't actually do it */ - /* Note this is supported in all the functions */ + /* Note this is supported in all the functions */ };