@ -54,7 +54,7 @@ public enum ForgeManager implements Runnable {
@@ -54,7 +54,7 @@ public enum ForgeManager implements Runnable {
// Resubmit workOrder
workOrder . completionTime = System . currentTimeMillis ( ) + 10000 ;
workOrder . rollingDuration = System . currentTimeMillis ( ) + 10000 ;
workOrder . total_to_produce = workOrder . total_to_produce - 1 ;
workOrders . add ( workOrder ) ;
@ -76,7 +76,7 @@ public enum ForgeManager implements Runnable {
@@ -76,7 +76,7 @@ public enum ForgeManager implements Runnable {
public static void submit ( WorkOrder workOrder ) {
workOrder . workOrderID = wordOrderCounter . incrementAndGet ( ) ;
workOrder . completionTime = System . currentTimeMillis ( ) + 10000 ;
workOrder . completionTime = System . currentTimeMillis ( ) + workOrder . rollingDuration ;
// 0 signifies single item roll. > 0 signifies multiple item roll.
@ -90,4 +90,22 @@ public enum ForgeManager implements Runnable {
@@ -90,4 +90,22 @@ public enum ForgeManager implements Runnable {
return true ;
}
public static long calcRollingDuration ( WorkOrder workOrder ) {
long rollingDuration ;
float rank = workOrder . vendor . getBuilding ( ) . getRank ( ) - 1 ;
float rate = ( float ) ( 2 . 5 * rank ) ;
float baseTime = ( 20 - rate ) * 60000 ;
// Bane circles
if ( workOrder . templateID > 910010 & & workOrder . templateID < 910019 ) {
rank = workOrder . templateID - 910010 ;
baseTime = rank * 60 * 60 * 3 * 1000 ;
}
rollingDuration = ( long ) ( baseTime * Float . parseFloat ( ConfigManager . MB_PRODUCTION_RATE . getValue ( ) ) ) ;
return rollingDuration ;
}
}