// Evol scripts.
// Authors:
// Hal9000 (Francesco Miglietta), 4144, Reid
// Description:
// An opening treasure chest.
// Variable:
// ShipQuests_TreasureChest
// Values:
// 0: Not opened.
// 1: Opened.
000-1.gat,58,31,0 script Chest#1 316;2,{
set @q, geta(ShipQuests, ShipQuests_TreasureChest);
if (getnpcdir ("") == 4) goto l_Give;
setnpcdir 2;
initnpctimer;
startnpctimer;
close;
l_Give:
if (@q > 0) goto l_Close;
seta ShipQuests, ShipQuests_TreasureChest, 1;
set zeny, zeny + 400;
getitem 508, 1;
getitem 509, 1;
getitem 514, 1;
message strcharinfo(0), l("You opened the treasure chest.");
close;
l_Close:
setnpcdir 6;
initnpctimer;
startnpctimer;
close;
OnTimer160:
stopnpctimer;
if (getnpcdir ("") == 2) setnpcdir 4;
if (getnpcdir ("") == 6) setnpcdir 0;
end;
}