-
Notifications
You must be signed in to change notification settings - Fork 1
/
fire.pl
52 lines (48 loc) · 1.73 KB
/
fire.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# internal, returns $fire if there is fire avaialbe
if (!-d "$datadir/dynamic/$player{'tmap'}") { mkdir "$datadir/dynamic/$player{'tmap'}"; }
if (!-w "$datadir/dynamic/$player{'tmap'}") { chmod 0777, "$datadir/dynamic/$player{'tmap'}" }
$filestamp=glob "$datadir/dynamic/$player{'tmap'}/Zj??????????$player{'tz'}.txt";
if ($filestamp) { $fire=1; } else { $fire=0; }
if (!$fire) {
if ($player{'inven'}=~/Zj/) {
# drop fire
$s=substr($player{'inven'},index($player{'inven'}, "Zj")+2,8);
open (FILE,">$datadir/dynamic/$player{'tmap'}/Zj $s $player{'tz'}.txt");
print FILE "$player{'name'}";
close FILE;
substr($player{'inven'},index($player{'inven'},"Zj"),10)="Za00000000";
do 'inv.pl';
$fire=1;
} else {
if ($player{'inven'}=~/Dj/) {
$new="Zj"; do "newstamp.pl";
open (FILE,">$datadir/dynamic/$player{'tmap'}/Zj $e $player{'tz'}.txt");
print FILE "$player{'name'}";
close FILE;
substr($player{'inven'},index($player{'inven'},"Dj"),10)="Za00000000";
do 'inv.pl';
$fire=1;
} else {
if ($player{'inven'}=~/Dk/) {
$new="Zj"; do "newstamp.pl";
open (FILE,">$datadir/dynamic/$player{'tmap'}/Zj $e $player{'tz'}.txt");
print FILE "$player{'name'}";
close FILE;
substr($player{'inven'},index($player{'inven'},"Dk"),2)="Dj";
do 'inv.pl';
$fire=1;
} else {
if ($player{'inven'}=~/Dl/) {
$new="Zj"; do "newstamp.pl";
open (FILE,">$datadir/dynamic/$player{'tmap'}/Zj $e $player{'tz'}.txt");
print FILE "$player{'name'}";
close FILE;
substr($player{'inven'},index($player{'inven'},"Dl"),2)="Dk";
do 'inv.pl';
$fire=1;
}
}
}
}
}
1;