|
Object Affect Flags [by ?] |
|
|
|
Posted Wednesday, August 12th @ 11:32:24 PM, by George Greer in the Objects dept.
. Click the link below to read it or download it.
OBJECT AFFECT FLAGS
This code will allow you to add affect flags to objects. At the end of
the file, there is also an example object with some affect flags set.
In db.c, go to parse_object() look for the switch statement of the
additional flags, then insert: [the part between the #defines is the
inserted code, the other is vanilla]
#ifdef HYPNO
/*
** affect player flags (see AFF_XXX flags in structs.h )
** This allows players flags to be affected by an item, for example
** create a ring which gives the player permanent sense life when worn.
**
** Note: more 'C' fields are allowed because all found 'C' (set char bits)
** fields are added to the current values. (nice for builders who
** don't want those large bitvector numbers in the obj file).
*/
case 'C':
get_line(obj_f, line);
sscanf(line, "%d ", t);
obj_proto[i].obj_flags.bitvector = obj_proto[i].obj_flags.bitvector | t[0
];
break;
#endif
case '$':
case '#':
top_of_objt = i++;
return line;
break;
default:
fprintf(stderr, "Format error in %s\n", buf2);
Once this is done, you can now add the flag to your object files. The
example below shows how:
_________________________________________________________________
#1214
ring wedding~
Piney's wedding ring~
Piney's wedding ring is lying here.~
~
9 94664 16391
10 0 0 0
1 0 0
C
2
E
ring wedding~
This ring is a masterpiece! the shiny golden blue ring is attached to
a platinum cord and has an inscription of silvery symbols.
~
E
cord platinum~
The cord looks really strange as if it can grow and shrink.
~
E
silvery symbols~
Jade my beloved wife - the day of the Sun, month of the Old Forces,
317.
~
<< New Score Format (Another) [by Lars Juul] | Reply | View as text | Threaded | Object Damage [by Andy Hubbard] >> |
|
Related Links |
|
|
|
CircleMUD Snippets |
|
|
Note: Not all of these snippets will work perfectly with
your version of code, so be prepared to fix one
or two bugs that may arise, and please let me know
what you needed to do to fix it. Sending a corrected
version is always welcome.
|
Finally, if you wish to use any of the snippets from this
page, you are more than welcome, just mention the
authors in your credits. If you wish to release any
of these snippets to the public on another site,
contact me FIRST.
|
|
|
|
|
|
|