On Fri, 5 Apr 1996, Christopher M. Lee wrote:
> Here is a quick one. Can you set a players exp. I know you can level him
> but is there a way to give him/her 10exp for a good deed, or good roll
> playing or solving a quest, you get the idea. I want to offer rewards of
> exp for some of the above and also maybe some other stuff. Let me know.
I think there is a 'set <player> exp' command, but in any case, it'd be
easier just to write a small command to do it. Like:
ACMD(do_reward)
{
struct char_data *vict;
char arg [MAX_INPUT_LENGTH};
char arg2[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
two_arguments(argument, arg, arg2);
if (!*arg || !*arg2 || !(vict = get_char_vis(ch, arg))) {
send_to_char("Reward who how much exp?\r\n", ch);
return;
}
if (atoi(arg2) < 1) {
send_to_char("You can only reward positive exp.\r\n", ch);
return;
}
/* I forget the paramters of gain_exp_regardless since I don't have it
* in my MUD, so replace the following line with the right thing :) */
gain_exp_regardless(vict, atoi(arg2));
sprintf(buf, "%s has rewarded %s %d exp.", GET_NAME(ch), GET_NAME(vict),
atoi(arg2));
/* I forget the parameters of mudlog, as well, since mine is different
* from the one in stock... */
mudlog(buf, LVL_GRGOD, /*whatever else goes here*/);
}
That code isn't just drop-in, you'll need to make changes as noted. I
realize that the casting of 'buf' (and probably 'arg') is not neccessary,
but I tend to do it anyway.
--
Daniel Koepke, coder of The Dragon's Keep
dstar.california.com 4000, current in ALPHA
This archive was generated by hypermail 2b30 : 12/18/00 PST