[Src]->getskilled Command

Codes already submitted by people of the forums.
laizkloom
Regular
Posts: 78
Joined: Sun Feb 27, 2005 8:41 am

Post by laizkloom »

sry for other topic ,but can anyone make code for contribution?
Its like when I write /cont then i get 100 cont.
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

laizkloom wrote: sry for other topic ,but can anyone make code for contribution?
Its like when I write /cont then i get 100 cont.
try this i just put it together idk if it will work it sould.

Code: Select all

void PlayerOrder_Cont(int iClientH);


 if (memcmp(cp, "/cont", 11) == 0) {
  PlayerOrder_Cont(iClientH);
  return;
 } 

void CGame::PlayerOrder_Cont(int iClientH)
{
int i;
char notice[100];
if (m_pClientList[iClientH] == NULL) return;
for (i = 0; i <= 23; i++) {
m_pClientList[iClientH]->m_iContribution = 500;
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_QUESTREWARD, i, m_pClientList[iClientH]->m_iContribution, NULL, NULL); 
}
 wsprintf(notice,"You Now Have 500 Contribution.");
 SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, notice);
return;
}
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

If it worked, please make a new topic with it juggalo2.
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
laizkloom
Regular
Posts: 78
Joined: Sun Feb 27, 2005 8:41 am

Post by laizkloom »

is it possible to get spells too when you use command?
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

laizkloom wrote: is it possible to get spells too when you use command?
Yes, of course it is possible, but you'll have to choose what spells will be allowed to learn this way and code it according to the available spells.

You can use this code as a model but yu'll have to change some parts of it.
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
laizkloom
Regular
Posts: 78
Joined: Sun Feb 27, 2005 8:41 am

Post by laizkloom »

}[/CODE] [/QUOTE]

Code: Select all

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 (ES Mages) and INT > STR and INT > DEX
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "You must be a mage with at least 67 INT");
  return;
	}
	for (i = 1; i <= 96; i++) {
  if (i == 1){ // magic:heal
  m_pClientList[iClientH]->m_cMagicMastery[i]=100;
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_MAGIC, i, m_pClientList[iClientH]->m_cMagicMastery[i], NULL, NULL); // Update skills status
  }
	}
	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "Now you are a skilled mage");
	return;
}
like this?Sry i'm noob in c++ you can correct me if you want:D
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

hum... ur on the right way, just keep trying.
for (i = 1; i <= 96; i++) {
if (i == 1){ // magic:heal
m_pClientList[iClientH]->m_cMagicMastery=100;
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_MAGIC, i, m_pClientList[iClientH]->m_cMagicMastery, NULL, NULL); // Update skills status
}
}
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "Now you are a skilled mage");
return;
}


This part is not correct, must be 1 (not 100) if spell is known by player and 0 if not


if (i == 1)

I think this part must be changed to be easier to code, do it this way :

if ((i != 4) && (i != 5) && (i != 6))

use only the unused spells ID


And magic missile ID = 0, not 1 ;), see your magic.txt to know what IDs are used or not.
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
laizkloom
Regular
Posts: 78
Joined: Sun Feb 27, 2005 8:41 am

Post by laizkloom »

Well When I try to build my source I got this error
C:\Program Files\Helbreath\HBMassPvP\HBPL\Game.cpp(41425) : error C2065: 'DEF_NOTIFY_MAGICMASTERY' : undeclared identifier

code is
void CGame::PlayerOrder_MasterMage(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_iLevel < 250)){ // 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 level 250 MAGE");
return;
}
for (i = 1; i <= 96; i++) {
if ((i != 4) && (i != 5) && (i != 6)){ // magic:heal
m_pClientList[iClientH]->m_cMagicMastery=1;
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_MAGICMASTERY, i, m_pClientList[iClientH]->m_cMagicMastery, NULL, NULL); // Update skills status
}
}
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "Now you are a mastermage");
return;
}

Anyone know how to fix it:P?
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

here u go

Code: Select all

void CGame::PlayerOrder_MasterMage(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_iLevel < 250)){ // 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 level 250 MAGE");
return;
}
for (i = 1; i <= 96; i++) {
if ((i != 4) && (i != 5) && (i != 6)){ // magic:heal
m_pClientList[iClientH]->m_cMagicMastery[i]=1;
SendNotifyMsg(NULL, iClientH, DEF_MAXMAGICTYPE, i, m_pClientList[iClientH]->m_cMagicMastery[i], NULL, NULL); // Update skills status
}
}
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, "Now you are a mastermage");
return;
}
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MiNiFooBoo
noob
Posts: 10
Joined: Sun May 07, 2006 9:18 pm

Post by MiNiFooBoo »

Is there a way to make it based on stats? Say I got 32 dex and type /getskilled and I'll only receive 64% long sword and so on.
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

// Short Sword
m_pClientList[iClientH]->m_cMagicMastery[7] = m_pClientList[iClientH]->m_iDex*2;
// Long Sword
m_pClientList[iClientH]->m_cMagicMastery[8] = m_pClientList[iClientH]->m_iDex*2;
// Fencing
m_pClientList[iClientH]->m_cMagicMastery[9] = m_pClientList[iClientH]->m_iDex*2;
// Axe
m_pClientList[iClientH]->m_cMagicMastery[10] = m_pClientList[iClientH]->m_iDex*2;
// Shield
m_pClientList[iClientH]->m_cMagicMastery[11] = m_pClientList[iClientH]->m_iDex*2;
// Hammer
m_pClientList[iClientH]->m_cMagicMastery[14] = m_pClientList[iClientH]->m_iDex*2;
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
MiNiFooBoo
noob
Posts: 10
Joined: Sun May 07, 2006 9:18 pm

Post by MiNiFooBoo »

Thanks a lot.

You made a small error, it should be

m_pClientList[iClientH]->m_cSkillMastery[11] = m_pClientList[iClientH]->m_iDex*2;

Besides that it works perfect :)
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »


<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
SlammeR
Loyal fan
Posts: 219
Joined: Fri Nov 04, 2005 1:52 am
Location: Brazil

Post by SlammeR »

it can be a noob doubt... dont flame me... This comand is the same of hbarchaic i think =O

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++) {
       if (m_pClientList[iClientH]->m_cSkillMastery[i] > 100) m_pClientList[iClientH]->m_cSkillMastery[i] = 100;
       //Mining
       m_pClientList[iClientH]->m_cSkillMastery[0] = m_pClientList[iClientH]->m_iStr*2;
       //Fishing
       m_pClientList[iClientH]->m_cSkillMastery[1] = m_pClientList[iClientH]->m_iDex*2;
       //Farming
       m_pClientList[iClientH]->m_cSkillMastery[2] = m_pClientList[iClientH]->m_iInt*2;
       //Magic-Resistance
       m_pClientList[iClientH]->m_cSkillMastery[3] = m_pClientList[iClientH]->m_iLevel*2;
       //Magic
       m_pClientList[iClientH]->m_cSkillMastery[4] = m_pClientList[iClientH]->m_iMag*2;
       //Hand-Attack
       m_pClientList[iClientH]->m_cSkillMastery[5] = m_pClientList[iClientH]->m_iStr*2;
       //Archery
       m_pClientList[iClientH]->m_cSkillMastery[6] = m_pClientList[iClientH]->m_iDex*2;
       //Short-Sword
       m_pClientList[iClientH]->m_cSkillMastery[7] = m_pClientList[iClientH]->m_iDex*2;
       //Long-Sword
       m_pClientList[iClientH]->m_cSkillMastery[8] = m_pClientList[iClientH]->m_iDex*2;
       //Fencing
       m_pClientList[iClientH]->m_cSkillMastery[9] = m_pClientList[iClientH]->m_iDex*2;
       //Axe-Attack
       m_pClientList[iClientH]->m_cSkillMastery[10] = m_pClientList[iClientH]->m_iDex*2;
       //Shield
       m_pClientList[iClientH]->m_cSkillMastery[11] = m_pClientList[iClientH]->m_iDex*2;
       //Alchemy
       m_pClientList[iClientH]->m_cSkillMastery[12] = m_pClientList[iClientH]->m_iInt*2;
       //Manufacturing
       m_pClientList[iClientH]->m_cSkillMastery[13] = m_pClientList[iClientH]->m_iStr*2;
       //Hammer
       m_pClientList[iClientH]->m_cSkillMastery[14] = m_pClientList[iClientH]->m_iStr*2;
       //Pretend-Corpse
       m_pClientList[iClientH]->m_cSkillMastery[19] = m_pClientList[iClientH]->m_iInt*2;
       //Staff-Attack
       m_pClientList[iClientH]->m_cSkillMastery[21] = m_pClientList[iClientH]->m_iMag*2;
       //Poison-Resistance
       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);
   }
}
Edited The Code All By diuuude instructions but i got a problem... the skills go more then 100 so i added this

Code: Select all

       if (m_pClientList[iClientH]->m_cSkillMastery[i] > 100) m_pClientList[iClientH]->m_cSkillMastery[i] = 100;

so i tested and the result is... /getskilled = the skills of the stats i increased can be higher then 100 :S
Help plz! and thanks =)
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>
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

Replace this

Code: Select all

//Mining
      m_pClientList[iClientH]->m_cSkillMastery[0] = m_pClientList[iClientH]->m_iStr*2;
with

Code: Select all

//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;}
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
Post Reply