View Single Post
  #1  
Old 06-19-2003, 09:24 PM
used_pawn
Sarnak
 
Join Date: Apr 2003
Posts: 53
Default Added fix to givecash() in quests

The function givecash() was not working correctly (coin type was backwards, no platinum given, no messages) so, as it started to annoy me, hehe, i fixed it.

at line 866 or thereabouts, replace entire else if () {} statement for givecash() function with this:

../zone/parser.cpp : line 866

Code:
			else if (strstr(strlwr(arglist[0]),"givecash")) {
				APPLAYER* outapp = new APPLAYER(OP_MoneyOnCorpse, sizeof(moneyOnCorpseStruct));
				moneyOnCorpseStruct* d = (moneyOnCorpseStruct*) outapp->pBuffer;
		
				d->response		= 1;
				d->unknown1		= 0x5a;
				d->unknown2		= 0x40;
				d->unknown3		= 0;
				if (mob->IsClient()) { 
					d->copper		= atoi(arglist[1]);
					d->silver		= atoi(arglist[2]);
					d->gold			= atoi(arglist[3]);
					d->platinum		= atoi(arglist[4]);
					mob->CastToClient()->AddMoneyToPP(d->copper, d->silver, d->gold, d->platinum,true);
					mob->CastToClient()->QueuePacket(outapp); 
					if(d->platinum>0) mob->CastToClient()->Message(MT_Emote,"You recieve %i platinum pieces",d->platinum);
					if(d->gold>0) mob->CastToClient()->Message(MT_Emote,"You recieve %i gold pieces",d->gold);
					if(d->silver>0) mob->CastToClient()->Message(MT_Emote,"You recieve %i silver pieces",d->silver);
					if(d->copper>0) mob->CastToClient()->Message(MT_Emote,"You recieve %i copper pieces",d->copper);
				}
				delete outapp;
			}
The textcolor MT_Emote might be wrong, but it looks correct to my memory, heh.
Reply With Quote