Fix random ql support

This commit is contained in:
gamer147
2025-11-25 17:38:54 -05:00
parent 89fae5a5a2
commit 9898b2ed07

View File

@@ -34,10 +34,11 @@ public class ShopWurmItemPurchaseEffect implements ShopItemPurchaseEffect {
@Override
public void onPurchase(Player player) {
try {
float thisPurchaseQl = this.ql;
if(randomQl) {
ql = Server.rand.nextInt(99) + 1;
thisPurchaseQl = Server.rand.nextInt(99) + 1;
}
Item item = ItemFactory.createItem(itemTemplateId, ql, (byte) 0, (byte) rarity, null);
Item item = ItemFactory.createItem(itemTemplateId, thisPurchaseQl, (byte) 0, (byte) rarity, null);
player.getInventory().insertItem(item);
ItemTemplate template = ItemTemplateFactory.getInstance().getTemplate(itemTemplateId);
player.sendSystemMessage(String.format("You receive a %s.", template.getName()));