-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathone.pl
38 lines (31 loc) · 888 Bytes
/
one.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
## internal, executed every "one minute" player is online
# print "pop=one minute\n";
## check all items in inventory for anything that expires
$inv='';
for ($i=0; $i<$NumInven;$i++) {
#$invstamp=substr($player{'inven'},($i*10)+2,8);
$estamp=sprintf("%d", hex(substr($player{'inven'},($i*10)+2,8)));
$invitem=substr($player{'inven'},$i*10,2);
if ($estamp && $cstamp>$estamp) {
print "pop=^$invitem expired\n";
substr($player{'inven'},$i*10,10)="Za00000000";
if ($player{'inven'}=~/$invitem/) {} else {
$form{'j'}=$invitem;
do "remove.pl";
}
$inv.='Za';
}else{
$inv.=$invitem;
}
}
print "inv=$inv\n";
## reduce health
$player{'h'}=$player{'h'}-1;
print "h=$player{'h'}\n";
## ultimately move this to the main 11-dragon.cgi script
if ($player{'h'}<1) {
print "pop=You have died\n";
$player{'h'}=60;
}
$player{'one'}=$cstamp+60;
1;