(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);
}
}
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>