|
Poofset Command [by Rasdan] |
|
|
|
Posted Wednesday, August 12th @ 11:33:42 PM, by George Greer in the Wizard dept.
Added Mar 5, 1997. Click the link below to read it or download it.
From: Rasdan <thomajam@ucs.orst.edu>
Subject: Poofin/Poofout
After looking at a significant thread on poofin and poofout, and also
because I am a silly coder who doesn't yet understand double pointers, I
rewrote the poofin/poofout commands as two separate commands, instead of
one that, when no argument is entered, will display your current poofin or
poofout.
Here is the code for them, if anyone cares:
In act.wizard.c, search for: ACMD(do_poofset) and delete that function.
Where that was, add these:
ACMD(do_poofin)
{
skip_spaces(&argument);
if (!*argument)
{
sprintf(buf, "Current Poofin: %s %s\r\n", GET_NAME(ch), POOFIN(ch));
send_to_char(buf, ch);
return;
}
if (POOFIN(ch))
free(POOFIN(ch));
POOFIN(ch) = str_dup(argument);
sprintf(buf, "Poofin set to: %s %s\r\n", GET_NAME(ch), POOFIN(ch));
send_to_char(buf, ch);
}
ACMD(do_poofout)
{
skip_spaces(&argument);
if (!*argument)
{
sprintf(buf, "Current Poofout: %s %s\r\n", GET_NAME(ch), POOFOUT(ch));
send_to_char(buf, ch);
return;
}
if (POOFOUT(ch))
free(POOFOUT(ch));
POOFOUT(ch) = str_dup(argument);
sprintf(buf, "Poofout set to: %s %s\r\n", GET_NAME(ch), POOFOUT(ch));
send_to_char(buf, ch);
}
Then in interpreter.c, remove the ACMD(do_poofset) prototype and
add instead:
ACMD(do_poofin);
ACMD(do_poofout);
In the Master Command List, where the poofin/poofout commands are
defined, change them to:
{ "poofin", POS_DEAD, do_poofin, LVL_IMMORT, 0},
{ "poofout", POS_DEAD, do_poofout, LVL_IMMORT, 0},
That should be everything. Of course, I can't remember if POOFIN(ch) is
part of stock circle or not (I'm sure it is). If not, you will have to
define them for yourself.
Later,
Rasdan
<< Poofin/Poofout Saving [by John Dodds] | Reply | View as text | Flattened | Portal Spell (Ideas) [by Ground Zero] >> |
|
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.
|
|
|
|
|
|
|