Code: Select all
/getskills

Code: Select all
/getskills
Code: Select all
void PlayerOrder_GetSkills(int iClientH);
Code: Select all
if (memcmp(cp, "/getskills", 10) == 0) {
PlayerOrder_GetSkills(iClientH);
return;
}
Code: Select all
void CGame::PlayerOrder_GetSkills(int iClientH) {
{
int i;
char buff [100];
char cItemName[20];
int ipoints;
if (m_pClientList[iClientH] == NULL) return;
ipoints = m_pClientList[iClientH]->m_cSkillMastery;
PutLogList(buff);
if (ipoints > 0) return;
m_pClientList[iClientH]->m_cSkillMastery = 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100;
wsprintf(buff,"Your Skills are all 100 now");
ShowRepNotice(iClientH,buff);
return;
}
}
Code: Select all
get the character-skill-limit (will call it $skill_limit)
get the character-stats-limit (will call it $stats_limit)
get the character STR, DEX, INT, MAG in an array (will call it $char_stats)
If the $skill_limit is > 100 * the number of skills in the game (18, without counting the ??? skills), then you can raise all skills to 100%
else
sort the $char_stats array numerically, bigger stat in first
then make a switch on the first value of the array ($charstats[1])
in case the first value is STR or DEX, and this value is at least 50% of $stats_limit (ex: STR > 100 on a server with 200 max stats), the char must be a warrior, or fencer
in case the first value is MAG or INT, the char must be a mago
in case there is no value >= $stats_limit/2 the char can be a bmage or a kind of paladin, or a low level player
Now you know what's the char class, so set his usefull skills to 100% while total skills points don't reach the $skill_limit allowed by the server. If the stats are not high enough, display a small msg to explain to the player that he would train a little before havin' easy way 100% skills
lol who cares about having 100% in all the availible skills, its a private server if your going to get all of the skills from a PHP anyways whats the difference in just creating a code for it, all u would have to do is just put 0 on the non usable ones or something if u were worried about having every single one 100%, besides it only takes like 3 seconds to open up your settings file, change the limit, save it and close it, instead of trying to complicate simple things just go with the easy stuff, it makes it alot easier on everybody but I guess if u felt like adding /skills-bmage /skills-warrior and all that bs to your server then go for it but if it was me I would prefer a simple /skills and your done, even if I wont use half the skills its better than bothering with other commands, but yea anyways thx pener for the guidance to some ppl...but I still in a way think if ppl cant write that small bit of C++ what are they doing in the sources anyways....I get irritated from ignorance...diuuude wrote: What about if the skill limit is set to 1500 or 2000 in settings.cfg ? I will disconnect you for hacking attempt.
I think this would be better to code it that it only gives you 100% to the skills you are able to use (a pure war don't care about 100% magic or 100% alchemy, a pure mago won't use Mining, Manuf, long swords, short swords...).
i don't code with C++ but i made a php script with javascript functions that check this value, compare it with the skills you are trying to increase and says you if you go over the character-skill-limit. Maybe you can use functions like this in the game.cpp and improve it a little to set only the most usefull skills to 100%.
It should do something like this, using character-skill-limit value
Add some cases in the switch for Bmages, Paladins, and select the skills that would be set to 100% for each class, sort what skill have to be raised with priority before reaching the $skill_limit... This way i would always work, even if you set character-skill-limit to 700 or 3000, and set only the most usefull skills to 100% if you can't have all of them 100%Code: Select all
get the character-skill-limit (will call it $skill_limit) get the character-stats-limit (will call it $stats_limit) get the character STR, DEX, INT, MAG in an array (will call it $char_stats) If the $skill_limit is > 100 * the number of skills in the game (18, without counting the ??? skills), then you can raise all skills to 100% else sort the $char_stats array numerically, bigger stat in first then make a switch on the first value of the array ($charstats[1]) in case the first value is STR or DEX, and this value is at least 50% of $stats_limit (ex: STR > 100 on a server with 200 max stats), the char must be a warrior, or fencer in case the first value is MAG or INT, the char must be a mago in case there is no value >= $stats_limit/2 the char can be a bmage or a kind of paladin, or a low level player Now you know what's the char class, so set his usefull skills to 100% while total skills points don't reach the $skill_limit allowed by the server. If the stats are not high enough, display a small msg to explain to the player that he would train a little before havin' easy way 100% skills
Code: Select all
void CGame::PlayerOrder_GetSkills(int iClientH) {
{
char buff [100], cItemName[21];
int i, ipoints;
if (m_pClientList[iClientH] == NULL) return;
m_pClientList[iClientH]->m_cSkillMastery;
PutLogList(buff);
if (ipoints > 0) return;
if m_pClientList[iClientH]->m_cSkillMastery[i] > 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 0 0 0 0 100 0 100 0 100 0 0 0 3 20 24 0 24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
wsprintf(buff,"Your Skills are all 100 now");
ShowRepNotice(iClientH,buff);
return;
}
}
Code: Select all
CODES
Is his work...tell HIM to release it.DarkStaff wrote: Acidx coded it. Acidx is done with helbreath so just release it.
Twist.