5 $balance_sheet = "ship_balance.txt";
6 $loot_sheet = "looted_component_balance.txt";
7 $weapon_loot = "components\\weapon.tab";
9 $server_prefix = "\\swg\\current\\dsrc\\sku.0\\sys.server\\compiled\\game\\object\\tangible\\ship\\components";
10 $shared_prefix = "\\swg\\current\\dsrc\\sku.0\\sys.shared\\compiled\\game\\object\\tangible\\ship\\components";
16 # Read our balance sheet.
17 print "\nbalance_space_loot process started\n";
18 #print "Output file: $output_filename\n";
27 # Overall function for reading the balance sheet.
32 open BALANCE
, "<$balance_sheet";
38 if ( /Core Balance Data/ )
46 elsif ( /Player Factor/ )
48 @player_factor = @fields;
56 # sub calculateBalance
61 for ( my $i=0; $i<@header; $i++ )
68 for ( my $tier=1; $tier<6; $tier++ )
71 my $name = $key . "_tier" . $tier;
73 # Modify by the player tier factor.
77 @factor = split /!/, $player_factor[$i];
81 for ( my $x=1; $x<$tier; $x++ )
87 $f = sprintf( "%.2f", $f );
88 $balancedata{$name} = $f;
99 # Read balance data from the loot sheet.
100 open LOOT
, "<$loot_sheet";
106 /Mass Distribution/ and do { $massb = readBaseline
( $line, $massb ); next; };
107 /Reactor Drain Distribution/ and do { $reactorb = readBaseline
( $line, $reactorb ); next; };
108 /Armor/ and do { readChunk
( $line, \
%armor ); next; };
109 /Booster/ and do { readChunk
( $line, \
%booster ); next; };
110 /Capacitor/ and do { readChunk
( $line, \
%capacitor ); next; };
111 /Droid Interface/ and do { readChunk
( $line, \
%droid_interface ); next; };
112 /Engine/ and do { readChunk
( $line, \
%engine ); next; };
113 /Reactor/ and do { readChunk
( $line, \
%reactor ); next; };
114 /Shield/ and do { readChunk
( $line, \
%shield ); next; };
115 /Weapon/ and do { readChunk
( $line, \
%weapon ); next; };
116 $chunk = (split /\t/, $line)[0];
125 outputDroidInterface
();
138 my ($line, $massb) = @_;
140 # Check for end of chunk.
150 @fields = split /\t/, $line;
151 if ( $fields[0] ne "BASELINE" )
164 my ($line, $mref) = @_;
166 # Check for end of chunk.
176 @fields = split /\t/, $line;
177 if ( $fields[0] ne "Name" )
179 if ( $fields[0] eq undef )
184 $$mref{$fields[0]} = $line;
194 # Dump the balance data.
195 open ARMOR
, ">components\\armor.tab";
196 print ARMOR
"strType\tstrComments\tfltCurrentHitpoints\tfltMaximumHitpoints\tfltMaximumArmorHitpointsMod\tfltMaximumArmorHitpoints\tfltCurrentArmorHitpoints\tfltEfficiency\tfltEnergyMaintenanceModifier\tfltEnergyMaintenance\tfltMassModifier\tfltMass\treverseEngineeringLevel\n";
197 print ARMOR
"s\tc\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\ti\n";
198 foreach $key (sort(keys %armor))
200 my @fields = split /\t/, $armor{$key};
202 # Determine our tier.
203 $tier = sprintf( "%.0f", $fields[1]/2 );
204 $step = ($fields[1] % 2) == 0;
217 print ARMOR
"object/tangible/ship/components/armor/$fields[0].iff" . "\t";
220 print ARMOR
"Do not edit." . "\t";
223 $hp = $balancedata{"Armor_tier$tier"} * $fields[2] * $mod;
224 $hp = sprintf( "%.3f", $hp );
225 print ARMOR
$hp . "\t";
226 print ARMOR
$hp . "\t";
227 print ARMOR
$fields[3] . "\t";
228 print ARMOR
$hp . "\t";
229 print ARMOR
$hp ."\t";
239 @mbaseline = split /\t/, $massb;
240 $mass = $mbaseline[0] * $mbaseline[1] * $fields[4] * $fields[6];
241 $mass = sprintf( "%.3f", $mass );
242 print ARMOR
$fields[5] . "\t";
243 print ARMOR
$mass . "\t";
245 # Reverse engineering.
246 print ARMOR
$fields[1] . "\n";
250 # Check out the objects from P4?
252 # Create the objects.
253 # foreach $key (keys %armor)
255 # open SERVER_OBJ, ">$server_prefix\\armor\\$key.tpf";
256 # print SERVER_OBJ "\@base object\/tangible\/ship\/components\/base\/ship_component_loot_base.iff\n";
257 # print SERVER_OBJ "\@class tangible_object_template 1\n";
258 # print SERVER_OBJ "\@class object_template 5\n";
259 # print SERVER_OBJ "sharedTemplate = \"object\/tangible\/ship\/components\/armor\/shared_$key.iff\"\n";
260 # print SERVER_OBJ "moveFlags = [ MF_player ]\n";
263 # open SHARED_OBJ, ">$shared_prefix\\armor\\shared_$key.tpf";
264 # print SHARED_OBJ "\@base object\/tangible\/ship\/components\/base\/shared_ship_component_loot_base.iff\n";
265 # print SHARED_OBJ "\@class tangible_object_template 8\n";
266 # print SHARED_OBJ "certificationsRequired = [\"cert_ordnance_level$cert\"]\n";
267 # print SHARED_OBJ "\@class object_template 7\n";
268 # print SHARED_OBJ "clearFloraRadius = 0\n";
269 # print SHARED_OBJ "objectName = \"space/space_item\" \"".$key."_n\"\n";
270 # print SHARED_OBJ "detailedDescription = \"space/space_item\" \"".$key."_d\"\n";
271 # print SHARED_OBJ "containerType = CT_none\n";
272 # print SHARED_OBJ "appearanceFilename = \"appearance\/ship_component_reactor_s01.apt\"\n";
273 # print SHARED_OBJ "portalLayoutFilename = \"\"\n";
274 # print SHARED_OBJ "clientDataFile = \"\"\n";
275 # print SHARED_OBJ "gameObjectType = GOT_ship_component_armor\n";
279 # Add the objects to P4?
288 # Dump the balance data.
289 open BOOSTERS
, ">components\\booster.tab";
290 print BOOSTERS
"strType\tstrComments\tfltCurrentEnergy\tfltMaximumEnergyModifier\tfltMaximumEnergy\tfltRechargeRateModifier\tfltRechargeRate\tfltConsumptionRateModifier\tfltConsumptionRate\tfltAccelerationModifier\tfltAcceleration\tfltMaxSpeedModifier\tfltMaxSpeed\tfltCurrentHitpoints\tfltMaximumHitpoints\tfltMaximumArmorHitpointsMod\tfltMaximumArmorHitpoints\tfltCurrentArmorHitpoints\tfltEfficiency\tfltEnergyMaintenanceModifier\tfltEnergyMaintenance\tfltMassModifier\tfltMass\treverseEngineeringLevel\n";
291 print BOOSTERS
"s\tc\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\ti\n";
292 foreach $key (sort(keys %booster))
294 my @fields = split /\t/, $booster{$key};
296 # Determine our tier.
297 $tier = sprintf( "%.0f", $fields[1]/2 );
298 $step = ($fields[1] % 2) == 0;
311 print BOOSTERS
"object/tangible/ship/components/booster/$fields[0].iff" . "\t";
314 print BOOSTERS
"Do not edit." . "\t";
317 $be = $balancedata{"BoosterEnergy_tier$tier"} * $fields[8] * $mod;
318 $be = sprintf( "%.3f", $be );
319 print BOOSTERS
$be . "\t";
320 print BOOSTERS
$fields[9] . "\t";
321 print BOOSTERS
$be . "\t";
324 $br = $balancedata{"BoosterRecharge_tier$tier"} * $fields[10] * $mod;
325 $br = sprintf( "%.3f", $br );
326 print BOOSTERS
$fields[11] . "\t";
327 print BOOSTERS
$br . "\t";
330 $bc = $balancedata{"BoosterConsumption_tier$tier"} * $fields[12] * $mod;
331 $bc = sprintf( "%.3f", $bc );
332 print BOOSTERS
$fields[13] . "\t";
333 print BOOSTERS
$bc . "\t";
336 $ba = $balancedata{"BoosterAccel_tier$tier"} * $fields[14] * $mod;
337 $ba = sprintf( "%.3f", $ba );
338 print BOOSTERS
$fields[15] . "\t";
339 print BOOSTERS
$ba . "\t";
342 $bs = $balancedata{"BoosterSpeed_tier$tier"} * $fields[16] * $mod;
343 $bs = sprintf( "%.3f", $bs );
344 print BOOSTERS
$fields[17] . "\t";
345 print BOOSTERS
$bs . "\t";
348 $hp = $balancedata{"Component_tier$tier"} * $fields[2] * $mod;
349 $hp = sprintf( "%.3f", $hp );
350 print BOOSTERS
$hp . "\t";
351 print BOOSTERS
$hp . "\t";
352 print BOOSTERS
$fields[3] . "\t";
353 print BOOSTERS
$hp/2 . "\t";
354 print BOOSTERS
$hp/2 ."\t";
357 print BOOSTERS
"1\t";
360 @rbaseline = split /\t/, $reactorb;
361 $maint = $rbaseline[0] * $rbaseline[4] * $fields[4];
362 $maint = sprintf( "%.3f", $maint );
363 print BOOSTERS
$fields[5] . "\t";
364 print BOOSTERS
$maint . "\t";
367 @mbaseline = split /\t/, $massb;
368 $mass = $mbaseline[0] * $mbaseline[4] * $fields[6] * $fields[18];
369 $mass = sprintf( "%.3f", $mass );
370 print BOOSTERS
$fields[7] . "\t";
371 print BOOSTERS
$mass . "\t";
373 # Reverse engineering.
374 print BOOSTERS
$fields[1] . "\n";
378 # Check out the objects from P4?
380 # Create the objects.
381 # foreach $key (keys %booster)
383 # open SERVER_OBJ, ">$server_prefix\\booster\\$key.tpf";
384 # print SERVER_OBJ "\@base object\/tangible\/ship\/components\/base\/ship_component_loot_base.iff\n";
385 # print SERVER_OBJ "\@class tangible_object_template 1\n";
386 # print SERVER_OBJ "\@class object_template 5\n";
387 # print SERVER_OBJ "sharedTemplate = \"object\/tangible\/ship\/components\/booster\/shared_$key.iff\"\n";
388 # print SERVER_OBJ "moveFlags = [ MF_player ]\n";
391 # open SHARED_OBJ, ">$shared_prefix\\booster\\shared_$key.tpf";
392 # print SHARED_OBJ "\@base object\/tangible\/ship\/components\/base\/shared_ship_component_loot_base.iff\n";
393 # print SHARED_OBJ "\@class tangible_object_template 8\n";
394 # print SHARED_OBJ "certificationsRequired = [\"cert_ordnance_level$cert\"]\n";
395 # print SHARED_OBJ "\@class object_template 7\n";
396 # print SHARED_OBJ "clearFloraRadius = 0\n";
397 # print SHARED_OBJ "objectName = \"space/space_item\" \"".$key."_n\"\n";
398 # print SHARED_OBJ "detailedDescription = \"space/space_item\" \"".$key."_d\"\n";
399 # print SHARED_OBJ "containerType = CT_none\n";
400 # print SHARED_OBJ "appearanceFilename = \"appearance\/ship_component_booster_s01.apt\"\n";
401 # print SHARED_OBJ "portalLayoutFilename = \"\"\n";
402 # print SHARED_OBJ "clientDataFile = \"\"\n";
403 # print SHARED_OBJ "gameObjectType = GOT_ship_component_booster\n";
407 # Add the objects to P4?
411 # sub outputCapacitors
416 # Dump the balance data.
417 open CAPACITORS
, ">components\\capacitor.tab";
418 print CAPACITORS
"strType\tstrComments\tfltCurrentEnergy\tfltMaxEnergyModifier\tfltMaxEnergy\tfltRechargeRateModifier\tfltRechargeRate\tfltCurrentHitpoints\tfltMaximumHitpoints\tfltMaximumArmorHitpointsMod\tfltMaximumArmorHitpoints\tfltCurrentArmorHitpoints\tfltEfficiency\tfltEnergyMaintenanceModifier\tfltEnergyMaintenance\tfltMassModifier\tfltMass\treverseEngineeringLevel\n";
419 print CAPACITORS
"s\tc\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\ti\n";
420 foreach $key (sort(keys %capacitor))
422 my @fields = split /\t/, $capacitor{$key};
424 # Determine our tier.
425 $tier = sprintf( "%.0f", $fields[1]/2 );
426 $step = ($fields[1] % 2) == 0;
439 print CAPACITORS
"object/tangible/ship/components/weapon_capacitor/$fields[0].iff" . "\t";
442 print CAPACITORS
"Do not edit." . "\t";
445 $ce = $balancedata{"CapacitorEnergy_tier$tier"} * $fields[8] * $mod;
446 $ce = sprintf( "%.3f", $ce );
447 print CAPACITORS
$ce . "\t";
448 print CAPACITORS
$fields[9] . "\t";
449 print CAPACITORS
$ce . "\t";
452 $cr = $balancedata{"CapacitorRegen_tier$tier"} * $fields[10] * $mod;
453 $cr = sprintf( "%.3f", $cr );
454 print CAPACITORS
$fields[11] . "\t";
455 print CAPACITORS
$cr . "\t";
458 $hp = $balancedata{"Component_tier$tier"} * $fields[2] * $mod;
459 $hp = sprintf( "%.3f", $hp );
460 print CAPACITORS
$hp . "\t";
461 print CAPACITORS
$hp . "\t";
462 print CAPACITORS
$fields[3] . "\t";
463 print CAPACITORS
$hp/2 . "\t";
464 print CAPACITORS
$hp/2 ."\t";
467 print CAPACITORS
"1\t";
470 @rbaseline = split /\t/, $reactorb;
471 $maint = $rbaseline[0] * $rbaseline[5] * $fields[4];
472 $maint = sprintf( "%.3f", $maint );
473 print CAPACITORS
$fields[5] . "\t";
474 print CAPACITORS
$maint . "\t";
477 @mbaseline = split /\t/, $massb;
478 $mass = $mbaseline[0] * $mbaseline[5] * $fields[6] * $fields[12];
479 $mass = sprintf( "%.3f", $mass );
480 print CAPACITORS
$fields[7] . "\t";
481 print CAPACITORS
$mass . "\t";
483 # Reverse engineering.
484 print CAPACITORS
$fields[1] . "\n";
488 # Check out the objects from P4?
490 # Create the objects.
491 # foreach $key (keys %capacitor)
493 # open SERVER_OBJ, ">$server_prefix\\weapon_capacitor\\$key.tpf";
494 # print SERVER_OBJ "\@base object\/tangible\/ship\/components\/base\/ship_component_loot_base.iff\n";
495 # print SERVER_OBJ "\@class tangible_object_template 1\n";
496 # print SERVER_OBJ "\@class object_template 5\n";
497 # print SERVER_OBJ "sharedTemplate = \"object\/tangible\/ship\/components\/weapon_capacitor\/shared_$key.iff\"\n";
498 # print SERVER_OBJ "moveFlags = [ MF_player ]\n";
501 # open SHARED_OBJ, ">$shared_prefix\\weapon_capacitor\\shared_$key.tpf";
502 # print SHARED_OBJ "\@base object\/tangible\/ship\/components\/base\/shared_ship_component_loot_base.iff\n";
503 # print SHARED_OBJ "\@class tangible_object_template 8\n";
504 # print SHARED_OBJ "certificationsRequired = [\"cert_ordnance_level$cert\"]\n";
505 # print SHARED_OBJ "\@class object_template 7\n";
506 # print SHARED_OBJ "clearFloraRadius = 0\n";
507 # print SHARED_OBJ "objectName = \"space/space_item\" \"".$key."_n\"\n";
508 # print SHARED_OBJ "detailedDescription = \"space/space_item\" \"".$key."_d\"\n";
509 # print SHARED_OBJ "containerType = CT_none\n";
510 # print SHARED_OBJ "appearanceFilename = \"appearance\/ship_component_capacitor_s01.apt\"\n";
511 # print SHARED_OBJ "portalLayoutFilename = \"\"\n";
512 # print SHARED_OBJ "clientDataFile = \"\"\n";
513 # print SHARED_OBJ "gameObjectType = GOT_ship_component_capacitor\n";
517 # Add the objects to P4?
521 # sub outputDroidInterface
524 sub outputDroidInterface
526 # Dump the balance data.
527 open DROID_INTERFACES
, ">components\\droid_interface.tab";
528 print DROID_INTERFACES
"strType\tstrComments\tfltCommandSpeedModifier\tfltCommandSpeed\tfltCurrentHitpoints\tfltMaximumHitpoints\tfltMaximumArmorHitpointsMod\tfltMaximumArmorHitpoints\tfltCurrentArmorHitpoints\tfltEfficiency\tfltEnergyMaintenanceModifier\tfltEnergyMaintenance\tfltMassModifier\tfltMass\treverseEngineeringLevel\n";
529 print DROID_INTERFACES
"s\tc\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\ti\n";
530 foreach $key (sort(keys %droid_interface))
532 my @fields = split /\t/, $droid_interface{$key};
534 # Determine our tier.
535 $tier = sprintf( "%.0f", $fields[1]/2 );
536 $step = ($fields[1] % 2) == 0;
549 print DROID_INTERFACES
"object/tangible/ship/components/droid_interface/$fields[0].iff" . "\t";
552 print DROID_INTERFACES
"Do not edit." . "\t";
555 $cs = $balancedata{"CommandSpeed_tier$tier"} * $fields[8] * $mod;
556 $cs = sprintf( "%.3f", $cs );
557 print DROID_INTERFACES
$fields[9] . "\t";
558 print DROID_INTERFACES
$cs . "\t";
561 $hp = $balancedata{"Component_tier$tier"} * $fields[2] * $mod;
562 $hp = sprintf( "%.3f", $hp );
563 print DROID_INTERFACES
$hp . "\t";
564 print DROID_INTERFACES
$hp . "\t";
565 print DROID_INTERFACES
$fields[3] . "\t";
566 print DROID_INTERFACES
$hp/2 . "\t";
567 print DROID_INTERFACES
$hp/2 ."\t";
570 print DROID_INTERFACES
"1\t";
573 @rbaseline = split /\t/, $reactorb;
574 $maint = $rbaseline[0] * $rbaseline[6] * $fields[4];
575 $maint = sprintf( "%.3f", $maint );
576 print DROID_INTERFACES
$fields[5] . "\t";
577 print DROID_INTERFACES
$maint . "\t";
580 @mbaseline = split /\t/, $massb;
581 $mass = $mbaseline[0] * $mbaseline[6] * $fields[6] * $fields[10];
582 $mass = sprintf( "%.3f", $mass );
583 print DROID_INTERFACES
$fields[7] . "\t";
584 print DROID_INTERFACES
$mass . "\t";
586 # Reverse engineering.
587 print DROID_INTERFACES
$fields[1] . "\n";
589 close DROID_INTERFACES
;
591 # Check out the objects from P4?
593 # Create the objects.
594 # foreach $key (keys %droid_interface)
596 # open SERVER_OBJ, ">$server_prefix\\droid_interface\\$key.tpf";
597 # print SERVER_OBJ "\@base object\/tangible\/ship\/components\/base\/ship_component_loot_base.iff\n";
598 # print SERVER_OBJ "\@class tangible_object_template 1\n";
599 # print SERVER_OBJ "\@class object_template 5\n";
600 # print SERVER_OBJ "sharedTemplate = \"object\/tangible\/ship\/components\/droid_interface\/shared_$key.iff\"\n";
601 # print SERVER_OBJ "moveFlags = [ MF_player ]\n";
604 # open SHARED_OBJ, ">$shared_prefix\\droid_interface\\shared_$key.tpf";
605 # print SHARED_OBJ "\@base object\/tangible\/ship\/components\/base\/shared_ship_component_loot_base.iff\n";
606 # print SHARED_OBJ "\@class tangible_object_template 8\n";
607 # print SHARED_OBJ "certificationsRequired = [\"cert_ordnance_level$cert\"]\n";
608 # print SHARED_OBJ "\@class object_template 7\n";
609 # print SHARED_OBJ "clearFloraRadius = 0\n";
610 # print SHARED_OBJ "objectName = \"space/space_item\" \"".$key."_n\"\n";
611 # print SHARED_OBJ "detailedDescription = \"space/space_item\" \"".$key."_d\"\n";
612 # print SHARED_OBJ "containerType = CT_none\n";
613 # print SHARED_OBJ "appearanceFilename = \"appearance\/ship_component_droidinterface_s01.apt\"\n";
614 # print SHARED_OBJ "portalLayoutFilename = \"\"\n";
615 # print SHARED_OBJ "clientDataFile = \"\"\n";
616 # print SHARED_OBJ "gameObjectType = GOT_ship_component_droid_interface\n";
620 # Add the objects to P4?
629 # Dump the balance data.
630 open ENGINES
, ">components\\engine.tab";
631 print ENGINES
"strType\tstrComments\tfltMaxSpeedModifier\tfltMaxSpeed\tfltMaxPitchModifier\tfltMaxPitch\tfltMaxRollModifier\tfltMaxRoll\tfltMaxYawModifier\tfltMaxYaw\tfltCurrentHitpoints\tfltMaximumHitpoints\tfltMaximumArmorHitpointsMod\tfltMaximumArmorHitpoints\tfltCurrentArmorHitpoints\tfltEfficiency\tfltEnergyMaintenanceModifier\tfltEnergyMaintenance\tfltMassModifier\tfltMass\treverseEngineeringLevel\n";
632 print ENGINES
"s\tc\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\ti\n";
633 foreach $key (sort(keys %engine))
635 my @fields = split /\t/, $engine{$key};
637 # Determine our tier.
638 $tier = sprintf( "%.0f", $fields[1]/2 );
639 $step = ($fields[1] % 2) == 0;
652 print ENGINES
"object/tangible/ship/components/engine/$fields[0].iff" . "\t";
655 print ENGINES
"Do not edit." . "\t";
658 $ms = $balancedata{"EngineSpeed_tier$tier"} * $fields[8] * $mod;
659 print ENGINES
$fields[9] . "\t";
660 print ENGINES
$ms . "\t";
663 $p = $balancedata{"EnginePitch_tier$tier"} * $fields[10] * $mod;
664 print ENGINES
$fields[11] . "\t";
665 print ENGINES
$p . "\t";
668 $r = $balancedata{"EngineRoll_tier$tier"} * $fields[12] * $mod;
669 print ENGINES
$fields[13] . "\t";
670 print ENGINES
$r . "\t";
673 $y = $balancedata{"EngineYaw_tier$tier"} * $fields[14] * $mod;
674 print ENGINES
$fields[15] . "\t";
675 print ENGINES
$y . "\t";
678 $hp = $balancedata{"Component_tier$tier"} * $fields[2] * $mod;
679 print ENGINES
$hp . "\t";
680 print ENGINES
$hp . "\t";
681 print ENGINES
$fields[3] . "\t";
682 print ENGINES
$hp/2 . "\t";
683 print ENGINES
$hp/2 ."\t";
689 @rbaseline = split /\t/, $reactorb;
690 $maint = $rbaseline[0] * $rbaseline[7] * $fields[4];
691 $maint = sprintf( "%.3f", $maint );
692 print ENGINES
$fields[5] . "\t";
693 print ENGINES
$maint . "\t";
696 @mbaseline = split /\t/, $massb;
697 $mass = $mbaseline[0] * $mbaseline[7] * $fields[6] * $fields[16];
698 $mass = sprintf( "%.3f", $mass );
699 print ENGINES
$fields[7] . "\t";
700 print ENGINES
$mass . "\t";
702 # Reverse engineering.
703 print ENGINES
$fields[1] . "\n";
707 # Check out the objects from P4?
709 # Create the objects.
710 # foreach $key (sort(keys %engine))
712 # open SERVER_OBJ, ">$server_prefix\\engine\\$key.tpf";
713 # print SERVER_OBJ "\@base object\/tangible\/ship\/components\/base\/ship_component_loot_base.iff\n";
714 # print SERVER_OBJ "\@class tangible_object_template 1\n";
715 # print SERVER_OBJ "\@class object_template 5\n";
716 # print SERVER_OBJ "sharedTemplate = \"object\/tangible\/ship\/components\/engine\/shared_$key.iff\"\n";
717 # print SERVER_OBJ "moveFlags = [ MF_player ]\n";
720 # open SHARED_OBJ, ">$shared_prefix\\engine\\shared_$key.tpf";
721 # print SHARED_OBJ "\@base object\/tangible\/ship\/components\/base\/shared_ship_component_loot_base.iff\n";
722 # print SHARED_OBJ "\@class tangible_object_template 8\n";
723 # print SHARED_OBJ "certificationsRequired = [\"cert_ordnance_level$cert\"]\n";
724 # print SHARED_OBJ "\@class object_template 7\n";
725 # print SHARED_OBJ "clearFloraRadius = 0\n";
726 # print SHARED_OBJ "objectName = \"space/space_item\" \"".$key."_n\"\n";
727 # print SHARED_OBJ "detailedDescription = \"space/space_item\" \"".$key."_d\"\n";
728 # print SHARED_OBJ "containerType = CT_none\n";
729 # print SHARED_OBJ "appearanceFilename = \"appearance\/ship_component_engine_s01.apt\"\n";
730 # print SHARED_OBJ "portalLayoutFilename = \"\"\n";
731 # print SHARED_OBJ "clientDataFile = \"\"\n";
732 # print SHARED_OBJ "gameObjectType = GOT_ship_component_engine\n";
736 # Add the objects to P4?
745 # Dump the balance data.
746 open REACTORS
, ">components\\reactor.tab";
747 print REACTORS
"strType\tstrComments\tfltEnergyGenerationModifier\tfltEnergyGeneration\tfltCurrentHitpoints\tfltMaximumHitpoints\tfltMaximumArmorHitpointsMod\tfltMaximumArmorHitpoints\tfltCurrentArmorHitpoints\tfltEfficiency\tfltEnergyMaintenanceModifier\tfltEnergyMaintenance\tfltMassModifier\tfltMass\treverseEngineeringLevel\n";
748 print REACTORS
"s\tc\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\ti\n";
749 foreach $key (sort(keys %reactor))
751 my @fields = split /\t/, $reactor{$key};
753 # Determine our tier.
754 $tier = sprintf( "%.0f", $fields[1]/2 );
755 $step = ($fields[1] % 2) == 0;
768 print REACTORS
"object/tangible/ship/components/reactor/$fields[0].iff" . "\t";
771 print REACTORS
"Do not edit." . "\t";
774 $eg = 10000 * $fields[6];
775 $eg = sprintf( "%.3f", $eg );
776 print REACTORS
$fields[7] . "\t";
777 print REACTORS
$eg . "\t";
780 $hp = $balancedata{"Component_tier$tier"} * $fields[2] * $mod;
781 $hp = sprintf( "%.3f", $hp );
782 print REACTORS
$hp . "\t";
783 print REACTORS
$hp . "\t";
784 print REACTORS
$fields[3] . "\t";
785 print REACTORS
$hp/2 . "\t";
786 print REACTORS
$hp/2 ."\t";
788 # Efficiency & Maintenance
789 print REACTORS
"1\t0\t0\t";
792 @mbaseline = split /\t/, $massb;
793 $mass = $mbaseline[0] * $mbaseline[8] * $fields[4] * $fields[8];
794 $mass = sprintf( "%.3f", $mass );
795 print REACTORS
$fields[5] . "\t";
796 print REACTORS
$mass . "\t";
798 # Reverse engineering.
799 print REACTORS
$fields[1] . "\n";
803 # Check out the objects from P4?
805 # Create the objects.
806 # foreach $key (keys %reactor)
808 # open SERVER_OBJ, ">$server_prefix\\reactor\\$key.tpf";
809 # print SERVER_OBJ "\@base object\/tangible\/ship\/components\/base\/ship_component_loot_base.iff\n";
810 # print SERVER_OBJ "\@class tangible_object_template 1\n";
811 # print SERVER_OBJ "\@class object_template 5\n";
812 # print SERVER_OBJ "sharedTemplate = \"object\/tangible\/ship\/components\/reactor\/shared_$key.iff\"\n";
813 # print SERVER_OBJ "moveFlags = [ MF_player ]\n";
816 # open SHARED_OBJ, ">$shared_prefix\\reactor\\shared_$key.tpf";
817 # print SHARED_OBJ "\@base object\/tangible\/ship\/components\/base\/shared_ship_component_loot_base.iff\n";
818 # print SHARED_OBJ "\@class tangible_object_template 8\n";
819 # print SHARED_OBJ "certificationsRequired = [\"cert_ordnance_level$cert\"]\n";
820 # print SHARED_OBJ "\@class object_template 7\n";
821 # print SHARED_OBJ "clearFloraRadius = 0\n";
822 # print SHARED_OBJ "objectName = \"space/space_item\" \"".$key."_n\"\n";
823 # print SHARED_OBJ "detailedDescription = \"space/space_item\" \"".$key."_d\"\n";
824 # print SHARED_OBJ "containerType = CT_none\n";
825 # print SHARED_OBJ "appearanceFilename = \"appearance\/ship_component_reactor_s01.apt\"\n";
826 # print SHARED_OBJ "portalLayoutFilename = \"\"\n";
827 # print SHARED_OBJ "clientDataFile = \"\"\n";
828 # print SHARED_OBJ "gameObjectType = GOT_ship_component_reactor\n";
832 # Add the objects to P4?
841 # Dump the balance data.
842 open SHIELDS
, ">components\\shield.tab";
843 print SHIELDS
"strType\tstrComments\tfltShieldRechargeRateModifier\tfltShieldRechargeRate\tfltShieldHitpointsMaximumFrontModifier\tfltShieldHitpointsMaximumFront\tfltShieldHitpointsMaximumBackModifier\tfltShieldHitpointsMaximumBack\tfltCurrentHitpoints\tfltMaximumHitpoints\tfltMaximumArmorHitpointsMod\tfltMaximumArmorHitpoints\tfltCurrentArmorHitpoints\tfltEfficiency\tfltEnergyMaintenanceModifier\tfltEnergyMaintenance\tfltMassModifier\tfltMass\treverseEngineeringLevel\n";
844 print SHIELDS
"s\tc\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\ti\n";
845 foreach $key (sort(keys %shield))
847 my @fields = split /\t/, $shield{$key};
849 # Determine our tier.
850 $tier = sprintf( "%.0f", $fields[1]/2 );
851 $step = ($fields[1] % 2) == 0;
864 print SHIELDS
"object/tangible/ship/components/shield_generator/$fields[0].iff" . "\t";
867 print SHIELDS
"Do not edit." . "\t";
870 $sr = $balancedata{"ShieldRegen_tier$tier"} * $fields[8] * $mod;
871 $sr = sprintf( "%.3f", $sr );
872 print SHIELDS
$fields[9] . "\t";
873 print SHIELDS
$sr . "\t";
876 $sf = $balancedata{"Shield_tier$tier"} * $fields[10] * $mod;
877 $sf = sprintf( "%.3f", $sf );
878 print SHIELDS
$fields[11] . "\t";
879 print SHIELDS
$sf . "\t";
882 $sb = $balancedata{"Shield_tier$tier"} * $fields[12] * $mod;
883 $sb = sprintf( "%.3f", $sb );
884 print SHIELDS
$fields[13] . "\t";
885 print SHIELDS
$sb . "\t";
888 $hp = $balancedata{"Component_tier$tier"} * $fields[2] * $mod;
889 $hp = sprintf( "%.3f", $hp );
890 print SHIELDS
$hp . "\t";
891 print SHIELDS
$hp . "\t";
892 print SHIELDS
$fields[3] . "\t";
893 print SHIELDS
$hp/2 . "\t";
894 print SHIELDS
$hp/2 ."\t";
900 @rbaseline = split /\t/, $reactorb;
901 $maint = $rbaseline[0] * $rbaseline[3] * $fields[4];
902 $maint = sprintf( "%.3f", $maint );
903 print SHIELDS
$fields[5] . "\t";
904 print SHIELDS
$maint . "\t";
907 @mbaseline = split /\t/, $massb;
908 $mass = $mbaseline[0] * $mbaseline[3] * $fields[6] * $fields[14];
909 $mass = sprintf( "%.3f", $mass );
910 print SHIELDS
$fields[7] . "\t";
911 print SHIELDS
$mass . "\t";
913 # Reverse engineering.
914 print SHIELDS
$fields[1] . "\n";
918 # Check out the objects from P4?
920 # Create the objects.
921 # foreach $key (keys %shield)
923 # open SERVER_OBJ, ">$server_prefix\\shield_generator\\$key.tpf";
924 # print SERVER_OBJ "\@base object\/tangible\/ship\/components\/base\/ship_component_loot_base.iff\n";
925 # print SERVER_OBJ "\@class tangible_object_template 1\n";
926 # print SERVER_OBJ "\@class object_template 5\n";
927 # print SERVER_OBJ "sharedTemplate = \"object\/tangible\/ship\/components\/shield_generator\/shared_$key.iff\"\n";
928 # print SERVER_OBJ "moveFlags = [ MF_player ]\n";
931 # open SHARED_OBJ, ">$shared_prefix\\shield_generator\\shared_$key.tpf";
932 # print SHARED_OBJ "\@base object\/tangible\/ship\/components\/base\/shared_ship_component_loot_base.iff\n";
933 # print SHARED_OBJ "\@class tangible_object_template 8\n";
934 # print SHARED_OBJ "certificationsRequired = [\"cert_ordnance_level$cert\"]\n";
935 # print SHARED_OBJ "\@class object_template 7\n";
936 # print SHARED_OBJ "clearFloraRadius = 0\n";
937 # print SHARED_OBJ "objectName = \"space/space_item\" \"".$key."_n\"\n";
938 # print SHARED_OBJ "detailedDescription = \"space/space_item\" \"".$key."_d\"\n";
939 # print SHARED_OBJ "containerType = CT_none\n";
940 # print SHARED_OBJ "appearanceFilename = \"appearance\/ship_component_shield_s01.apt\"\n";
941 # print SHARED_OBJ "portalLayoutFilename = \"\"\n";
942 # print SHARED_OBJ "clientDataFile = \"\"\n";
943 # print SHARED_OBJ "gameObjectType = GOT_ship_component_shield\n";
947 # Add the objects to P4?
956 # Dump the balance data.
957 open WEAPONS
, ">components\\weapon.tab";
958 print WEAPONS
"strType\tstrComments\tfltMinDamageModifier\tfltMinDamage\tfltMaxDamageModifier\tfltMaxDamage\tfltShieldEffectivenessModifier\tfltShieldEffectiveness\tfltArmorEffectivenessModifier\tfltArmorEffectiveness\tfltEnergyPerShotModifier\tfltEnergyPerShot\tfltRefireRateModifier\tfltRefireRate\tfltCurrentHitpoints\tfltMaximumHitpoints\tfltMaximumArmorHitpointsMod\tfltMaximumArmorHitpoints\tfltCurrentArmorHitpoints\tfltEfficiency\tfltEnergyMaintenanceModifier\tfltEnergyMaintenance\tfltMassModifier\tfltMass\treverseEngineeringLevel\n";
959 print WEAPONS
"s\tc\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\tf\ti\n";
960 foreach $key (sort(keys %weapon))
962 my @fields = split /\t/, $weapon{$key};
964 # Determine our tier.
965 $tier = sprintf( "%.0f", $fields[1]/2 );
966 $step = ($fields[1] % 2) == 0;
979 print WEAPONS
"object/tangible/ship/components/weapon/$fields[0].iff" . "\t";
982 print WEAPONS
"Do not edit." . "\t";
985 $md = $balancedata{"DamageMin_tier$tier"} * $fields[8] * $mod;
986 $md = sprintf( "%.3f", $md );
987 print WEAPONS
$fields[9] . "\t";
988 print WEAPONS
$md . "\t";
991 $md = $balancedata{"DamageMax_tier$tier"} * $fields[10] * $mod;
992 $md = sprintf( "%.3f", $md );
993 print WEAPONS
$fields[11] . "\t";
994 print WEAPONS
$md . "\t";
997 $se = $balancedata{"WeaponEffShield_tier$tier"} * $fields[12] * $mod;
998 $se = sprintf( "%.3f", $se );
999 print WEAPONS
$fields[13] . "\t";
1000 print WEAPONS
$se . "\t";
1003 $ae = $balancedata{"WeaponEffArmor_tier$tier"} * $fields[14] * $mod;
1004 $ae = sprintf( "%.3f", $ae );
1005 print WEAPONS
$fields[15] . "\t";
1006 print WEAPONS
$ae . "\t";
1009 $wd = $balancedata{"WeaponDrain_tier$tier"} * $fields[16] * $mod;
1010 $wd = sprintf( "%.3f", $wd );
1011 print WEAPONS
$fields[17] . "\t";
1012 print WEAPONS
$wd . "\t";
1015 $wr = $balancedata{"WeaponRate_tier$tier"} * $fields[18] * $mod;
1016 # $wr = sprintf( "%.3f", $wr );
1017 print WEAPONS
$fields[19] . "\t";
1018 print WEAPONS
$wr . "\t";
1021 $hp = $balancedata{"Component_tier$tier"} * $fields[2] * $mod;
1022 $hp = sprintf( "%.3f", $hp );
1023 print WEAPONS
$hp . "\t";
1024 print WEAPONS
$hp . "\t";
1025 print WEAPONS
$fields[3] . "\t";
1026 print WEAPONS
$hp/2 . "\t";
1027 print WEAPONS
$hp/2 ."\t";
1030 print WEAPONS
"1\t";
1032 # Energy Maintenance
1033 @rbaseline = split /\t/, $reactorb;
1034 $maint = $rbaseline[0] * $rbaseline[2] * $fields[4];
1035 $maint = sprintf( "%.3f", $maint );
1036 print WEAPONS
$fields[5] . "\t";
1037 print WEAPONS
$maint . "\t";
1040 @mbaseline = split /\t/, $massb;
1041 $mass = $mbaseline[0] * $mbaseline[2] * $fields[6] * $fields[20];
1042 $mass = sprintf( "%.3f", $mass );
1043 print WEAPONS
$fields[7] . "\t";
1044 print WEAPONS
$mass . "\t";
1046 # Reverse engineering.
1047 print WEAPONS
$fields[1] . "\n";
1051 # Check out the objects from P4?
1053 # Create the objects.
1054 # foreach $key (keys %weapon)
1056 # open SERVER_OBJ, ">$server_prefix\\weapon\\$key.tpf";
1057 # print SERVER_OBJ "\@base object\/tangible\/ship\/components\/base\/ship_component_loot_base.iff\n";
1058 # print SERVER_OBJ "\@class tangible_object_template 1\n";
1059 # print SERVER_OBJ "\@class object_template 5\n";
1060 # print SERVER_OBJ "sharedTemplate = \"object\/tangible\/ship\/components\/weapon\/shared_$key.iff\"\n";
1061 # print SERVER_OBJ "moveFlags = [ MF_player ]\n";
1064 # open SHARED_OBJ, ">$shared_prefix\\weapon\\shared_$key.tpf";
1065 # print SHARED_OBJ "\@base object\/tangible\/ship\/components\/base\/shared_ship_component_loot_base.iff\n";
1066 # print SHARED_OBJ "\@class tangible_object_template 8\n";
1067 # print SHARED_OBJ "certificationsRequired = [\"cert_ordnance_level$cert\"]\n";
1068 # print SHARED_OBJ "\@class object_template 7\n";
1069 # print SHARED_OBJ "clearFloraRadius = 0\n";
1070 # print SHARED_OBJ "objectName = \"space/space_item\" \"".$key."_n\"\n";
1071 # print SHARED_OBJ "detailedDescription = \"space/space_item\" \"".$key."_d\"\n";
1072 # print SHARED_OBJ "containerType = CT_none\n";
1073 # print SHARED_OBJ "appearanceFilename = \"appearance\/ship_component_weapon_s01.apt\"\n";
1074 # print SHARED_OBJ "portalLayoutFilename = \"\"\n";
1075 # print SHARED_OBJ "clientDataFile = \"\"\n";
1076 # print SHARED_OBJ "gameObjectType = GOT_ship_component_weapon\n";
1080 # Add the objects to P4?