diff options
Diffstat (limited to 'npc/000-2-1/chest.txt')
-rw-r--r-- | npc/000-2-1/chest.txt | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/npc/000-2-1/chest.txt b/npc/000-2-1/chest.txt index ff5a3232..69aaba96 100644 --- a/npc/000-2-1/chest.txt +++ b/npc/000-2-1/chest.txt @@ -2,6 +2,8 @@ // Authors: // 4144 // Reid +// omatt +// gumi // Description: // A box with clothes for new players. // Variable: @@ -11,45 +13,42 @@ // 2 Has the clothes. 000-2-1,51,37,0 script Chest#000-2-1 NPC_CHEST_BIG,{ - .@q = getq(ShipQuests_Arpan); - if (.@q == 0) goto L_Talk; - if (.dir == 4) goto L_Give; - - .dir = 2; - initnpctimer; - startnpctimer; - misceffect 24; - close; - -L_Give: - if (.@q > 1) goto L_Quit; - inventoryplace CreasedShirt, 2; + .@questState = getq(ShipQuests_Arpan); + + if (.@questState == 0) + { + npctalk3 l("You should talk to Magic Arpan first."); + end; + } + + if (.busy == false) + { + if (.dir == 4 && .@questState <= 1) + { + inventoryplace CreasedShirt, 2; + setq ShipQuests_Arpan, 2; + getitem CreasedShirt, 1; + getitem CreasedShorts, 1; + npctalk3 l("You take the clothes from the chest."); + } + + misceffect .dir == 0 ? 24 : 25; // closed ? opening : closing + .dir = .dir == 0 ? 2 : 6; // closed ? opening : closing + .busy = true; // lock the animation + initnpctimer; + } + end; - setq ShipQuests_Arpan, 2; - getitem CreasedShirt, 1; - getitem CreasedShorts, 1; - npctalk3 l("You take the clothes from the chest."); - goto L_Quit; +OnTimer220: + .dir = .dir == 6 ? 0 : 4; // closing ? closed : open + end; -OnTimer360: +OnTimer500: stopnpctimer; - if (.dir == 2) .dir = 4; - if (.dir == 6) .dir = 0; + .busy = false; // unlock the animation end; -L_Talk: - npctalk3 l("You should talk to Magic Arpan first."); - - close; - -L_Quit: - .dir = 6; - initnpctimer; - startnpctimer; - misceffect 25; - close; - OnInit: .distance = 2; end; |