Browse Source

r8 rank for Tol costs additional 1 mithril

birdbane
FatBoy-DOTC 8 months ago
parent
commit
826a7d1198
  1. 15
      src/engine/net/client/handlers/ObjectActionMsgHandler.java

15
src/engine/net/client/handlers/ObjectActionMsgHandler.java

@ -123,6 +123,11 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { @@ -123,6 +123,11 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
if (resourceValue < 15)
hasResources = false;
resourceValue = warehouse.getResources().get(Warehouse.mithrilIB);
if (resourceValue < 1)
hasResources = false;
if (hasResources == false) {
ErrorPopupMsg.sendErrorPopup(player, 184); // Insufficient gold or resources to upgrade to capital
return false;
@ -180,6 +185,16 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { @@ -180,6 +185,16 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
return false;
}
resourceValue = warehouse.getResources().get(Warehouse.mithrilIB);
if (DbManager.WarehouseQueries.updateWormwood(warehouse, resourceValue - 1) == true) {
warehouse.getResources().put(Warehouse.mithrilIB, resourceValue - 1);
warehouse.AddTransactionToWarehouse(engine.Enum.GameObjectType.Building, tol.getObjectUUID(), Enum.TransactionType.WITHDRAWL, Resource.MITHRIL, 1);
} else {
Logger.error("wormwood update failed for warehouse of UUID:" + warehouse.getObjectUUID());
return false;
}
realm.claimRealmForCity(city, charterUUID);
tol.setRank(8);

Loading…
Cancel
Save