This really has me stumped. I'd appreciate all help.
Okies, take your normal stock do_load function, but more importantly the
obj_loading section. Okies, now inside that, I have placed a call so
that if the PC is < LVL_GOD, they get called back and are not allowed to
load the item. i.e....
***SNIP***
obj = read_object(r_num, REAL);
if (GET_OBJ_EXTRA(obj) = ITEM_LIMITED && GET_LEVEL(ch) < LVL_GOD) {
send_to_char("That item has restricted loading due to its
&RLIMITED&n flag\r\n, ch);
send_to_char("Please see a GOD+ to load that item manually.\r\n",
ch);
return;
}
obj_to_room(obj, ch->in_room);
act("$n makes a strange magical gesture.", TRUE, ch, 0, 0, TO_ROOM);
act("$n has created $p!", FALSE, ch, obj, 0, TO_ROOM);
act("You create $p.", FALSE, ch, obj, 0, TO_CHAR);
} else
send_to_char("That'll have to be either 'obj' or 'mob'.\r\n", ch);
***END SNIP***
Now, assume the item has GLOW HUM LIMITED as its extra flags. With code
the way it is, when I load this item, all the extra flags get cleared
once it gets loaded. The item still has all of it's stats etc, but the
extra flags get wiped. If I change GET_OBJ_EXTRA(obj) = ITEM_LIMITED to
use a "==", the item keeps its flags, but any immortal with the load
command can load it. If I move that bit of code above the obj =
read_object() line, the mud crashes because it doesnt know what obj is
when called via get_obj_extra.
What I'm after is, how do I call this properly so that if the item has a
LIMITED flag (no matter what other extra flags it has) to fall into each
of these scenarios:
1. If < god, then quit out and not load the item;
2. If >= god, then load the item
and in doing this, 3. Dont clear all the extra flags.
I assume I'm calling it wrongly, but I can't see it at the
moment...anyone?
-Caniffe
---------------------------------------------------------------------
Julian Buckley, 3rd Year Computer Systems Engineering
Dept. Computer Science and Electrical Engineering, Univ. of Qld
E-Mail: s348266@student.uq.edu.au
Web Page: http://student.uq.edu.au/~s348266/index.html
-------------------------------------------------------------------
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST