Ball Trade Change To Reputation

All Helbreath Server Source Discussion here.
Post Reply
Warlord
Regular
Posts: 34
Joined: Sun Dec 05, 2004 11:08 am

Post by Warlord »

Hi!:)
So here I am again...Can someone help me with balldrop and ball trade?

I want to make so that if Ball is dropped from monster and then if you double click it, you'll get reputation? Or how should I do it ?

Blue, Red, Green, Yellow, Pearl balls..each give different rep ( like red=5; green=2)

Thanks :rolleyes:


EDIT: Omg, posted in a wrong place..please move it :D
Treax2
Loyal fan
Posts: 281
Joined: Fri Mar 04, 2005 5:05 pm
Location: Estonia
Contact:

Post by Treax2 »

in useitemhandler

search :

Code: Select all

case 1:
      	if (memcmp(m_pClientList[iClientH]->m_cMapName, "bisle", 5) != 0)
      	{
        //v1.42
        ItemDepleteHandler(iClientH, sItemIndex, TRUE, TRUE);
        RequestTeleportHandler(iClientH, "2   ", "bisle", -1, -1);
      	}
      break;
then add under it ...

Code: Select all

case 2: //Ball Trade
      BallTrade(iClientH);
      break;
Or IF u want use it by Command !

Code: Select all

if (memcmp(cp, "/stopdrop ", 9) == 0) {
  	// BallTrade By Treax
  	BallTrade(iClientH);
  	return;
  }


and then add this code ... to game.cpp

Code: Select all

void CGame::BallTradeint iClientH) {
{
int i;
char buff [100];
char cItemName[20];
if (m_pClientList[iClientH] == NULL) return;
for (i = 0; i < DEF_MAXITEMS; i++) {
 if ((m_pClientList[iClientH]->m_pItemList[i] != NULL) && (memcmp(m_pClientList[iClientH]->m_pItemList[i]->m_cName, "Greenball", 9) == 0)) {
  ZeroMemory(cItemName,sizeof(cItemName));
  memcpy(cItemName,m_pClientList[iClientH]->m_pItemList[i]->m_cName,strlen(m_pClientList[iClientH]->m_pItemList[i]->m_cName));
  wsprintf(buff,"(!) %s depletes %s",m_pClientList[iClientH]->m_cCharName,cItemName);
  PutLogList(buff);
  
  if (memcmp(cItemName,"Greenball", 10) == 0) {
   ItemDepleteHandler(iClientH, i, FALSE, TRUE); 
   m_pClientList[iClientH]->m_iRating += *;
   wsprintf(buff," You got * rep");
   ShowRepNotice(iClientH,buff); 
   return;
 }
 if (memcmp(cItemName,"Pearlballl", 10) == 0) {
   ItemDepleteHandler(iClientH, i, FALSE, TRUE); 
   m_pClientList[iClientH]->m_iRating += *;
   wsprintf(buff," You got * rep");
   ShowRepNotice(iClientH,buff); 
   return;
}
}
}
}

and in game.h

Code: Select all

void BallTrade(int iClientH);
... so the code is something like that

and now the balls numbers in item3.cfg must be ... * * 11 2 * * *
Warlord
Regular
Posts: 34
Joined: Sun Dec 05, 2004 11:08 am

Post by Warlord »

Iccc..I looked my Item3.CFG - there are no balls at all :o
ogeid
Member
Posts: 110
Joined: Thu Feb 02, 2006 11:11 pm

Post by ogeid »

very nice treax
"Prefiero morir de pie que vivir arrodillado"
Jensen
Loyal fan
Posts: 300
Joined: Tue Aug 02, 2005 7:40 am
Location: Illinois, USA
Contact:

Post by Jensen »

try adding them, or moving them from the config that they currently are in
-><-
ogeid
Member
Posts: 110
Joined: Thu Feb 02, 2006 11:11 pm

Post by ogeid »

:( code dsnt work!
"Prefiero morir de pie que vivir arrodillado"
Post Reply