forked from Quasic/DragonBasher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
drop.pl
29 lines (26 loc) · 958 Bytes
/
drop.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
# external, drops object on ground
$version="1.0";
($slot, $item)=split(/-/, $form{'j'});
$invitem=substr($player{'inven'},$slot*10,2);
$invstamp=substr($player{'inven'},($slot*10)+2,8);
if ($invitem eq $item) {
$filestamp=glob "$datadir/dynamic/$player{'tmap'}/????????????$player{'z'}.txt";
if (!$filestamp) {
if (!-d "$datadir/dynamic/$player{'tmap'}") { mkdir "$datadir/dynamic/$player{'tmap'}"; }
if (!-w "$datadir/dynamic/$player{'tmap'}") { chmod 0777, "$datadir/dynamic/$player{'tmap'}" }
open (FILE,">$datadir/dynamic/$player{'tmap'}/$item $invstamp $player{'tz'}.txt");
print FILE "$player{'name'}";
close FILE;
substr($player{'inven'},$slot*10,10)="Za00000000";
do 'inv.pl';#print "inv=$player{'inven'}\n";
if ($player{'inven'}=~/$item/) {
print "dinv=\n";
} else {
$form{'j'}=$item;
do "remove.pl";
}
}
}
# do "token.pl"; ## do we need this here now??
$form{'c'}="refresh";
1;