Make use of global values when sending player back unsold offer items + rep loss
This commit is contained in:
parent
d2f6a16312
commit
7950bef43e
@ -160,7 +160,7 @@ export class RagfairServerHelper
|
||||
MessageType.MESSAGE_WITH_ITEMS,
|
||||
RagfairServerHelper.goodsReturnedTemplate,
|
||||
returnedItems,
|
||||
this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime),
|
||||
this.timeUtil.getHoursAsSeconds(this.databaseServer.getTables().globals.config.RagFair.yourOfferDidNotSellMaxStorageTimeInHour),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -240,15 +240,18 @@ export class RagfairOfferService
|
||||
);
|
||||
}
|
||||
|
||||
profile.RagfairInfo.rating -= this.ragfairConfig.sell.reputation.loss;
|
||||
// Reduce player ragfair rep
|
||||
profile.RagfairInfo.rating -= this.databaseServer.getTables().globals.config.RagFair.ratingDecreaseCount;
|
||||
profile.RagfairInfo.isRatingGrowing = false;
|
||||
|
||||
if (offer.items[0].upd.StackObjectsCount > offer.items[0].upd.OriginalStackObjectsCount)
|
||||
const firstOfferItem = offer.items[0];
|
||||
if (firstOfferItem.upd.StackObjectsCount > firstOfferItem.upd.OriginalStackObjectsCount)
|
||||
{
|
||||
offer.items[0].upd.StackObjectsCount = offer.items[0].upd.OriginalStackObjectsCount;
|
||||
offer.items[0].upd.StackObjectsCount = firstOfferItem.upd.OriginalStackObjectsCount;
|
||||
}
|
||||
delete offer.items[0].upd.OriginalStackObjectsCount;
|
||||
|
||||
// Send failed offer items to player in mail
|
||||
this.ragfairServerHelper.returnItems(profile.sessionId, offer.items);
|
||||
profile.RagfairInfo.offers.splice(offerIndex, 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user