[src] Get Items w/Majestic Points (Well Commented)

Codes already submitted by people of the forums.
Post Reply
Daryl
Regular
Posts: 74
Joined: Thu Dec 16, 2004 1:54 am

Post by Daryl »

If you want to allow players to get a Item @ the cost of majestic points

(in this case i used the Red Summon ball)


in Game.cpp @ the very end

Add

Code: Select all

//--- Coded by Daryl (Buy a Red Summon Ball  for 6 Majestic Points)
void CGame::GetRedBall(int iClientH) 
{
//Defines
class CItem * pItem;
int iItemID, iEraseReq;
//------- if player is not found then exit void
if(m_pClientList[iClientH] == NULL) return;
//---------- If user is under lvl 180 then exit void
if(m_pClientList[iClientH]->m_iLevel < 180) return;
	pItem = new class CItem;
	iItemID=-1;
	// Enter the Item ID Number (Found in your Item.cfg's)
	iItemID=652;
//-- Checks to see if player has required points (If player has 6 or more Majestic points then run Command)
 if (m_pClientList[iClientH]->m_iGizonItemUpgradeLeft > 5) {  
  if (iItemID != -1) //if any error occures, dont crash character
  {
  	//---------- Gives the player the ball-----------------
    _bInitItemAttr(pItem, iItemID);
    //-------- Binds the ball to the player
    pItem->m_sTouchEffectType = DEF_ITET_UNIQUE_OWNER;
    pItem->m_sTouchEffectValue1 = m_pClientList[iClientH]->m_sCharIDnum1;
    pItem->m_sTouchEffectValue2 = m_pClientList[iClientH]->m_sCharIDnum2;
    pItem->m_sTouchEffectValue3 = m_pClientList[iClientH]->m_sCharIDnum3;
    _bAddClientItemList(iClientH, pItem, &iEraseReq);
    //-------- Notifys the player the Item he has recived
    SendItemNotifyMsg(iClientH, DEF_NOTIFY_ITEMOBTAINED, pItem, NULL);	
    
  }
  //--- Deletes Majestic Points From
m_pClientList[iClientH]->m_iGizonItemUpgradeLeft -= 6;
//------- Updates Client with current Majestic points
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_GIZONITEMUPGRADELEFT, m_pClientList[iClientH]->m_iGizonItemUpgradeLeft, NULL, NULL, NULL);
 }

}
Find "/who"

ADD

Code: Select all

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

Open Game.h
UNDER
class CGame
{
public:


ADD

Code: Select all

void GetRedBall(int iClientH);


This is just a simple pice of code, In HB Lotus (Where I am coding) I have upped my Events map i made back during HBX days.. And made it where a guild master, or just a group of friends can buy Blue Balls and Red Balls.. and have there own Summons event.. (Only in the Events map)


If ya find this helpfull.. Good... if not.. Good..

Ill be posting other shit i code as well.


Daryl
Old HBX / HB Lotus Head Programmer
<a href='http://www.hblotus.com' target='_blank'>http://www.hblotus.com</a>
Crossfade
Loyal fan
Posts: 354
Joined: Sun Mar 20, 2005 5:55 pm

Post by Crossfade »

appreciate your work daryl
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

welcome back darly

good job :)

<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>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Namesis
Regular
Posts: 88
Joined: Fri Mar 03, 2006 12:53 pm

Post by Namesis »

make another one or edit that but with "ek cost" pleaseeeeeeeeeeeeeeeeee :P :D


//Edit: Great Job too with the 1rst code :D
Crossfade
Loyal fan
Posts: 354
Joined: Sun Mar 20, 2005 5:55 pm

Post by Crossfade »

Namesis wrote: make another one or edit that but with "ek cost" pleaseeeeeeeeeeeeeeeeee :P :D
here we go again <_< :rolleyes:
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

you can just replace m_iGizonItemUpgradeLeft with m_iEnemyKillCount
<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' />
mikus
Regular
Posts: 33
Joined: Thu Feb 23, 2006 1:56 pm

Post by mikus »

Great job very nice
HelbreatH Fuck The Future
xmukox
Member
Posts: 175
Joined: Sun Sep 11, 2005 9:53 am

Post by xmukox »

good job xD
Post Reply