[Src]->getskilled Command

Codes already submitted by people of the forums.
SlammeR
Loyal fan
Posts: 219
Joined: Fri Nov 04, 2005 1:52 am
Location: Brazil

Post by SlammeR »

thanks for help diuuude... works like a charm ;)

This code will work like the comand in hbcelestial...

Code: Select all

//Original GetSkills By diuuude
//Edited by SlammeR
void CGame::PlayerOrder_GetSkills(int iClientH)
{
int i;
if (m_pClientList[iClientH] == NULL) return;
for (i = 0; i <= 23; i++) {
       //Mining
       if (m_pClientList[iClientH]->m_iStr >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[0] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[0] = m_pClientList[iClientH]->m_iStr*2;
       }
       /************************************************************************************************/
       //Fishing
       if (m_pClientList[iClientH]->m_iDex >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[1] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[1] = m_pClientList[iClientH]->m_iDex*2;
       }
       /************************************************************************************************/
       //Farming
       if (m_pClientList[iClientH]->m_iInt >= 50){ 
             m_pClientList[iClientH]->m_cSkillMastery[2] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[2] = m_pClientList[iClientH]->m_iInt*2;
       }
       /************************************************************************************************/
       //Magic-Resistance
       if (m_pClientList[iClientH]->m_iLevel >= 50){ 
             m_pClientList[iClientH]->m_cSkillMastery[3] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[3] = m_pClientList[iClientH]->m_iLevel*2;
       }
       /************************************************************************************************/
       //Magic
       if (m_pClientList[iClientH]->m_iMag >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[4] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[4] = m_pClientList[iClientH]->m_iMag*2;
       }
       /************************************************************************************************/
       //Hand-Attack
       if (m_pClientList[iClientH]->m_iStr >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[5] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[5] = m_pClientList[iClientH]->m_iStr*2;
       }
       /************************************************************************************************/
       //Archery
       if (m_pClientList[iClientH]->m_iDex >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[6] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[6] = m_pClientList[iClientH]->m_iDex*2;
       }
       /************************************************************************************************/
       //Short-Sword
       if (m_pClientList[iClientH]->m_iDex >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[7] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[7] = m_pClientList[iClientH]->m_iDex*2;
       }
       /************************************************************************************************/
       //Long-Sword
       if (m_pClientList[iClientH]->m_iDex >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[8] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[8] = m_pClientList[iClientH]->m_iDex*2;
       }
       /************************************************************************************************/
       //Fencing
       if (m_pClientList[iClientH]->m_iDex >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[9] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[9] = m_pClientList[iClientH]->m_iDex*2;
       }
       /************************************************************************************************/
       //Axe-Attack
       if (m_pClientList[iClientH]->m_iDex >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[10] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[10] = m_pClientList[iClientH]->m_iDex*2;
       }
       /************************************************************************************************/
       //Shield
       if (m_pClientList[iClientH]->m_iDex >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[11] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[11] = m_pClientList[iClientH]->m_iDex*2;
       }
       /************************************************************************************************/
       //Alchemy
       if (m_pClientList[iClientH]->m_iInt >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[12] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[12] = m_pClientList[iClientH]->m_iInt*2;
       }
       /************************************************************************************************/
       //Manufacturing
       if (m_pClientList[iClientH]->m_iStr >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[13] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[13] = m_pClientList[iClientH]->m_iStr*2;
       }
       /************************************************************************************************/
       //Hammer
       if (m_pClientList[iClientH]->m_iStr >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[14] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[14] = m_pClientList[iClientH]->m_iStr*2;
       }
       /************************************************************************************************/
       //Pretend-Corpse
       if (m_pClientList[iClientH]->m_iInt >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[19] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[19] = m_pClientList[iClientH]->m_iInt*2;
       }
       /************************************************************************************************/
       //Staff-Attack
       if (m_pClientList[iClientH]->m_iMag >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[21] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[21] = m_pClientList[iClientH]->m_iMag*2;
       }
       /************************************************************************************************/
       //Poison-Resistance
       if (m_pClientList[iClientH]->m_iVit >= 50){
             m_pClientList[iClientH]->m_cSkillMastery[23] = 100;
       }
       else
       {
       m_pClientList[iClientH]->m_cSkillMastery[23] = m_pClientList[iClientH]->m_iVit*2;
       }
       /************************************************************************************************/
       SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SKILL, i, m_pClientList[iClientH]->m_cSkillMastery[i], NULL, NULL);
   }
}
OWNED!<br><img src='http://img50.imageshack.us/img50/1386/p ... 3vsqn2.gif' border='0' alt='user posted image' /><br><br><img src="http://hbtop50.com/button.php?u=hbuonline" alt="Helbreath Top 50 - Keepin' it real." border="0" /><br><a href='http://www.hbuonline.net' target='_blank'>Helbreath United</a>
MiNiFooBoo
noob
Posts: 10
Joined: Sun May 07, 2006 9:18 pm

Post by MiNiFooBoo »

O I didn't even test the code with higher stats than 50 lol. Thanks for noticing and fixing :)
Warlord
Regular
Posts: 34
Joined: Sun Dec 05, 2004 11:08 am

Post by Warlord »

Just what I needed. It's a great code :D

One more question: Warriors can have some skills 100%, but Can anyone write me a code, where warriors will get 90 mag...and then they need mag50 for to get magic 100% ??? :lol:


mkay, that mages will get 90% shield and not 100% with this command.

Correct me if I am wrong. :rolleyes:

Code: Select all

for(i = 0; i <= 23; i++)
	{
  if (i == 11)
  {
  	//Skills that will be set to 90%
  	m_pClientList[iClientH]->m_cSkillMastery[i] = 90;
  }
	}
€M4NU€L
Outpost bitch
Posts: 517
Joined: Sat Nov 19, 2005 9:07 pm
Location: I watch gay porn
Contact:

Post by €M4NU€L »

Warlord wrote: Just what I needed. It's a great code :D

One more question: Warriors can have some skills 100%, but Can anyone write me a code, where warriors will get 90 mag...and then they need mag50 for to get magic 100% ??? :lol:


mkay, that mages will get 90% shield and not 100% with this command.

Correct me if I am wrong. :rolleyes:

Code: Select all

for(i = 0; i <= 23; i++)
	{
  if (i == 11)
  {
  	//Skills that will be set to 90%
  	m_pClientList[iClientH]->m_cSkillMastery[i] = 90;
  }
	}
Thats right...
<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
Warlord
Regular
Posts: 34
Joined: Sun Dec 05, 2004 11:08 am

Post by Warlord »

So, another noob question. How can I write this: If a warrior has 90 magic, then if he wants to make it up to 100% He needs magic 50.
Can anyone help me? Correct me if you see any problems with this code.. :o

Code: Select all

///Getskilled commands for Warrios and mages. 21.05.2006

void CGame::PlayerOrder_WarriorSkills(int iClientH)
{
	register int i;
	if (m_pClientList[iClientH] == NULL) return;
	if ((m_pClientList[iClientH]->m_iStr < m_pClientList[iClientH]->m_iMag) || (m_pClientList[iClientH]->m_iStr < m_pClientList[iClientH]->m_iInt) || (m_pClientList[iClientH]->m_iStr < 130))
	{ 
  // STR must be at least 130 and STR > INT and STR > MAG
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "You must be a warrior with at least 130 STR");
  return;
	}
	if ((m_pClientList[iClientH]->m_iDex < m_pClientList[iClientH]->m_iInt) || (m_pClientList[iClientH]->m_iDex < m_pClientList[iClientH]->m_iInt) || (m_pClientList[iClientH]->m_iDex < 100))
	{ 
  // DEX must be at least 100 and DEX > INT and DEX > MAG
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "You must be a warrior with at least 100 DEX");
  return;
	}
  for (i = 0; i <= 23; i++)
  {
  	if (i >= 5 && i <= 9 || i == 10 || i == 11 || i == 14)
  	{
    // Skills that will be set to 100% : Hand, Archery, SS, LS, Fencing, Axe, Shield, Hammer
    m_pClientList[iClientH]->m_cSkillMastery[i] = 100;
    SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SKILL, i, m_pClientList[iClientH]->m_cSkillMastery[i], NULL, NULL); // Update skills status
  	}
  	if (i == 3)
  	{
    //Skills that will be set to 70: Magic - Resistance
    m_pClientList[iClientH]->m_cSkillMastery[i] = 70;
    SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SKILL, i, m_pClientList[iClientH]->m_cSkillMastery[i], NULL, NULL); // Update skills status
  	}
  	if (i == 4)
  	{
    //Skills that will be set to 90: Magic
    m_pClientList[iClientH]->m_cSkillMastery[i] = 90;
    SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SKILL, i, m_pClientList[iClientH]->m_cSkillMastery[i], NULL, NULL); // Update skills status
  	}
  }
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "Now you are a skilled warrior");
return;
}

//Getskilled command for Mages. 21.05.2006

void CGame::PlayerOrder_MageSkills(int iClientH)
{
	register int i;
	if (m_pClientList[iClientH] == NULL) return;
	if ((m_pClientList[iClientH]->m_iMag < m_pClientList[iClientH]->m_iStr) || (m_pClientList[iClientH]->m_iMag < m_pClientList[iClientH]->m_iDex) || (m_pClientList[iClientH]->m_iMag < 100))
	{ 
  // MAG must be at least 100 and MAG > STR and MAG > DEX
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "You must be a mage with at least 100 MAG");
  return;
	}
	if ((m_pClientList[iClientH]->m_iInt < m_pClientList[iClientH]->m_iStr) || (m_pClientList[iClientH]->m_iInt < m_pClientList[iClientH]->m_iDex) || (m_pClientList[iClientH]->m_iInt < 67))
	{
  // INT must be at least 67 (MassAmp Mages) and INT > STR and INT > DEX
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "You must be a mage with at least 150 INT");
  return;
	}
	for (i = 0; i <= 23; i++)
	{
  if (i == 3 || i == 4 || i == 12 || i == 21 || i == 9)
  { 
  	// Skills that will be set to 100% : Magic-Resistance, Magic, Staff-Attack, fencing
  	m_pClientList[iClientH]->m_cSkillMastery[i] = 100;
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SKILL, i, m_pClientList[iClientH]->m_cSkillMastery[i], NULL, NULL); // Update skills status
  }
  if (i == 11)
  {
  	//Skill that will be set to 90%: Shield
  	m_pClientList[iClientH]->m_cSkillMastery[i] = 90;
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SKILL, i, m_pClientList[iClientH]->m_cSkillMastery[i], NULL, NULL);
  }
  if (i == 19)
  {
  	//Skill that will be set to 20%: Pretend corpse
  	m_pClientList[iClientH]->m_cSkillMastery[i] = 20;
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SKILL, i, m_pClientList[iClientH]->m_cSkillMastery[i], NULL, NULL);
  }
	}
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "Now you are a skilled mage");
return;
}
€M4NU€L
Outpost bitch
Posts: 517
Joined: Sat Nov 19, 2005 9:07 pm
Location: I watch gay porn
Contact:

Post by €M4NU€L »

Nothing there requires magic 50
<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
Warlord
Regular
Posts: 34
Joined: Sun Dec 05, 2004 11:08 am

Post by Warlord »

€M4NU€L wrote: Nothing there requires magic 50
I need to know how to do it...Not if it requires.. ;)
€M4NU€L
Outpost bitch
Posts: 517
Joined: Sat Nov 19, 2005 9:07 pm
Location: I watch gay porn
Contact:

Post by €M4NU€L »

Warlord wrote:
€M4NU€L wrote: Nothing there requires magic 50
I need to know how to do it...Not if it requires.. ;)
HMmm... ask Drajwer, Diuuude or Snoopy ?
<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
molo
Member
Posts: 140
Joined: Mon Jan 17, 2005 1:19 am

Post by molo »

diuuude wrote: This command will allow your players to get 100% skills in game by typing the /getskilled command. I didn't make a msg appear when command is used, if you want one, add it :). I know acidx made similar code but i don't know if it was released and somebody requested it...

[Updated]
Now a msg appears in the client.
Skills are updated without reconnecting.


<span style='color:red'>OPEN GAME.H</span>

WHERE YOU WANT, ADD

Code: Select all

void PlayerOrder_GetSkilled(int iClientH);

<span style='color:red'>OPEN GAME.CPP</span>

FIND

Code: Select all

if (memcmp(cp, "/summonall ", 11) == 0) {
  	AdminOrder_SummonAll(iClientH, cp, dwMsgSize - 21);
  	return;
  }
AFTER, ADD

Code: Select all

// GetSkilled Command by Diuuude
  if (memcmp(cp, "/getskilled", 11) == 0) {
  	PlayerOrder_GetSkilled(iClientH);
  	return;
  }

FIND

Code: Select all

void CGame::AdminOrder_UnsummonAll(int iClientH)
{
 int i;

	if (m_pClientList[iClientH] == NULL) return;

	if (m_pClientList[iClientH]->m_iAdminUserLevel < m_iAdminLevelUnsummonAll) {
  // Admin user levelÀÌ ³·¾Æ¼­ ÀÌ ±â´ÉÀ» »ç¿ëÇÒ ¼ö ¾ø´Ù.
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL);
  return;
	}

	// ¼ÒȯµÈ ¸ðµç ¸ó½ºÅ�¸¦ �×ÀδÙ. 
	for (i = 1; i < DEF_MAXNPCS; i++)
	if (m_pNpcList[i] != NULL) {
  if ((m_pNpcList[i]->m_bIsSummoned == TRUE) && (m_pNpcList[i]->m_bIsKilled == FALSE)) 
  	NpcKilledHandler(iClientH, DEF_OWNERTYPE_PLAYER, i, 0);
	}
}
AFTER, ADD

Code: Select all

// GetSkilled Command by Diuuude
void CGame::PlayerOrder_GetSkilled(int iClientH)
{
	int i;
	if (m_pClientList[iClientH] == NULL) return;
	for (i = 0; i <= 23; i++) {
        m_pClientList[iClientH]->m_cSkillMastery[i] = 100;
        SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SKILL, i, m_pClientList[iClientH]->m_cSkillMastery[i], NULL, NULL); // Update skills status
}
       SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "All your skills have been set to 100%"); // Send a message to client to say the skills have been set to 100%
	return;
}

Save, Compile, Have Fun !!
well, i added this code the way it says.. but it give me 8 Errors..

C:\Documents and Settings\...\Desktop\HG SRC\Game.cpp(58214) : error C2065: 'm_pClientList' : undeclared identifier
C:\Documents and Settings\...\Desktop\HG SRC\Game.cpp(58214) : error C2109: subscript requires array or pointer type
C:\Documents and Settings\...\Desktop\HG SRC\Game.cpp(58216) : error C2109: subscript requires array or pointer type
C:\Documents and Settings\...\Desktop\HG SRC\Game.cpp(58216) : error C2227: left of '->m_cSkillMastery' must point to class/struct/union
C:\Documents and Settings\...\Desktop\HG SRC\Game.cpp(58217) : error C2065: 'SendNotifyMsg' : undeclared identifier
C:\Documents and Settings\...\Desktop\HG SRC\Game.cpp(58217) : error C2109: subscript requires array or pointer type
C:\Documents and Settings\...\Desktop\HG SRC\Game.cpp(58217) : error C2227: left of '->m_cSkillMastery' must point to class/struct/union
Error executing cl.exe.



Results
HGserver.exe - 8 error(s), 4 warning(s)


can any one help me fix it? please. :unsure:
molo
Member
Posts: 140
Joined: Mon Jan 17, 2005 1:19 am

Post by molo »

nvm.. Fixed.

sorry for double popst B)
xmukox
Member
Posts: 175
Joined: Sun Sep 11, 2005 9:53 am

Post by xmukox »

nice ^^
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

just add smth wityh dex*2 there
<img src='http://www.hot.ee/carvanho/taavi.png' border='0' alt='user posted image' /><br><br><img src='http://www.hot.ee/carvanho/Elvine.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/LieroX.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/Football.png' border='0' alt='user posted image' />
Acidx
Member
Posts: 198
Joined: Tue Mar 23, 2004 4:27 am

Post by Acidx »

Hey if you want this to work like my original /getskills command from archaic add PlayerOrder_GetSkilled(iClientH) to the end of InitPlayerData So that they cant use Majestics to change there stats or anything and cheat your skill system ;)
Other then that good job its almost exactly like my original one
<b>-<span style='color:green'>ACiD-x </span><span style='color:red'> Owning PCs Since 1987</span><br><img src='http://img204.imageshack.us/img204/2245/hackertf5.gif' border='0' alt='user posted image' /><br><img src='http://img509.imageshack.us/img509/6697 ... 4sc4ed.png' border='0' alt='user posted image' /><br><span style='color:orange'>i am Pwn NetGAYLORDS !</span></b><br><span style='color:blue'><br>I Pwn HBUSA =)</span>
Post Reply