ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/arch/dev/scripts/update_armor.pl
Revision: 1.1
Committed: Mon Feb 6 20:26:11 2006 UTC (18 years, 5 months ago) by root
Content type: text/plain
Branch point for: UPSTREAM, MAIN
Log Message:
Initial revision

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 (/^last_heal (.*)$/) {
23 $body_info="gen_sp_armour $1";
24 next;
25 }
26 print OUT $in;
27 }
28 close(OUT);
29 close(IN);
30 unlink("$ARGV[$i].bak");
31 }