summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/021-4/main.txt59
1 files changed, 54 insertions, 5 deletions
diff --git a/npc/021-4/main.txt b/npc/021-4/main.txt
index 62d12bcf0..30c5c2bb2 100644
--- a/npc/021-4/main.txt
+++ b/npc/021-4/main.txt
@@ -28,11 +28,60 @@ function script CindySwitch_Check_214 {
return .@i;
}
-021-4,101,33,0 duplicate(#CindySwitch_01) #CindySwitch_06 NPC_SWITCH_OFFLINE
-021-4,90,79,0 duplicate(#CindySwitch_01) #CindySwitch_07 NPC_SWITCH_OFFLINE
-021-4,49,65,0 duplicate(#CindySwitch_01) #CindySwitch_08 NPC_SWITCH_OFFLINE
-021-4,47,21,0 duplicate(#CindySwitch_01) #CindySwitch_09 NPC_SWITCH_OFFLINE
-021-4,80,49,0 duplicate(#CindySwitch_01) #CindySwitch_10 NPC_SWITCH_OFFLINE
+// Switches
+021-4,101,33,0 script #CindySwitch_06 NPC_SWITCH_OFFLINE,{
+ .@q=getq(NivalisQuest_Cindy);
+ if (.@q < 3) {
+ mesn strcharinfo(0);
+ mesq l("This is a strange switch...");
+ close;
+ }
+ if (.lifetime-gettimetick(2) <= 0) {
+ mesc l("Pull the switch?");
+ select
+ l("Pull it"),
+ l("Leave it");
+ if (@menu == 1) {
+ getexp rand(55, 110), rand(5, 11);
+ .lifetime=gettimetick(2)+rand(110, 150); // Something between 1m50s and 2m30s
+ specialeffect(FX_SUCCESS);
+ setnpcdisplay .name$, NPC_SWITCH_ONLINE;
+ initnpctimer;
+ .@r=rand(0,100);
+ getmapxy(.@m$, .@x, .@y,0);
+ if (.@r < 90)
+ monster .@m$, .@x, .@y, "Yeti", Yeti, 6;
+ else
+ monster .@m$, .@x, .@y, "Yeti", Yeti, 2;
+ npctalk l("Automatic disarm in: @@", FuzzyTime(.lifetime));
+ closedialog;
+ }
+ close;
+ }
+ npctalk l("Automatic disarm in: @@", FuzzyTime(.lifetime));
+ end;
+
+OnTimer1000:
+ if (.lifetime-gettimetick(2) <= 0) {
+ setnpcdisplay .name$, NPC_SWITCH_OFFLINE;
+ stopnpctimer;
+ } else {
+ initnpctimer;
+ }
+ end;
+
+OnInit:
+ .sex = G_OTHER;
+ .distance = 3;
+ .lifetime=0; // When will this switch turn off automatically
+ end;
+
+}
+
+021-4,90,79,0 duplicate(#CindySwitch_06) #CindySwitch_07 NPC_SWITCH_OFFLINE
+021-4,49,65,0 duplicate(#CindySwitch_06) #CindySwitch_08 NPC_SWITCH_OFFLINE
+021-4,47,21,0 duplicate(#CindySwitch_06) #CindySwitch_09 NPC_SWITCH_OFFLINE
+021-4,80,49,0 duplicate(#CindySwitch_06) #CindySwitch_10 NPC_SWITCH_OFFLINE
// Cindy
// Global Variable: $@CINDY_STATE