Browse Source

stealing/peeking fix

lakebane-dex-penalty
FatBoy-DOTC 1 week ago
parent
commit
7a8a751bca
  1. 2
      src/engine/powers/poweractions/PeekPowerAction.java
  2. 18
      src/engine/powers/poweractions/StealPowerAction.java

2
src/engine/powers/poweractions/PeekPowerAction.java

@ -106,7 +106,7 @@ public class PeekPowerAction extends AbstractPowerAction { @@ -106,7 +106,7 @@ public class PeekPowerAction extends AbstractPowerAction {
if (!tar.isAlive())
return;
lwrm = new LootWindowResponseMsg(tar.getObjectType().ordinal(), tar.getObjectUUID(), tar.getInventory(true));
lwrm = new LootWindowResponseMsg(tar.getObjectType().ordinal(), tar.getObjectUUID(), tar.getInventory(false));
} else if (awo.getObjectType().equals(Enum.GameObjectType.Mob)) {
Mob tar = (Mob) awo;

18
src/engine/powers/poweractions/StealPowerAction.java

@ -89,6 +89,8 @@ public class StealPowerAction extends AbstractPowerAction { @@ -89,6 +89,8 @@ public class StealPowerAction extends AbstractPowerAction {
if (!sourcePlayer.isAlive())
return;
sourcePlayer.cancelOnAttackSwing();
//prevent stealing no steal mob loot
if (awo instanceof MobLoot && ((MobLoot) awo).noSteal())
return;
@ -173,8 +175,21 @@ public class StealPowerAction extends AbstractPowerAction { @@ -173,8 +175,21 @@ public class StealPowerAction extends AbstractPowerAction {
if (tar.getItemBase().getType().equals(ItemType.GOLD)) {
//stealing gold
if (!myCIM.transferGoldToMyInventory((AbstractCharacter) owner, amount))
//if (!myCIM.transferGoldToMyInventory((AbstractCharacter) owner, amount))
// return;
int targetGold = ownerCIM.getGoldInventory().getNumOfItems();
int myGold = myCIM.getGoldInventory().getNumOfItems();
if(myGold + amount > 10000000)
return;
ownerCIM.getGoldInventory().setNumOfItems(targetGold - amount);
ownerCIM.updateInventory();
myCIM.addGoldToInventory(amount,false);
myCIM.updateInventory();
} else {
//stealing items
if (ownerCIM.lootItemFromMe(tar, sourcePlayer, origin, true, amount) == null)
@ -189,7 +204,6 @@ public class StealPowerAction extends AbstractPowerAction { @@ -189,7 +204,6 @@ public class StealPowerAction extends AbstractPowerAction {
//update thief's inventory
if (sourcePlayer.getCharItemManager() != null) {
sourcePlayer.getCharItemManager().updateInventory();
sourcePlayer.cancelOnAttackSwing();
}
//update victims inventory

Loading…
Cancel
Save