Thread: #setmyskills
View Single Post
  #1  
Old 10-23-2002, 12:27 PM
Wynsom
Sarnak
 
Join Date: Oct 2002
Posts: 36
Default #setmyskills

I made a simple new function from another one for skills. Rather than using #setskill and #setskillall, this function requires no paramaters and will set the skills of a player to 10x their level until it reaches 252 (lvl 26).

Insert this in client.cpp after #setskill:
Code:
////////SET MY SKILLS
		else if ((strcasecmp(sep.arg[0], "#setmyskills") == 0 || strcasecmp(sep.arg[0], "#setmyskills") == 0) && CheckAccess(cmdlevel, 0)) {
			if (target == 0) {
				Message(0, "Error: #setmyskills: No target.");
			}
			else {
				cout << "Setting your skills to correspond with your level." << endl;
				//int8 skill_id = atoi(sep.arg[1]);
				int skill_id = ((target->GetLevel()) * 10);
				if(skill_id >252) 
					skill_id=252;
				for(int skill_num=0;skill_num<74;skill_num++){
					target->SetSkill(skill_num, skill_id);
				}
			}
		}
Why do this? So you can play a game with player privs turned off. My biggest complaint was you couldnt use trainers and not set skills so this is a settlement between those. Right now, it will set all skills to the level * 10 but theres no cap on skills so anything past that will get set back. I will sit down and write out code to prevent that when i get some time.
Reply With Quote