forked from MagicBane/Server
More itembase refactor work
This commit is contained in:
@@ -62,11 +62,14 @@ public class StealPowerAction extends AbstractPowerAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//called to get amount of gold to steal between 0 and max gold
|
//called to get amount of gold to steal between 0 and max gold
|
||||||
protected static int getAmountToSteal(Item i) {
|
protected static int getAmountToSteal(Item item) {
|
||||||
if (i.getItemBase() != null && i.getItemBase().getUUID() == 7) {
|
if (item.template.item_type.equals(ItemType.GOLD)) {
|
||||||
int amount = i.getNumOfItems();
|
|
||||||
|
int amount = item.getNumOfItems();
|
||||||
|
|
||||||
if (amount < 1)
|
if (amount < 1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
int a = ThreadLocalRandom.current().nextInt(amount + 1);
|
int a = ThreadLocalRandom.current().nextInt(amount + 1);
|
||||||
int b = ThreadLocalRandom.current().nextInt(amount + 1);
|
int b = ThreadLocalRandom.current().nextInt(amount + 1);
|
||||||
int c = ThreadLocalRandom.current().nextInt(amount + 1);
|
int c = ThreadLocalRandom.current().nextInt(amount + 1);
|
||||||
@@ -99,8 +102,8 @@ public class StealPowerAction extends AbstractPowerAction {
|
|||||||
if (owner == null)
|
if (owner == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
AbstractCharacter ownerAC = null;
|
AbstractCharacter ownerAC = null;
|
||||||
|
|
||||||
if (AbstractWorldObject.IsAbstractCharacter(owner))
|
if (AbstractWorldObject.IsAbstractCharacter(owner))
|
||||||
ownerAC = (AbstractCharacter) owner;
|
ownerAC = (AbstractCharacter) owner;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user