ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/arch/dev/scripts/update_body.pl
Revision: 1.1.1.1 (vendor branch)
Committed: Mon Feb 6 20:26:11 2006 UTC (18 years, 4 months ago) by root
Content type: text/plain
Branch: UPSTREAM, MAIN
CVS Tags: pre_first_cfarch_normalize_run, pre_second_normalise_run, post_second_normalise_run, post_normalise_revert, rel-2_82, rel-2_81, rel-2_80, UPSTREAM_2006_03_15, rel-3_0, rel-2_6, rel-2_7, rel-2_4, rel-2_5, rel-2_2, rel-2_0, rel-2_1, rel-2_72, rel-2_73, rel-2_71, rel-2_76, rel-2_77, rel-2_74, rel-2_75, rel-2_54, rel-2_55, rel-2_56, rel-2_79, UPSTREAM_2006_02_01, rel-2_53, rel-2_32, post_first_cfarch_normalize_run, UPSTREAM_2006_02_22, rel-2_90, rel-2_92, rel-2_93, rel-2_78, rel-2_61, pre_normalise_revert, rel-2_43, rel-2_42, rel-2_41, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
Initial Import

File Contents

# Content
1 #!/usr/bin/perl
2
3 for ($i=0; $i<=$#ARGV; $i++) {
4 if (!rename("$ARGV[$i]", "$ARGV[$i].bak")) {
5 print STDERR "Unable to rename file $ARGV[$i]\n";
6 next;
7 }
8 open(IN,"<$ARGV[$i].bak");
9 open(OUT,">$ARGV[$i]");
10 while (<IN>) {
11 $in = $_;
12 if (/^end\s*$/) {
13 if ($body_info ne "" ) {
14 print OUT "$body_info\n";
15 print "Added $body_info to $ARGV[$i]\n";
16 }
17 $body_info="";
18 }
19 if (/^Object (.*)$/) {
20 $body_info="";
21 }
22 if (/^type (.*)$/) {
23 $body_info="body_skill -1" if ($1 == 43); # misc skill
24 $body_info="body_range -1" if ($1 == 3); # rod
25 $body_info="body_arm -2" if ($1 == 14); # bow
26 $body_info="body_arm -1" if ($1 == 15); # weapon
27 $body_info="body_torso -1" if ($1 == 16); # armor
28 $body_info="body_arm -1" if ($1 == 33); # shield
29 $body_info="body_head -1" if ($1 == 34); # helmet
30 $body_info="body_range -1" if ($1 == 35); # horn
31 $body_info="body_neck -1" if ($1 == 39); # amulet
32 $body_info="body_finger -1" if ($1 == 70); # ring
33 $body_info="body_shoulder -1" if ($1 == 87); # cloak
34 $body_info="body_foot -2" if ($1 == 99); # cloak
35 $body_info="body_hand -2" if ($1 == 100); # gloves
36 $body_info="body_wrist -2" if ($1 == 104); # bracers
37 $body_info="body_range -1" if ($1 == 109); # wand
38 $body_info="body_waist -1" if ($1 == 113); # girdle
39 }
40 print OUT $in;
41 }
42 close(OUT);
43 close(IN);
44 unlink("$ARGV[$i].bak");
45 }