actually,this simulates a 'ding' sound when used,I hope it helps,it can be very useful sometimes.We will need to add some changes.
in client.cpp,add this new function:
Code:
void Client::SendSound(){//-Cofruben:Used for ding sound.
APPLAYER* outapp = new APPLAYER(0x01a6, 68);
unsigned char x[68];
memset(x, 0, 68);
x[0]=0x22;
x[4]=0x8003;
x[8]=0x8624;
x[12]=0x4A01;
x[16]=0x05;
x[28]=0x00;//change this value to give gold to the client
x[40]=0xFFFFFFFFFFFFFFFF;
x[48]=0xFFFFFFFFFFFFFFFF;
x[56]=0xFFFFFFFFFFFFFFFF;
x[64]=0xffffffff;
outapp->pBuffer=x;
outapp->priority = 6;
QueuePacket(outapp);
// DumpPacket(outapp);
safe_delete(outapp);
//this also can be used to give money to the client:You receive x gold.
}
add the correct function declaration in client.h:
Code:
void Client::SendSound();
add the correct quest function declaration in embparser.cpp:
Code:
"sub ding{push(@cmd_queue,{func=>'ding',args=>join(',',@_)});}"//-Cofruben:makes a sound in the client
and now,paste the following quest function into parser.cpp:
Code:
else if (!strcmp(strlwr(command),"ding")) {//-Cofruben:makes a sound.
if (mob && mob->IsClient())
mob->CastToClient()->SendSound();
}
I haven't tested the quest function,tell me if it works or not.That opcode used in the SendSound function,can be used to give any sort of money.Just figure it out