Here is my implementation of the level cap for the /level command. I haven't gone into the regular XP leveling since that is dangerous waters for me (grin)... this is also just for Adventure XP, since that's the only one we support at the moment. Hopefully it's a base to implement the other level caps.
Patch:
Download
OPTIONAL SQL updates:
insert into `variables`(`variable_name`,`variable_value`,`comment`) values ( 'level_cap','80','Maximum level allowed on this server');
insert into `variables`(`variable_name`,`variable_value`,`comment`) values ( 'level_cap_status_override','100','admin_status required to override level_cap');
How it works:
Client types /level 255, first the COMMAND_LEVEL checks if there is a level_cap value in `variables`, if not, it ignores the entire code block and levels the client up.
If there is a level_cap value, it then compares the admin_status of the client to the level_cap_override_status value in `variables`. If that passes, the client is leveled up. If not, the client is set to the level set in the level_cap variable value.
Please feel free to tweak, as this is just what I needed to get by for now. I was also unsure of the including of Variables.h and the extern stuff, I just saw that's how Image did it for zone access and mimicked him.
