On that note, I've also left some key parts of adding these to a working MUD out. You could add what I put here, and it will compile fine, however it wont have any affect. This is another safety net, if you aren't competent enough to implement these without the few details that are missing... then it isn't safe for you to have them because you could not properly prevent them from abuse.
[DISCLAIMER] That isn't rudeness either, just simple fact. But if you felt abused by it, you don't have my apologies. Sometimes the truth hurts, and I am a very blunt person. I don't have problems with the truth, and if you do, it really is your problem.
madvance:
ACMD(do_madvance)
{
struct char_data *victim;
char name[MAX_INPUT_LENGTH], level[MAX_INPUT_LENGTH];
int newlevel, oldlevel;
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
two_arguments(argument, name, level);
if (!*name) {
mob_log(ch, "madvance: bad syntax");
return;
}
if (*name == UID_CHAR) {
if (!(victim = get_char(name))) {
mob_log(ch, "madvance: victim (%s) does not exist", name);
return;
}
} else if (!(victim = get_char_vis(ch, name, NULL, FIND_CHAR_WORLD))) {
mob_log(ch, "madvance: victim (%s) not found", name);
return;
}
if (IS_IMMORT(victim) == TRUE) {
mob_log(ch, "Maybe that's not such a great idea.");
return;
}
if (IS_NPC(victim)) {
mob_log(ch, "NO! Not on NPC's.");
return;
}
if (!*level || (newlevel = atoi(level)) <= 0) {
mob_log(ch, "That's not a level!");
return;
}
if ((newlevel > LVL_OWNER && IS_IMMORT(victim)) || (newlevel > 65000)) {
mob_log(ch, "%d is the highest possible level.", IS_IMMORT(victim) ? LVL_OWNER : 65000);
return;
}
if (newlevel == GET_LEVEL(victim)) {
mob_log(ch, "They are already at that level.");
return;
}
oldlevel = GET_LEVEL(victim);
if (newlevel < GET_LEVEL(victim)) {
/* do_start(victim); Unneeded? */
GET_LEVEL(victim) = newlevel;
send_to_char(victim, "You are momentarily enveloped by darkness!\r\nYou feel somewhat diminished.\r\n");
} else {
act("$n makes some strange gestures.\r\n"
"A strange feeling comes upon you,\r\n"
"Like a giant hand, light comes down\r\n"
"from above, grabbing your body, that\r\n"
"begins to pulse with colored lights\r\n"
"from inside.\r\n\r\n"
"Your head seems to be filled with demons\r\n"
"from another plane as your body dissolves\r\n"
"to the elements of time and space itself.\r\n"
"Suddenly a silent explosion of light\r\n"
"snaps you back to reality.\r\n\r\n"
"You feel slightly different.", FALSE, ch, 0, victim, TO_VICT);
}
if (newlevel < oldlevel)
mob_log(ch, "%s demoted %s from level %d to %d.", GET_NAME(ch), GET_NAME(victim), oldlevel, newlevel);
else
mob_log(ch, "%s has advanced %s to level %d (from %d)", GET_NAME(ch), GET_NAME(victim), newlevel, oldlevel);
if (oldlevel >= LVL_IMMORT && newlevel < LVL_IMMORT && IS_IMMORT(victim)) {
/*
* If they are no longer an immortal, let's remove some of the
* nice immortal only flags, shall we?
*/
REMOVE_BIT(PRF_FLAGS(victim), PRF_LOG1 | PRF_LOG2);
REMOVE_BIT(PRF_FLAGS(victim), PRF_NOHASSLE | PRF_HOLYLIGHT | PRF_ROOMFLAGS);
IS_IMMORT(victim) = FALSE;
run_autowiz();
} else if (oldlevel < LVL_IMMORT && newlevel >= LVL_IMMORT && IS_IMMORT(victim)) {
SET_BIT(PRF_FLAGS(victim), PRF_LOG2);
SET_BIT(PRF_FLAGS(victim), PRF_HOLYLIGHT | PRF_ROOMFLAGS | PRF_AUTOEXIT);
SET_BIT(PRF_FLAGS(victim), PRF_COLOR_1 | PRF_COLOR_2);
run_autowiz();
}
gain_exp_regardless(victim, level_exp(GET_CLASS(victim), newlevel) - GET_EXP(victim), oldlevel);
save_char(victim);
}
oadvance:
OCMD(do_oadvance)
{
struct char_data *victim;
char name[MAX_INPUT_LENGTH], level[MAX_INPUT_LENGTH];
int newlevel, oldlevel;
two_arguments(argument, name, level);
if (!*name) {
obj_log(obj, "madvance: bad syntax");
return;
}
if (!(victim = get_char_by_obj(obj, name))) {
obj_log(obj, "madvance: victim (%s) not found", name);
return;
}
if (IS_IMMORT(victim) == TRUE) {
obj_log(obj, "Maybe that's not such a great idea.");
return;
}
if (IS_NPC(victim)) {
obj_log(obj, "NO! Not on NPC's.");
return;
}
if (!*level || (newlevel = atoi(level)) <= 0) {
obj_log(obj, "That's not a level!");
return;
}
if ((newlevel > LVL_OWNER && IS_IMMORT(victim)) || (newlevel > 65000)) {
obj_log(obj, "%d is the highest possible level.", IS_IMMORT(victim) ? LVL_OWNER : 65000);
return;
}
if (newlevel == GET_LEVEL(victim)) {
obj_log(obj, "They are already at that level.");
return;
}
oldlevel = GET_LEVEL(victim);
if (newlevel < GET_LEVEL(victim)) {
/* do_start(victim); Unneeded? */
GET_LEVEL(victim) = newlevel;
send_to_char(victim, "You are momentarily enveloped by darkness!\r\nYou feel somewhat diminished.\r\n");
} else {
act("$n makes some strange gestures.\r\n"
"A strange feeling comes upon you,\r\n"
"Like a giant hand, light comes down\r\n"
"from above, grabbing your body, that\r\n"
"begins to pulse with colored lights\r\n"
"from inside.\r\n\r\n"
"Your head seems to be filled with demons\r\n"
"from another plane as your body dissolves\r\n"
"to the elements of time and space itself.\r\n"
"Suddenly a silent explosion of light\r\n"
"snaps you back to reality.\r\n\r\n"
"You feel slightly different.", FALSE, victim, 0, obj, TO_CHAR);
}
if (newlevel < oldlevel)
obj_log(obj, "%s demoted %s from level %d to %d.", GET_OBJ_NAME(obj), GET_NAME(victim), oldlevel, newlevel);
else
obj_log(obj, "%s has advanced %s to level %d (from %d)", GET_OBJ_NAME(obj), GET_NAME(victim), newlevel, oldlevel);
if (oldlevel >= LVL_IMMORT && newlevel < LVL_IMMORT && IS_IMMORT(victim)) {
/*
* If they are no longer an immortal, let's remove some of the
* nice immortal only flags, shall we?
*/
REMOVE_BIT(PRF_FLAGS(victim), PRF_LOG1 | PRF_LOG2);
REMOVE_BIT(PRF_FLAGS(victim), PRF_NOHASSLE | PRF_HOLYLIGHT | PRF_ROOMFLAGS);
IS_IMMORT(victim) = FALSE;
run_autowiz();
} else if (oldlevel < LVL_IMMORT && newlevel >= LVL_IMMORT && IS_IMMORT(victim)) {
SET_BIT(PRF_FLAGS(victim), PRF_LOG2);
SET_BIT(PRF_FLAGS(victim), PRF_HOLYLIGHT | PRF_ROOMFLAGS | PRF_AUTOEXIT);
SET_BIT(PRF_FLAGS(victim), PRF_COLOR_1 | PRF_COLOR_2);
run_autowiz();
}
gain_exp_regardless(victim, level_exp(GET_CLASS(victim), newlevel) - GET_EXP(victim), oldlevel);
save_char(victim);
}
wadvance:
WCMD(do_wadvance)
{
struct char_data *victim;
char name[MAX_INPUT_LENGTH], level[MAX_INPUT_LENGTH];
int newlevel, oldlevel;
two_arguments(argument, name, level);
if (!*name) {
wld_log(room, "madvance: bad syntax");
return;
}
if (!(victim = get_char_by_room(room, name))) {
wld_log(room, "madvance: victim (%s) not found", name);
return;
}
if (IS_IMMORT(victim) == TRUE) {
wld_log(room, "Maybe that's not such a great idea.");
return;
}
if (IS_NPC(victim)) {
wld_log(room, "NO! Not on NPC's.");
return;
}
if (!*level || (newlevel = atoi(level)) <= 0) {
wld_log(room, "That's not a level!");
return;
}
if ((newlevel > LVL_OWNER && IS_IMMORT(victim)) || (newlevel > 65000)) {
wld_log(room, "%d is the highest possible level.", IS_IMMORT(victim) ? LVL_OWNER : 65000);
return;
}
if (newlevel == GET_LEVEL(victim)) {
wld_log(room, "They are already at that level.");
return;
}
oldlevel = GET_LEVEL(victim);
if (newlevel < GET_LEVEL(victim)) {
/* do_start(victim); Unneeded? */
GET_LEVEL(victim) = newlevel;
send_to_char(victim, "You are momentarily enveloped by darkness!\r\nYou feel somewhat diminished.\r\n");
} else {
act("$n makes some strange gestures.\r\n"
"A strange feeling comes upon you,\r\n"
"Like a giant hand, light comes down\r\n"
"from above, grabbing your body, that\r\n"
"begins to pulse with colored lights\r\n"
"from inside.\r\n\r\n"
"Your head seems to be filled with demons\r\n"
"from another plane as your body dissolves\r\n"
"to the elements of time and space itself.\r\n"
"Suddenly a silent explosion of light\r\n"
"snaps you back to reality.\r\n\r\n"
"You feel slightly different.", FALSE, victim, 0, NULL, TO_CHAR);
}
if (newlevel < oldlevel)
wld_log(room, "%s demoted %s from level %d to %d.", room->name, GET_NAME(victim), oldlevel, newlevel);
else
wld_log(room, "%s has advanced %s to level %d (from %d)", room->name, GET_NAME(victim), newlevel, oldlevel);
if (oldlevel >= LVL_IMMORT && newlevel < LVL_IMMORT && IS_IMMORT(victim)) {
/*
* If they are no longer an immortal, let's remove some of the
* nice immortal only flags, shall we?
*/
REMOVE_BIT(PRF_FLAGS(victim), PRF_LOG1 | PRF_LOG2);
REMOVE_BIT(PRF_FLAGS(victim), PRF_NOHASSLE | PRF_HOLYLIGHT | PRF_ROOMFLAGS);
IS_IMMORT(victim) = FALSE;
run_autowiz();
} else if (oldlevel < LVL_IMMORT && newlevel >= LVL_IMMORT && IS_IMMORT(victim)) {
SET_BIT(PRF_FLAGS(victim), PRF_LOG2);
SET_BIT(PRF_FLAGS(victim), PRF_HOLYLIGHT | PRF_ROOMFLAGS | PRF_AUTOEXIT);
SET_BIT(PRF_FLAGS(victim), PRF_COLOR_1 | PRF_COLOR_2);
run_autowiz();
}
gain_exp_regardless(victim, level_exp(GET_CLASS(victim), newlevel) - GET_EXP(victim), oldlevel);
save_char(victim);
}


