Wizhelp for a godwars mud (heavily modified)

Posted by Dextermovie on Wed 11 Jan 2006 02:16 AM — 8 posts, 28,821 views.

#0
our Wizhelp only gives those of each lvl The powers of that lvl and lvl 5 IE, if your 11, you only have lv.11 powers and lv.5 powers same with 8 - lv. 8 powers and lv. 5 powers.. we wana make it so that 11 has all its powers and the ones below it.

here is the wizhelp code

void do_wizhelp( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
int cmd;
int col;
int rep;
// Levels added by: NebuLogic
col = 0;
for ( rep = 1; rep <= 12; rep ++ )
{
for ( cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++ )
{
if (cmd_table[cmd].level != rep)
continue;
if (cmd_table[cmd].level < 4)
continue;

if (ch->level < 12 && ch->trust < 12 && ch->level > 3 &&
cmd_table[cmd].level != ch->level && cmd_table[cmd].level > 5)
continue;
else
{

sprintf( buf, "#c[#C%-2d#c]#7%-12s", cmd_table[cmd].level, cmd_table[cmd].name );
send_to_char( buf, ch );
if ( ++col % 4 == 0 )
send_to_char( "\n\r", ch );
}
}
}
if ( col % 4 != 0 )
send_to_char( "\n\r", ch );
return;
}

any help on this is greatly appreciated
USA #1
If this is Godwars, wrong section. GodWars isn't Smaug.

From my best guess, modifying the wizhelp will not change the permissions of the commands. You may be in the wrong place.
#2
ok, thanks I am not actually trying to change the level of the commands ... just what commands show up when you use the wiz help command
USA #3
Well to start, you don't need this else:
if (ch->level < 12 && ch->trust < 12 && ch->level > 3 &&
cmd_table[cmd].level != ch->level && cmd_table[cmd].level > 5)
continue;
else

Since it already continues, there is no need for an else.
#4
Ok, after talking to the mud owner and about an hour of him getting pissy about it .. I got what he wants ..

he wants lvl 5-10 to be able to see their trust level and level 5 comands ( level 6 =6,5 commands ... level 7 = level 7 and 5 .. etc)
level 11 to be able to see level 11 and lower commands, and level 12 to be able to see all the commands

yet again, any help is greatly appreciated ...
USA #5
Try this:
if ( ch->level >= 5 && ch->level <= 10 && (cmd_table[cmd].level != ch->trust || cmd_table[cmd].level != 5 ))
  continue;
#6
if I replace our " if (ch->level < 12 && ch->trust < 12 && ch->level > 3 &&
cmd_table[cmd].level != ch->level && cmd_table[cmd].level > 5)
continue;
else"
then no imm under level 11 can see any of their imm commands

** Edit **
With the way the wizhelp was, every thing worked but level 11 can not see level 6,7,8,9,10 commands
Amended on Thu 12 Jan 2006 01:40 PM by Dextermovies
USA #7
The code that I gave you has nothing to do with a level 11. Which means the problem is in the code you already have.