missing project/build files
[client-tools.git] / src / game / server / database / item_conversion / item_conversion.pl
blobc583933a83df0e491adcbb590beb744de53a3f09
1 #!/usr/bin/perl
3 &main;
5 # ======================================================================
7 sub main
9 open(INFILE, "<item_conversion.sql.template");
10 open(OUTFILE, ">item_conversion.sql");
11 print "Generating item_conversion.sql\n";
12 while ($line = <INFILE>)
14 print OUTFILE $line;
15 if ($line eq "-- ****** BEGIN ARMOR CONVERSION RULES ******\n")
17 &DoArmorConversion;
19 if ($line eq "-- ****** BEGIN ARMOR COMPONENT CONVERSION RULES ******\n")
21 &DoArmorComponentConversion;
23 if ($line eq "-- ****** BEGIN WEAPON CONVERSION RULES ******\n")
25 &DoWeaponConversion;
27 if ($line eq "-- ****** BEGIN POWERUP CONVERSION RULES ******\n")
29 &DoPowerupConversion;
31 if ($line eq "-- ****** BEGIN SABER CONVERSION RULES ******\n")
33 &DoSaberConversion;
35 if ($line eq "-- ****** BEGIN FOOD CONVERSION RULES ******\n")
37 &DoFoodConversion;
39 if ($line eq "-- ****** BEGIN MEDICINE CONVERSION RULES ******\n")
41 &DoMedicineConversion;
43 if ($line eq "-- ****** BEGIN SPICE CONVERSION RULES ******\n")
45 &DoSpiceConversion;
47 if ($line eq "-- ****** BEGIN TEMPLATE ID SET ******\n")
49 &DoTemplateIdSet;
52 close(OUTFILE);
53 close(INFILE);
56 sub DoArmorConversion
58 open(ARMOR, "armor_conversion.txt");
59 $if = "if";
60 <ARMOR>;
61 while ($line = <ARMOR>)
63 $line =~ s/\"|\n|\[|\]//g;
64 ($temp_id, $template, $script_add, $script_remove, $objvar_remove, $effective, $gen_protect,
65 $cond, $level, $category, $add_objvar,
66 $new_temp_id, $new_template, $craft_script, $schematic, $craft_objvar) =
67 split /\t/, $line;
69 if ($temp_id ne "")
71 print OUTFILE "\t\t\t\t--$template\n";
72 print OUTFILE "\t\t\t\t$if template_id = $temp_id then\n";
73 $if = "elsif";
74 print OUTFILE "\t\t\t\t\tif isSchematic = TRUE then\n";
75 print OUTFILE "\t\t\t\t\t\tInvalidateSchematic;\n";
76 print OUTFILE "\t\t\t\t\telse\n";
78 if ($effective ne "") {
79 print OUTFILE "\t\t\t\t\t\tSetGenProtection(rangeTableType(";
80 @eff = (split /,/,$effective);
81 @gnp = (split /,/,$gen_protect);
82 for ($i=0; $i < @eff-1; $i++) {
83 print OUTFILE "rangeType(".(split /:/,($eff[$i]))[0].",".(split /:/,($eff[$i]))[1].
84 ",".(split /:/,($gnp[$i]))[0].",".(split /:/,($gnp[$i]))[1]."),";
86 print OUTFILE "rangeType(".(split /:/,($eff[$i]))[0].",".(split /:/,($eff[$i]))[1].
87 ",".(split /:/,($gnp[$i]))[0].",".(split /:/,($gnp[$i]))[1]."))";
88 print OUTFILE ");\n";
91 print OUTFILE "\t\t\t\t\t\tDeleteOldArmorObjvars;\n";
92 print OUTFILE "\t\t\t\t\t\tDeleteObjVar('$_');\n"
93 foreach split /,/, $objvar_remove;
95 if (($cond ne "") && ($level ne "") && ($category ne "")) {
96 print OUTFILE "\t\t\t\t\t\tSetArmorCondLevelCat('$cond','$level','$category');\n";
98 else {
99 if ($cond ne "") {
100 print OUTFILE "\t\t\t\t\t\tAddObjVar('armor.condition',2,'$cond');\n";
102 if ($level ne "") {
103 print OUTFILE "\t\t\t\t\t\tSetArmorLevel('$level');\n";
105 if ($category ne "") {
106 print OUTFILE "\t\t\t\t\t\tSetArmorCategory('$category');\n";
110 print OUTFILE "\t\t\t\t\t\tRemoveScript('$_');\n"
111 foreach split /,/, $script_remove;
113 if ($craft_script ne "") {
114 print OUTFILE "\t\t\t\t\t\tif isFactory = TRUE then\n";
115 print OUTFILE "\t\t\t\t\t\t\tAddObjVar$_;\n"
116 foreach split /:/, $craft_objvar;
118 if ($schematic ne "") {
119 print OUTFILE "\t\t\t\t\t\t\tModifyObjVar('draftSchematic','draftSchematic',0,$schematic);\n";
122 print OUTFILE "\t\t\t\t\t\t\tAddScript('$_');\n"
123 foreach split /,/, $craft_script;
126 if (($new_temp_id ne "") || ($add_objvar ne "") || ($script_remove ne "") || ($script_add ne "")) {
127 print OUTFILE "\t\t\t\t\t\telse\n";
129 if ($new_temp_id ne "") {
130 print OUTFILE "\t\t\t\t\t\tSetNewTemplateId($new_temp_id);\t\t--$new_template\n";
133 print OUTFILE "\t\t\t\t\t\t\tAddObjVar$_;\n"
134 foreach split /:/, $add_objvar;
136 print OUTFILE "\t\t\t\t\t\t\tAddScript('$_');\n"
137 foreach split /,/, $script_add;
139 print OUTFILE "\t\t\t\t\t\tend if;\n";
141 else
143 if ($new_temp_id ne "") {
144 print OUTFILE "\t\t\t\t\tSetNewTemplateId($new_temp_id);\t\t--$new_template\n";
147 print OUTFILE "\t\t\t\t\t\tAddObjVar$_;\n"
148 foreach split /:/, $add_objvar;
150 print OUTFILE "\t\t\t\t\t\tAddScript('$_');\n"
151 foreach split /,/, $script_add;
153 print OUTFILE "\t\t\t\t\tend if;\n";
156 close(ARMOR);
159 sub DoArmorComponentConversion
161 open(COMPONENT, "armor_component_conversion.txt");
162 <COMPONENT>;
163 while ($line = <COMPONENT>)
165 $line =~ s/\"|\n|\[|\]//g;
166 ($temp_id, $template, $new_template, $new_temp_id, $script_remove, $script_add,
167 $objvar_remove, $gen_protect, $cond, $layer_value, $attrib_bonus, $crate_script, $schematic) =
168 split /\t/, $line;
170 print OUTFILE "\t\t\t\t--$template\n";
171 print OUTFILE "\t\t\t\telsif template_id = $temp_id then\n";
172 $if = "elsif";
173 print OUTFILE "\t\t\t\t\tif isSchematic = TRUE then\n";
174 print OUTFILE "\t\t\t\t\t\tInvalidateSchematic;\n";
175 print OUTFILE "\t\t\t\t\telse\n";
177 print OUTFILE "\t\t\t\t\t\tDeleteObjVar(prefix || '$_');\n"
178 foreach split /,/, $objvar_remove;
180 if (($gen_protect ne "") && ($cond ne "")) {
181 print OUTFILE "\t\t\t\t\t\tSetGpAndCond(prefix || 'general_protection', '$gen_protect', prefix || 'condition', '$cond');\n";
183 else {
184 if ($gen_protect ne "") {
185 print OUTFILE "\t\t\t\t\t\tAddObjVar(prefix || 'general_protection',2,'$gen_protect');\n";
187 if ($cond ne "") {
188 print OUTFILE "\t\t\t\t\t\tAddObjVar(prefix || 'condition',2,'$cond');\n";
191 if ($layer_value ne "") {
192 print OUTFILE "\t\t\t\t\t\tAddObjVar(prefix || 'armor_layer".(split /,/,$layer_value)[0]."',2,'".(split /,/,$layer_value)[1]."');\n";
195 if (($schematic ne "") || ($crate_script ne "")) {
196 print OUTFILE "\t\t\t\t\t\tif isFactory = TRUE then\n";
198 if ($schematic ne "") {
199 print OUTFILE "\t\t\t\t\t\t\tModifyObjVar('draftSchematic','draftSchematic',0,$schematic);\n";
202 if ($crate_script ne "") {
203 print OUTFILE "\t\t\t\t\t\t\tscript_list := '$crate_script' || ':';\n";
204 print OUTFILE "\t\t\t\t\t\t\tisObjModified := TRUE;\n";
207 if (($new_temp_id ne "") || ($attrib_bonus ne "") || ($script_remove ne "") || ($script_add ne "")) {
208 print OUTFILE "\t\t\t\t\t\telse\n";
209 if ($new_temp_id ne "") {
210 print OUTFILE "\t\t\t\t\t\t\tSetNewTemplateId($new_temp_id);\t\t--$new_template\n";
212 print OUTFILE "\t\t\t\t\t\t\tAddObjVar('attribute.bonus.".(split /:/,$_)[0]."',2,'".(split /:/,$_)[1]."');\n"
213 foreach split /,/, $attrib_bonus;
215 print OUTFILE "\t\t\t\t\t\t\tRemoveScript('$_');\n"
216 foreach split /,/, $script_remove;
218 print OUTFILE "\t\t\t\t\t\t\tAddScript('$_');\n"
219 foreach split /,/, $script_add;
222 print OUTFILE "\t\t\t\t\t\tend if;\n";
224 else {
225 if (($new_temp_id ne "") || ($attrib_bonus ne "") || ($script_remove ne "") || ($script_add ne "")) {
226 if ($new_temp_id ne "") {
227 print OUTFILE "\t\t\t\t\t\tSetNewTemplateId($new_temp_id);\t\t--$new_template\n";
229 print OUTFILE "\t\t\t\t\t\tAddObjVar('attribute.bonus.".(split /:/,$_)[0]."',2,'".(split /:/,$_)[1]."');\n"
230 foreach split /,/, $attrib_bonus;
232 print OUTFILE "\t\t\t\t\t\tRemoveScript('$_');\n"
233 foreach split /,/, $script_remove;
235 print OUTFILE "\t\t\t\t\t\tAddScript('$_');\n"
236 foreach split /,/, $script_add;
241 print OUTFILE "\t\t\t\t\tend if;\n";
243 close(COMPONENT);
246 sub DoWeaponConversion
248 open(WEAPON, "weapon_conversion.txt");
249 <WEAPON>;
250 while ($line = <WEAPON>)
252 $line =~ s/\"|\n|\[|\]//g;
253 ($temp_id, $template, $min_dmg_from, $min_dmg_to, $max_dmg_from, $max_dmg_to,
254 $speed_from, $speed_to, $wound_from, $wound_to,
255 $attack_cost, $accuracy,
256 $min_range_to, $max_range_to,
257 $damage_type, $ele_type, $ele_value, $add_objvar) =
258 split /\t/, $line;
260 if ($temp_id ne "") {
261 if ($line =~ m/component/)
263 print OUTFILE "\t\t\t\t--$template\n";
264 print OUTFILE "\t\t\t\telsif template_id = $temp_id then\n";
266 if (($min_dmg_from ne "") && ($min_dmg_to ne "")){
267 print OUTFILE "\t\t\t\t\tModifyObjVar(prefix || 'minDamage',prefix || 'minDamage',2,";
268 print OUTFILE "rangeTableType(";
269 @f = (split /,/,$min_dmg_from);
270 @t = (split /,/,$min_dmg_to);
271 for ($i=0; $i < @f-1; $i++) {
272 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
273 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
275 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
276 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
278 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
279 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
281 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
282 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."))";
283 print OUTFILE ");\n";
285 if (($max_dmg_from ne "") && ($max_dmg_to ne "")){
286 print OUTFILE "\t\t\t\t\tModifyObjVar(prefix || 'maxDamage',prefix || 'maxDamage',2,";
287 print OUTFILE "rangeTableType(";
288 @f = (split /,/,$max_dmg_from);
289 @t = (split /,/,$max_dmg_to);
290 for ($i=0; $i < @f-1; $i++) {
291 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
292 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
294 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
295 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
297 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
298 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
300 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
301 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."))";
302 print OUTFILE ");\n";
304 if ($speed_from ne "") {
305 print OUTFILE "\t\t\t\t\tModifyObjVar(prefix || 'attackSpeed',prefix || 'attackSpeed',2,";
306 print OUTFILE "rangeTableType(";
307 @f = (split /,/,$speed_from);
308 @t = (split /,/,$speed_to);
309 for ($i=0; $i < @f-1; $i++) {
310 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
311 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
313 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
314 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
316 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
317 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
319 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
320 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."))";
321 print OUTFILE ");\n";
323 if ($wound_from ne "") {
324 print OUTFILE "\t\t\t\t\tModifyObjVar(prefix || 'woundChance',prefix || 'woundChance',2,";
325 print OUTFILE "rangeTableType(";
326 @f = (split /,/,$wound_from);
327 @t = (split /,/,$wound_to);
328 for ($i=0; $i < @f-1; $i++) {
329 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
330 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
332 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
333 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
335 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
336 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
338 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
339 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."))";
340 print OUTFILE ");\n";
342 if (($attack_cost ne "") && ($accuracy ne "") && ($min_range_to ne "") && ($max_range_to ne "") &&($damage_type ne "")) {
343 print OUTFILE "\t\t\t\t\tSetWeaponBaseStats($attack_cost,$accuracy,$min_range_to,$max_range_to,$damage_type);\n";
345 else {
346 if ($attack_cost ne "") {
347 print OUTFILE "\t\t\t\t\tSetAttackCost($attack_cost);\n";
349 if ($accuracy ne "") {
350 print OUTFILE "\t\t\t\t\tSetAccuracy($accuracy);\n";
352 if ($min_range_to ne "") {
353 print OUTFILE "\t\t\t\t\tSetMinRange($min_range_to);\n";
355 if ($max_range_to ne "") {
356 print OUTFILE "\t\t\t\t\tSetMaxRange($max_range_to);\n";
358 if ($damage_type ne "") {
359 print OUTFILE "\t\t\t\t\tSetDamageType($damage_type);\n";
362 if ($ele_type ne "") {
363 print OUTFILE "\t\t\t\t\tSetElementalType($ele_type);\n";
365 if ($ele_value ne "") {
366 print OUTFILE "\t\t\t\t\tSetElementalValue($ele_value);\n";
368 print OUTFILE "\t\t\t\t\tAddObjVar$_;\n"
369 foreach split /:/, $add_objvar;
371 print OUTFILE "\t\t\t\t\tif isSchematic = TRUE or isFactory = TRUE then\n";
372 print OUTFILE "\t\t\t\t\t\tDeleteCraftingComponents;\n";
373 print OUTFILE "\t\t\t\t\tend if;\n";
375 else
377 print OUTFILE "\t\t\t\t--$template\n";
378 print OUTFILE "\t\t\t\telsif template_id = $temp_id then\n";
379 print OUTFILE "\t\t\t\t\tHandleWeaponDots;\n";
381 if ($min_dmg_from ne "") {
382 print OUTFILE "\t\t\t\t\tConvertMinDamage(";
383 print OUTFILE "rangeTableType(";
384 @f = (split /,/,$min_dmg_from);
385 @t = (split /,/,$min_dmg_to);
386 for ($i=0; $i < @f-1; $i++) {
387 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
388 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
390 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
391 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
393 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
394 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
396 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
397 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1].")));\n";
399 if ($max_dmg_from ne "") {
400 print OUTFILE "\t\t\t\t\tConvertMaxDamage(";
401 print OUTFILE "rangeTableType(";
402 @f = (split /,/,$max_dmg_from);
403 @t = (split /,/,$max_dmg_to);
404 for ($i=0; $i < @f-1; $i++) {
405 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
406 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
408 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
409 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
411 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
412 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
414 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
415 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1].")));\n";
417 if ($speed_from ne "") {
418 print OUTFILE "\t\t\t\t\tConvertAttackSpeed(";
419 print OUTFILE "rangeTableType(";
420 @f = (split /,/,$speed_from);
421 @t = (split /,/,$speed_to);
422 for ($i=0; $i < @f-1; $i++) {
423 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
424 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
426 print OUTFILE "rangeType(".((split /:/,($f[$i]))[0]*10).",".((split /:/,($f[$i]))[1]*10).
427 ",".((split /:/,($t[$i]))[0]*100).",".((split /:/,($t[$i]))[1]*100)."),";
429 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
430 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
432 print OUTFILE "rangeType(".((split /:/,($f[$i]))[0]*10).",".((split /:/,($f[$i]))[1]*10).
433 ",".((split /:/,($t[$i]))[0]*100).",".((split /:/,($t[$i]))[1]*100).")));\n";
435 if ($wound_from ne "") {
436 print OUTFILE "\t\t\t\t\tConvertWoundChance(";
437 print OUTFILE "rangeTableType(";
438 @f = (split /,/,$wound_from);
439 @t = (split /,/,$wound_to);
440 for ($i=0; $i < @f-1; $i++) {
441 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
442 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
444 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
445 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
447 if ( ((split /:/,($t[$i]))[0]) > ((split /:/,($t[$i]))[1]) ) {
448 print OUTFILE "\nCONVERSION DATA ERROR!!\n";
450 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
451 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1].")));\n";
454 if (($attack_cost ne "") && ($accuracy ne "") && ($min_range_to ne "") && ($max_range_to ne "") &&($damage_type ne "")) {
455 print OUTFILE "\t\t\t\t\tSetWeaponBaseStats($attack_cost,$accuracy,$min_range_to,$max_range_to,$damage_type);\n";
457 else {
458 if ($attack_cost ne "") {
459 print OUTFILE "\t\t\t\t\tSetAttackCost($attack_cost);\n";
461 if ($accuracy ne "") {
462 print OUTFILE "\t\t\t\t\tSetAccuracy($accuracy);\n";
464 if ($min_range_to ne "") {
465 print OUTFILE "\t\t\t\t\tSetMinRange($min_range_to);\n";
467 if ($max_range_to ne "") {
468 print OUTFILE "\t\t\t\t\tSetMaxRange($max_range_to);\n";
470 if ($damage_type ne "") {
471 print OUTFILE "\t\t\t\t\tSetDamageType($damage_type);\n";
474 if ($ele_type ne "") {
475 print OUTFILE "\t\t\t\t\tSetElementalType($ele_type);\n";
477 if ($ele_value ne "") {
478 print OUTFILE "\t\t\t\t\tSetElementalValue($ele_value);\n";
480 print OUTFILE "\t\t\t\t\tAddObjVar$_;\n"
481 foreach split /:/, $add_objvar;
483 if ($temp_id == -1930572145) {
484 print OUTFILE "\t\t\t\t\tif isSchematic = TRUE or isFactory = TRUE then\n";
485 print OUTFILE "\t\t\t\t\t\tDeleteCraftingComponents;\n";
486 print OUTFILE "\t\t\t\t\t\tif isSchematic = TRUE then\n";
487 print OUTFILE "\t\t\t\t\t\t\tDeleteObjVar('crafting_attributes.crafting:*');\n";
488 print OUTFILE "\t\t\t\t\t\t\tnew_schematic_id := -847903116;\n";
489 print OUTFILE "\t\t\t\t\t\telse\n";
490 print OUTFILE "\t\t\t\t\t\t\tModifyObjVar('draftSchematic','draftSchematic',0,-847903116);\n";
491 print OUTFILE "\t\t\t\t\t\tend if;\n";
492 print OUTFILE "\t\t\t\t\t\tSetTemplateText(-1631144444);\n";
493 print OUTFILE "\t\t\t\t\telse\n";
494 print OUTFILE "\t\t\t\t\t\tSetNewTemplateId(-1631144444); --convert to heavy bowcaster\n";
495 print OUTFILE "\t\t\t\t\t\tAddScript('systems.combat.combat_weapon');\n";
496 print OUTFILE "\t\t\t\t\tend if;\n";
498 elsif ($temp_id == -2138350593) {
499 print OUTFILE "\t\t\t\t\tif isSchematic = TRUE or isFactory = TRUE then\n";
500 print OUTFILE "\t\t\t\t\t\tDeleteCraftingComponents;\n";
501 print OUTFILE "\t\t\t\t\t\tif isSchematic = TRUE then\n";
502 print OUTFILE "\t\t\t\t\t\t\tDeleteObjVar('crafting_attributes.crafting:*');\n";
503 print OUTFILE "\t\t\t\t\t\t\tnew_schematic_id := -1108671633;\n";
504 print OUTFILE "\t\t\t\t\t\telse\n";
505 print OUTFILE "\t\t\t\t\t\t\tModifyObjVar('draftSchematic','draftSchematic',0,-1108671633);\n";
506 print OUTFILE "\t\t\t\t\t\tend if;\n";
507 print OUTFILE "\t\t\t\t\t\tSetTemplateText(-746051337);\n";
508 print OUTFILE "\t\t\t\t\telse\n";
509 print OUTFILE "\t\t\t\t\t\tSetNewTemplateId(-746051337); --convert to E11 Mark II\n";
510 print OUTFILE "\t\t\t\t\t\tAddScript('systems.combat.combat_weapon');\n";
511 print OUTFILE "\t\t\t\t\tend if;\n";
513 else {
514 print OUTFILE "\t\t\t\t\tif isSchematic = TRUE or isFactory = TRUE then\n";
515 print OUTFILE "\t\t\t\t\t\tDeleteCraftingComponents;\n";
516 print OUTFILE "\t\t\t\t\t\tif isSchematic = TRUE then\n";
517 print OUTFILE "\t\t\t\t\t\t\tDeleteObjVar('crafting_attributes.crafting:*');\n";
518 print OUTFILE "\t\t\t\t\t\tend if;\n";
519 print OUTFILE "\t\t\t\t\telse\n";
520 print OUTFILE "\t\t\t\t\t\tAddScript('systems.combat.combat_weapon');\n";
521 print OUTFILE "\t\t\t\t\tend if;\n";
526 close(WEAPON);
529 sub DoPowerupConversion
531 open(POWERUP, "powerup_conversion.txt");
532 <POWERUP>;
533 while ($line = <POWERUP>)
535 $line =~ s/\"|\n|\[|\]//g;
536 ($temp_id, $template, $conversion) =
537 split /\t/, $line;
538 if ($conversion ne "")
540 print OUTFILE "\t\t\t\t--$template\n";
541 print OUTFILE "\t\t\t\telsif template_id = $temp_id then\n";
542 print OUTFILE "\t\t\t\t\t$conversion;\n";
545 close(POWERUP);
548 sub DoSaberConversion
550 open(SABER, "saber_conversion.txt");
551 <SABER>;
552 while ($line = <SABER>)
554 $line =~ s/\"|\n|\[|\]//g;
555 ($temp_id, $template, $min_dmg_from, $min_dmg_to, $max_dmg_from, $max_dmg_to,
556 $speed_from, $speed_to, $wound_from, $wound_to,
557 $attack_cost, $accuracy,
558 $min_range_to, $max_range_to,
559 $damage_type, $ele_type, $ele_value, $force) =
560 split /\t/, $line;
562 if ($line =~ m/object\/tangible\/component/)
564 print OUTFILE "\t\t\t\t--$template\n";
565 print OUTFILE "\t\t\t\telsif template_id = $temp_id then\n";
566 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.crystal.stats.mid_rng');\n";
567 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.crystal.stats.zero_mod');\n";
568 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.crystal.stats.min_mod');\n";
569 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.crystal.stats.mid_mod');\n";
570 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.crystal.stats.max_mod');\n";
571 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.crystal.stats.action');\n";
572 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.crystal.stats.health');\n";
573 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.crystal.stats.mind');\n";
575 print OUTFILE "\t\t\t\t\tif not(slot_map.exists('jedi.crystal.stats.color')) and slot_map.exists('jedi.crystal.owner.name') then\n";
577 if ($min_dmg_from ne "") {
578 print OUTFILE "\t\t\t\t\t\tn := ConvertValue(to_number(nvl(GetObjVarValue('jedi.crystal.stats.min_dmg'),0)),";
579 print OUTFILE "rangeTableType(";
580 @f = (split /,/,$min_dmg_from);
581 @t = (split /,/,$min_dmg_to);
582 for ($i=0; $i < @f-1; $i++) {
583 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
584 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
586 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
587 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1].")));\n";
588 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.min_dmg', 0, n);\n";
591 if ($max_dmg_from ne "") {
592 print OUTFILE "\t\t\t\t\t\tn := ConvertValue(to_number(nvl(GetObjVarValue('jedi.crystal.stats.max_dmg'),0)),";
593 print OUTFILE "rangeTableType(";
594 @f = (split /,/,$max_dmg_from);
595 @t = (split /,/,$max_dmg_to);
596 for ($i=0; $i < @f-1; $i++) {
597 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
598 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
600 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
601 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1].")));\n";
602 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.max_dmg', 0, n);\n";
605 if ($speed_from ne "") {
606 print OUTFILE "\t\t\t\t\t\tn := ConvertValue(to_number(nvl(GetObjVarValue('jedi.crystal.stats.speed'),100)),";
607 print OUTFILE "rangeTableType(";
608 @f = (split /,/,$speed_from);
609 @t = (split /,/,$speed_to);
610 for ($i=0; $i < @f-1; $i++) {
611 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
612 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
614 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
615 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1].")));\n";
616 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.speed', 2, n);\n";
619 if ($wound_from ne "") {
620 print OUTFILE "\t\t\t\t\t\tn := ConvertValue(to_number(nvl(GetObjVarValue('jedi.crystal.stats.wound'),0)),";
621 print OUTFILE "rangeTableType(";
622 @f = (split /,/,$wound_from);
623 @t = (split /,/,$wound_to);
624 for ($i=0; $i < @f-1; $i++) {
625 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
626 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
628 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
629 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1].")));\n";
630 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.wound', 2, n);\n";
633 if ($attack_cost ne "") {
634 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.attack_cost', 2, $attack_cost);\n";
636 if ($force ne "") {
637 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.force', 2, $force);\n";
639 if ($accuracy ne "") {
640 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.accuracy', 2, $accuracy);\n";
642 if ($min_range_to ne "") {
643 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.min_rng', 2, $min_range_to);\n";
645 if ($max_range_to ne "") {
646 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.max_rng', 2, $max_range_to);\n";
648 if ($damage_type ne "") {
649 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.damage_type', 0, $damage_type);\n";
651 if ($ele_type ne "") {
652 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.elemental_type', 0, $ele_type);\n";
654 if ($ele_value ne "") {
655 print OUTFILE "\t\t\t\t\t\tAddObjVar ('jedi.crystal.stats.elemental_value', 0, $ele_value);\n";
657 print OUTFILE "\t\t\t\t\tend if;\n";
659 else
661 print OUTFILE "\t\t\t\t--$template\n";
662 print OUTFILE "\t\t\t\telsif template_id = $temp_id then\n";
663 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.saber.base_stats.mid_rng');\n";
664 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.saber.base_stats.zero_mod');\n";
665 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.saber.base_stats.min_mod');\n";
666 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.saber.base_stats.mid_mod');\n";
667 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.saber.base_stats.max_mod');\n";
668 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.saber.base_stats.action');\n";
669 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.saber.base_stats.health');\n";
670 print OUTFILE "\t\t\t\t\tDeleteObjVar('jedi.saber.base_stats.mind');\n";
672 if ($min_dmg_from ne "") {
673 print OUTFILE "\t\t\t\t\tn := ConvertValue(to_number(nvl(GetObjVarValue('jedi.saber.base_stats.min_dmg'),0)),";
674 print OUTFILE "rangeTableType(";
675 @f = (split /,/,$min_dmg_from);
676 @t = (split /,/,$min_dmg_to);
677 for ($i=0; $i < @f-1; $i++) {
678 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
679 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
681 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
682 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1].")));\n";
683 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.min_dmg', 0, n);\n";
684 print OUTFILE "\t\t\t\t\tweapon_attribs.min_damage := n;\n";
687 if ($max_dmg_from ne "") {
688 print OUTFILE "\t\t\t\t\tn := ConvertValue(to_number(nvl(GetObjVarValue('jedi.saber.base_stats.max_dmg'),0)),";
689 print OUTFILE "rangeTableType(";
690 @f = (split /,/,$max_dmg_from);
691 @t = (split /,/,$max_dmg_to);
692 for ($i=0; $i < @f-1; $i++) {
693 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
694 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
696 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
697 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1].")));\n";
698 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.max_dmg', 0, n);\n";
699 print OUTFILE "\t\t\t\t\tweapon_attribs.max_damage := n;\n";
702 if ($speed_from ne "") {
703 print OUTFILE "\t\t\t\t\tn := ConvertValue(to_number(nvl(GetObjVarValue('jedi.saber.base_stats.speed'),100)),";
704 print OUTFILE "rangeTableType(";
705 @f = (split /,/,$speed_from);
706 @t = (split /,/,$speed_to);
707 for ($i=0; $i < @f-1; $i++) {
708 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
709 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
711 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
712 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1].")));\n";
713 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.speed', 2, n);\n";
714 print OUTFILE "\t\t\t\t\tweapon_attribs.attack_speed := n;\n";
717 if ($wound_from ne "") {
718 print OUTFILE "\t\t\t\t\tn := ConvertValue(to_number(nvl(GetObjVarValue('jedi.saber.base_stats.wound'),0)),";
719 print OUTFILE "rangeTableType(";
720 @f = (split /,/,$wound_from);
721 @t = (split /,/,$wound_to);
722 for ($i=0; $i < @f-1; $i++) {
723 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
724 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1]."),";
726 print OUTFILE "rangeType(".(split /:/,($f[$i]))[0].",".(split /:/,($f[$i]))[1].
727 ",".(split /:/,($t[$i]))[0].",".(split /:/,($t[$i]))[1].")));\n";
728 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.wound', 2, n);\n";
729 print OUTFILE "\t\t\t\t\tweapon_attribs.wound_chance := n;\n";
732 if ($attack_cost ne "") {
733 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.attack_cost', 2, $attack_cost);\n";
734 print OUTFILE "\t\t\t\t\tweapon_attribs.attack_cost := $attack_cost;\n";
736 if ($force ne "") {
737 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.force', 2, $force);\n";
738 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.force', 2, $force);\n";
740 if ($accuracy ne "") {
741 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.accuracy', 2, $accuracy);\n";
742 print OUTFILE "\t\t\t\t\tweapon_attribs.accuracy := $accuracy;\n";
744 if ($min_range_to ne "") {
745 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.min_rng', 2, $min_range_to);\n";
746 print OUTFILE "\t\t\t\t\tweapon_attribs.min_range := $min_range_to;\n";
748 if ($max_range_to ne "") {
749 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.max_rng', 2, $max_range_to);\n";
750 print OUTFILE "\t\t\t\t\tweapon_attribs.max_range := $max_range_to;\n";
752 if ($damage_type ne "") {
753 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.damage_type', 0, $damage_type);\n";
754 print OUTFILE "\t\t\t\t\tweapon_attribs.damage_type := $damage_type;\n";
756 if ($ele_type ne "") {
757 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.elemental_type', 0, $ele_type);\n";
758 print OUTFILE "\t\t\t\t\tweapon_attribs.elemental_type := $ele_type;\n";
760 if ($ele_value ne "") {
761 print OUTFILE "\t\t\t\t\tAddObjVar ('jedi.saber.base_stats.elemental_value', 0, $ele_value);\n";
762 print OUTFILE "\t\t\t\t\tweapon_attribs.elemental_value := $ele_value;\n";
764 print OUTFILE "\t\t\t\t\tAddScript('systems.combat.combat_weapon');\n";
768 close(SABER);
771 sub DoFoodConversion
773 open(FOOD, "food_conversion.txt");
774 <FOOD>;
775 while ($line = <FOOD>)
777 $line =~ s/\"|\n|\[|\]//g;
778 ($temp_id, $template, $buff_name, $eff_objvar, $effectiveness, $dur_objvar, $duration,
779 $objvar_remove, $script_remove, $script_add) =
780 split /\t/, $line;
781 if ($effectiveness ne "")
783 print OUTFILE "\t\t\t\t--$template\n";
784 print OUTFILE "\t\t\t\telsif template_id = $temp_id then\n";
785 print OUTFILE "\t\t\t\t\tif isSchematic = TRUE then\n";
786 print OUTFILE "\t\t\t\t\t\tHandleFoodSchematic;\n";
787 print OUTFILE "\t\t\t\t\telsif isFactory = TRUE then\n";
788 print OUTFILE "\t\t\t\t\t\tHandleFoodCrate;\n";
789 print OUTFILE "\t\t\t\t\telse\n";
791 if ($buff_name ne "") {
792 print OUTFILE "\t\t\t\t\t\tAddObjVar('buff_name',4,'$buff_name');\n";
795 if ($eff_objvar ne "") {
796 print OUTFILE "\t\t\t\t\t\tif slot_map.exists('$eff_objvar') then\n";
797 print OUTFILE "\t\t\t\t\t\t\tModifyObjVar('$eff_objvar','effectiveness',2,rangeTableType(rangeType(0,".($effectiveness*2).",0.0,2.0)));\n";
798 print OUTFILE "\t\t\t\t\t\telse\n";
799 print OUTFILE "\t\t\t\t\t\t\tAddObjVar('effectiveness',2,'0.98');\n";
800 print OUTFILE "\t\t\t\t\t\tend if;\n";
802 elsif ($effectiveness ne "") {
803 print OUTFILE "\t\t\t\t\t\tAddObjVar('effectiveness',2,'$effectiveness');\n";
806 if ($dur_objvar ne "") {
807 print OUTFILE "\t\t\t\t\t\tif slot_map.exists('$dur_objvar') then\n";
808 print OUTFILE "\t\t\t\t\t\t\tModifyObjVar('$dur_objvar','duration',2,rangeTableType(rangeType(0,".($duration*2).",0.0,2.0)));\n";
809 print OUTFILE "\t\t\t\t\t\telse\n";
810 print OUTFILE "\t\t\t\t\t\t\tAddObjVar('duration',2,'0.9');\n";
811 print OUTFILE "\t\t\t\t\t\tend if;\n";
813 elsif ($duration ne "") {
814 print OUTFILE "\t\t\t\t\t\tAddObjVar('duration',2,'$duration');\n";
817 print OUTFILE "\t\t\t\t\t\tDeleteObjVar('$_');\n"
818 foreach split /,/, $objvar_remove;
820 print OUTFILE "\t\t\t\t\t\tRemoveScript('$_');\n"
821 foreach split /,/, $script_remove;
823 print OUTFILE "\t\t\t\t\t\tAddScript('$_');\n"
824 foreach split /,/, $script_add;
826 print OUTFILE "\t\t\t\t\t\tRenameObjVar('consumable.stomachValues','filling');\n";
827 print OUTFILE "\t\t\t\t\tend if;\n";
830 close(FOOD);
833 sub DoMedicineConversion
835 open(MEDS, "medicine_conversion.txt");
836 <MEDS>;
837 while ($line = <MEDS>)
839 $line =~ s/\"|\n|\[|\]//g;
840 ($temp_id, $template, $stim_pack) =
841 split /\t/, $line;
842 if ($stim_pack ne "")
844 print OUTFILE "\t\t\t\t--$template\n";
845 print OUTFILE "\t\t\t\telsif template_id = $temp_id then\n";
846 print OUTFILE "\t\t\t\t\t$stim_pack;\n";
849 close(MEDS);
852 sub DoSpiceConversion
854 open(SPICE, "spice_conversion.txt");
855 <SPICE>;
856 while ($line = <SPICE>)
858 $line =~ s/\"|\n|\[|\]//g;
859 ($temp_id, $template, $spice_name) =
860 split /\t/, $line;
861 if ($spice_name ne "")
863 print OUTFILE "\t\t\t\t--$template\n";
864 print OUTFILE "\t\t\t\telsif template_id = $temp_id then\n";
865 print OUTFILE "\t\t\t\t\tConvertSpice('$spice_name');\n";
868 close(SPICE);
871 sub DoTemplateIdSet
873 open(ARMOR, "armor_conversion.txt");
874 <ARMOR>;
875 while ($line = <ARMOR>)
877 $line =~ s/\"|\n|\[|\]//g;
878 ($temp_id, $template, $script_add, $objvar_remove, $effective, $gen_protect,
879 $encumb, $encumb_split, $cond, $level, $category, $special, $layer) =
880 split /\t/, $line;
881 if ($temp_id ne "")
883 print OUTFILE "\t\ttemplateIdSet($temp_id) := $temp_id;\n";
886 close(ARMOR);
888 open(COMPONENT, "armor_component_conversion.txt");
889 <COMPONENT>;
890 while ($line = <COMPONENT>)
892 $line =~ s/\"|\n|\[|\]//g;
893 ($temp_id, $template, $new_template, $new_temp_id, $script_remove, $script_add,
894 $objvar_remove, $gen_protect, $encumb, $cond, $layer_value, $attrib_bonus, $cnt) =
895 split /\t/, $line;
896 if ($temp_id ne "")
898 print OUTFILE "\t\ttemplateIdSet($temp_id) := $temp_id;\n";
901 close(COMPONENT);
903 open(WEAPON, "weapon_conversion.txt");
904 <WEAPON>;
905 while ($line = <WEAPON>)
907 $line =~ s/\"|\n|\[|\]//g;
908 ($temp_id, $template, $min_dmg_from, $min_dmg_to, $max_dmg_from, $max_dmg_to,
909 $speed_from, $speed_to, $wound_from, $wound_to,
910 $attack_cost, $accuracy,
911 $min_range_to, $max_range_to,
912 $damage_type, $ele_type, $ele_value) =
913 split /\t/, $line;
915 if ($temp_id ne "")
917 print OUTFILE "\t\ttemplateIdSet($temp_id) := $temp_id;\n";
920 close(WEAPON);
922 open(POWERUP, "powerup_conversion.txt");
923 <POWERUP>;
924 while ($line = <POWERUP>)
926 $line =~ s/\"|\n|\[|\]//g;
927 ($temp_id, $template, $conversion) =
928 split /\t/, $line;
929 if ($conversion ne "")
931 print OUTFILE "\t\ttemplateIdSet($temp_id) := $temp_id;\n";
934 close(POWERUP);
936 open(SABER, "saber_conversion.txt");
937 <SABER>;
938 while ($line = <SABER>)
940 $line =~ s/\"|\n|\[|\]//g;
941 ($temp_id, $template, $min_dmg_from, $min_dmg_to, $max_dmg_from, $max_dmg_to,
942 $speed_from, $speed_to, $wound_from, $wound_to,
943 $attack_cost, $accuracy,
944 $min_range_to, $max_range_to,
945 $damage_type, $ele_type, $ele_value, $force) =
946 split /\t/, $line;
947 print OUTFILE "\t\ttemplateIdSet($temp_id) := $temp_id;\n";
949 close(SABER);
951 open(FOOD, "food_conversion.txt");
952 <FOOD>;
953 while ($line = <FOOD>)
955 $line =~ s/\"|\n|\[|\]//g;
956 ($temp_id, $template, $buff_name, $eff_objvar, $effectiveness, $dur_objvar, $duration,
957 $objvar_remove, $script_remove, $script_add) =
958 split /\t/, $line;
959 if ($effectiveness ne "")
961 print OUTFILE "\t\ttemplateIdSet($temp_id) := $temp_id;\n";
964 close(FOOD);
966 open(MEDS, "medicine_conversion.txt");
967 <MEDS>;
968 while ($line = <MEDS>)
970 $line =~ s/\"|\n|\[|\]//g;
971 ($temp_id, $template, $stim_pack) =
972 split /\t/, $line;
973 if ($stim_pack ne "")
975 print OUTFILE "\t\ttemplateIdSet($temp_id) := $temp_id;\n";
978 close(MEDS);
980 open(SPICE, "spice_conversion.txt");
981 <SPICE>;
982 while ($line = <SPICE>)
984 $line =~ s/\"|\n|\[|\]//g;
985 ($temp_id, $template, $spice_name) =
986 split /\t/, $line;
987 if ($spice_name ne "")
989 print OUTFILE "\t\ttemplateIdSet($temp_id) := $temp_id;\n";
992 close(SPICE);