summaryrefslogtreecommitdiff
path: root/npc/000-1/chest.txt
diff options
context:
space:
mode:
authoromatt <m.vuoso@laposte.net>2016-12-19 21:53:15 +0100
committergumi <mekolat@users.noreply.github.com>2017-01-06 14:07:57 -0500
commit5effe0983f93103370624e82bfc0879e611dd18d (patch)
tree97a94cccc5701b4d8addc770635f2999a135758f /npc/000-1/chest.txt
parentab6b97f77856f638a8efa210c1b6869c909c988f (diff)
downloadserverdata-5effe0983f93103370624e82bfc0879e611dd18d.tar.gz
serverdata-5effe0983f93103370624e82bfc0879e611dd18d.tar.bz2
serverdata-5effe0983f93103370624e82bfc0879e611dd18d.tar.xz
serverdata-5effe0983f93103370624e82bfc0879e611dd18d.zip
add a delay on close/open chest
Diffstat (limited to 'npc/000-1/chest.txt')
-rw-r--r--npc/000-1/chest.txt44
1 files changed, 21 insertions, 23 deletions
diff --git a/npc/000-1/chest.txt b/npc/000-1/chest.txt
index 9e623aa8..94417a4e 100644
--- a/npc/000-1/chest.txt
+++ b/npc/000-1/chest.txt
@@ -3,6 +3,7 @@
// 4144
// Hal9000
// Reid
+// gumi
// Description:
// A treasure chest, with... Treasures inside!
// Variable:
@@ -12,35 +13,32 @@
// 1 Treasure Chest has been opened.
000-1,83,70,0 script Chest#000-1 NPC_CHEST,{
- if (.dir != 4)
- {
- .dir = 2;
- initnpctimer;
- startnpctimer;
- misceffect 24;
- close;
- }
- .@q = getq(ShipQuests_TreasureChest);
- if (.@q == 0)
+ if (.busy == false)
{
- inventoryplace OldBook, 1;
- setq ShipQuests_TreasureChest, 1;
- Zeny = Zeny + 100;
- getitem OldBook, 1;
- npctalk3 l("Chest opened.");
- }
+ if (getq(ShipQuests_TreasureChest) == 0)
+ {
+ inventoryplace OldBook, 1;
+ setq ShipQuests_TreasureChest, 1;
+ npctalk3 l("Chest opened.");
+ Zeny += 100;
+ getitem OldBook, 1;
+ }
- .dir = 6;
- initnpctimer;
- startnpctimer;
- misceffect 25;
- close;
+ misceffect .dir == 0 ? 24 : 25; // closed ? opening : closing
+ .dir = .dir == 0 ? 2 : 6; // closed ? opening : closing
+ .busy = true; // lock until available again
+ initnpctimer;
+ }
+ end;
OnTimer160:
+ .dir = .dir == 6 ? 0 : 4; // closing ? closed : open
+ end;
+
+OnTimer500:
stopnpctimer;
- if (.dir == 2) .dir = 4;
- if (.dir == 6) .dir = 0;
+ .busy = false; // unlock
end;
OnInit: