PDA

View Full Version : Cash awards from quests


WildcardX
03-23-2006, 02:24 PM
I am running EQEmu 0.6.6-732 with PEQ Luclin Beta 1 DB

When completing a quest that gives a cash reward, the player does recieve the reward, but the string message telling the player reads:

"You recieve # gold, # silver, # copper pieces."

instead of :

"You recieve 1 gold, 2 silver, 3 copper pieces."

And where the # sign is in the first string, you can replace that with a square symbol that I think might be the result of a null value being translated into a string?? Just my theory...

Also, after any quest awards there is no trumpet sound like I remember from live eq. Oddly, I miss that sound.. It made me smile :)

Cisyouc
03-23-2006, 04:12 PM
Also, after any quest awards there is no trumpet sound like I remember from live eq. Oddly, I miss that sound.. It made me smile quest::ding().

WildcardX
06-04-2006, 12:37 PM
I have corrected this bug. The bug was when a quest gives a player a cash reward, the player doesn't see something like "1 gold, 2 silver, 3 copper". Instead the output they recieve is something like "<null char> gold, <null char> silver, <null char> copper".

Please change the following method:

void QuestManager::givecash(int copper, int silver, int gold, int platinum) {
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoneyOnCorpse, sizeof(moneyOnCorpseStruct));
moneyOnCorpseStruct* d = (moneyOnCorpseStruct*) outapp->pBuffer;
d->response = 1;
d->unknown1 = 0x5a;
d->unknown2 = 0x40;
d->unknown3 = 0;
if (initiator && initiator->IsClient())
{
d->copper = copper;
d->silver = silver;
d->gold = gold;
d->platinum = platinum;
initiator->AddMoneyToPP(d->copper, d->silver, d->gold, d->platinum,true);
initiator->QueuePacket(outapp);
string tmp;
if (d->platinum>0){
tmp = "You receive ";
tmp += d->platinum;
tmp += " plat";
}
if (d->gold>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += d->gold;
tmp += " gold";
}
else{
tmp += ",";
tmp += d->gold;
tmp += " gold";
}
}
if(d->silver>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += d->silver;
tmp += " silver";
}
else{
tmp += ",";
tmp += d->silver;
tmp += " silver";
}
}
if(d->copper>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += d->copper;
tmp += " copper";
}
else{
tmp += ",";
tmp += d->copper;
tmp += " copper";
}
}
tmp += " pieces.";
if (initiator)
initiator->Message(MT_OOC,tmp.c_str());
}
safe_delete(outapp);
}

To the following method:

void QuestManager::givecash(int copper, int silver, int gold, int platinum) {
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoneyOnCorpse, sizeof(moneyOnCorpseStruct));
moneyOnCorpseStruct* d = (moneyOnCorpseStruct*) outapp->pBuffer;
d->response = 1;
d->unknown1 = 0x5a;
d->unknown2 = 0x40;
d->unknown3 = 0;
if (initiator && initiator->IsClient())
{
d->copper = copper;
d->silver = silver;
d->gold = gold;
d->platinum = platinum;
initiator->AddMoneyToPP(d->copper, d->silver, d->gold, d->platinum,true);
initiator->QueuePacket(outapp);
string tmp;
if (d->platinum>0){
tmp = "You receive ";
tmp += itoa(d->platinum);
tmp += " plat";
}
if (d->gold>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += itoa(d->gold);
tmp += " gold";
}
else{
tmp += ",";
tmp += itoa(d->gold);
tmp += " gold";
}
}
if(d->silver>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += itoa(d->silver);
tmp += " silver";
}
else{
tmp += ",";
tmp += itoa(d->silver);
tmp += " silver";
}
}
if(d->copper>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += itoa(d->copper);
tmp += " copper";
}
else{
tmp += ",";
tmp += itoa(d->copper);
tmp += " copper";
}
}
tmp += " pieces.";
if (initiator)
initiator->Message(MT_OOC,tmp.c_str());
}
safe_delete(outapp);
}

This will allow the correct output to be sent to the player. Easy fix and not earth shattering. All I did was convert to uint32 datatype to a char that is then appened to the string object. This method is from the questmgr.cpp file.

fathernitwit
06-07-2006, 01:35 PM
thanks, fixed.