ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/utils/add_throw.perl.in
Revision: 1.1
Committed: Fri Feb 3 07:14:46 2006 UTC (18 years, 3 months ago) by root
Branch: MAIN
Branch point for: UPSTREAM
Log Message:
Initial revision

File Contents

# User Rev Content
1 root 1.1 #!@PERL@
2     # Adds the throwing skill to to the old player files. This script
3     # is likely no longer needed, since skills have been around for quite a while.
4     #
5    
6     $end = 0;
7     if (!-e $ARGV[0]) {
8     die("Can not find file $ARGV[0]\n");
9     }
10     if (-e $ARGV[0].".old") {
11     die("$ARGV[0].new already exists.\n");
12     }
13     rename($ARGV[0], $ARGV[0].".old");
14     open(PLAYER,"<".$ARGV[0].".old") || die("can not open $ARGV[0].old");
15     open(PL_NEW,">".$ARGV[0]) || die("can not open $ARGV[0]");
16    
17     while (<PLAYER>) {
18     if (/^end$/) {
19     if ($end) {
20     print PL_NEW "arch skill_throwing\nend\nend\n";
21     }
22     else {print PL_NEW $_;}
23     $end=1;
24     }
25     else {
26     print PL_NEW $_;
27     $end=0;
28     }
29     }
30     close(PLAYER);
31     close(PL_NEW);