|
Do_Create & Do_Scare [By B. Brown] |
|
|
|
Posted Tuesday, February 2nd @ 11:40:23 PM, by George Greer in the Commands dept.
B. Brown writes
"Alright... here are two (simple!) commands that I
wrote to help out with quests. Do_Create creates an
object with the short description you give it... and
do_scare creates a whip made out of (argument)'s hide.
Do_Scare is really just for fun ;)"
Here's the code...
ACMD(do_create)
{
struct obj_data *miscobj;
skip_spaces(&argument);
if (!*argument) {
send_to_char("Create what?\r\n", ch);
return;
}
miscobj = create_obj();
miscobj->item_number = NOTHING;
miscobj->in_room = NOWHERE;
sprintf(buf2, "createobj %s", argument);
miscobj->name = str_dup(buf2);
sprintf(buf2, "%s has been left here.", argument);
miscobj->description = str_dup(buf2);
sprintf(buf2, "%s", argument);
miscobj->short_description = str_dup(buf2);
GET_OBJ_TYPE(miscobj) = ITEM_OTHER;
GET_OBJ_WEAR(miscobj) = ITEM_WEAR_TAKE + ITEM_WEAR_HOLD;
GET_OBJ_EXTRA(miscobj) = ITEM_NORENT;
GET_OBJ_WEIGHT(miscobj) = 1;
obj_to_char(miscobj, ch);
act("$n skillfully creates something!\r\n", FALSE, ch, 0, 0, TO_ROOM);
send_to_char("You skillfully create something! \r\n", ch);
}
ACMD(do_scare)
{
struct obj_data *whip;
skip_spaces(&argument);
/* one_argument(argument, buf); */
if (!*argument) {
send_to_char("Specify a mortal to scare.\r\n", ch);
return;
}
whip = create_obj();
whip->item_number = NOTHING;
whip->in_room = NOWHERE;
whip->name = str_dup("whip");
sprintf(buf2, "A whip made out of %s hide is lying here.", argument);
whip->description = str_dup(buf2);
sprintf(buf2, "a whip made out of %s hide", argument);
whip->short_description = str_dup(buf2);
GET_OBJ_TYPE(whip) = ITEM_WEAPON;
GET_OBJ_WEAR(whip) = ITEM_WEAR_TAKE + ITEM_WEAR_WIELD;
GET_OBJ_EXTRA(whip) = ITEM_NORENT;
GET_OBJ_VAL(whip, 0) = 5;
GET_OBJ_VAL(whip, 1) = 10;
GET_OBJ_VAL(whip, 2) = 10;
GET_OBJ_WEIGHT(whip) = 1;
GET_OBJ_RENT(whip) = 100000;
GET_OBJ_TIMER(whip) = 100000;
obj_to_room(whip, ch->in_room);
act("$n skillfully creates a whip!\r\n", FALSE, ch, 0, 0, TO_ROOM);
send_to_char("You skillfully create a whip! \r\n", ch);
/* send_to_room("%s makes a strange gesture.\r\n You feel scared! \r\n",GET_NAME(ch)); */
}
As always, if you use this code... I'd appreciate it if you'd just email me to tell me at ViperBrd@aol.com. If you have any questions/comments/suggestions about the code, feel free to email me as well...
- B. Brown
Lead Programmer, TimeTravellerMUD
timetraveller.digital-genesis.com 3000
<< Updated AutoEQ [by Xual] | Reply | View as text | Threaded | Player Stats Editor [By Karl N. Matthias] >> |
|
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.
|
|
|
|
|
|
|