relevel.txt.2
snippets · 2.5 KB · 2010-03-30
Relevel for Buddha-style MUDs: lets you set the player's relevel level (needs a pwipe).
Download « Back to the snippets list
This is a new version of relevel for buddha. This version allows you to set the players relevel level. This will require a pwipe. You must also you ascii pfiles. So lets begin.
-Rikishi
1. open utils.h
Under GET_SEX(ch) add:
#define GET_RELVL(ch) ((ch)->player.relvl)
Now close utils.h
2. open structs.h
Now find struct char_player_data {
Somewhere in it add this:
byte relvl; /*used for relevel*/
now close structs.h
3. open pfdefaults.h
now somewhere in there add:
#define PFDEF_RELVL 0
now close pfdefaults.h
4. open db.c
now in load_char where it talks about GET_LEVEL(ch) = PFDEF_LEVEL; under that add:
GET_RELVL(ch) = PFDEF_RELVL;
Now scroll down till you find case 'R': under that add:
else if(!strcmp(tag, "Relv"))
GET_RELVL(ch) = num;
Now find save_char. now find:
if(GET_LEVEL(ch) != PFDEF_LEVEL)
fbprintf(fl, "Levl: %d\n", GET_LEVEL(ch));
under that add:
if (GET_RELVL(ch) != PFDEF_RELVL)
fbprintf(fl, "Relv: %d\n", GET_RELVL(ch));
now close db.c
5. open act.wizard.c
Now find the do set stuff and under { "olc", LVL_GRGOD, PC, MISC }, add:
{ "relvl", LVL_OWNER, PC, NUMBER},
now scroll down and find the next case number then add this:
case 54:
if ((!IS_NPC(vict) && value > GET_LEVEL(ch)) || value > LVL_OWNER) {
send_to_char(ch, "You can't do that.\r\n");
return (0);
}
RANGE(0, LVL_OWNER);
vict->player.relvl = value;
break;
now close act.wizard.c
6. open class.c
search for do_start find the void do_Start then add
GET_RELVL(ch) = 1;
now close class.c
7. Now open act.other.c
Under ACMD(do_file); add: ACMD(do_relevl);
Now go all the way down to the end of the file and add this:
ACMD(do_relevel)
{
if (GET_RELVL(ch) >= LVL_IMMORT) {
send_to_char(ch, "@DWelcome back @R%s@D!@n\r\n", GET_NAME(ch));
GET_LEVEL(ch) = GET_RELVL(ch);
} else {
send_to_char(ch, "Sorry your not an immortal\r\n");
}
}
now close act.other.c
8. open interpreter.c
now where it defines all the ACMDs add this: ACMD(do_relevel);
then search add it where it defines them as { "baba" }, add this:
{ "relevel" , "relevel" , POS_DEAD , do_relevel , 0, 0 },
now close.
9. now complie.
Personal Notes:
I've used LVL_OWNER cause its my defined as the highest level. YOU WILL BE REQUIRED To pwipe to get it to work.
thanks thats all hope you enjoy.