-
Notifications
You must be signed in to change notification settings - Fork 1
/
static-Zg.pl
71 lines (61 loc) · 1.6 KB
/
static-Zg.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# external, execute pier
if (form{'k'}!~/^[A-Z][a-z]$/) {
form.k='';
print "pop=Bad Bait!\n";
}
## fish that require net or pole to catch
$net="GaGd";
$pole="Ge";
if ($player{'inven'}=~/Za/) {
open (FILE,"$datadir/static/$player{'tmap'}/Zg 00000000 $player{'tz'}.txt");
$fish=<FILE>;
close FILE;
chomp ($fish);
$odds=0;
if ($net=~$fish) {
if ($player{'inven'}=~/Bj/) {
if ($fish eq "Ga") { $odds=10; $bait=""; } # minnow
if ($fish eq "Gd") { $odds=10; $bait="GaGd"; } # crab
} else {
print "pop=Need Net\n";
}
} else {
if ($pole=~$fish) {
if ($player{'inven'}=~/Bk/) {
if ($fish eq "Ge") { $odds=10; $bait="GaGd"; } # carp
} else {
print "pop=Need Pole\n";
}
}
}
if ($bait) {
if ($player{'inven'}=~/$form{'k'}/) {
if ($bait=~/$form{'k'}/) {
if (int(rand(100))<$odds) {
$f=index($player{'inven'}, "$form{'k'}");
$player{'inven'}=substr($player{'inven'},0,$f)."Za00000000".substr($player{'inven'},$f+10);
do 'inv.pl'; print "pop=Lost Bait!\n";
}
} else {
$odds=0; print "pop=Need Bait\n";
}
} else {
$odds=0; print "pop=Need Bait\n";
}
}
if ($odds) {
# catch fish
if (int(rand(100))<$odds) {
$new=$fish; do "newstamp.pl";
$f=index($player{'inven'}, "Za");
$player{'inven'}=substr($player{'inven'},0,$f).$fish.$e.substr($player{'inven'},$f+10);
do 'inv.pl';
print "pop=You catch a Fish! $a\n";
} else {
print "pop=Nothing$a\n";
}
}
} else {
print "pop=Full Inventory\n";
}
1;