Fix random ql support
This commit is contained in:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user