// creator  : weidu.exe (version 23100)
// argument : GORTOR4.DLG
// game		 : .
// source	 : ./DATA/25DIALOG.BIF
// dialog	 : ./DIALOG.TLK
// dialogF  : (none)

BEGIN ~GORTOR4~

IF ~Global("TorchLit4","GLOBAL",0)~ THEN BEGIN 0 // from:
  SAY #63302 /* ~This torch is not lit.  If you had some oil and a flint and tinder you could ignite it.
What do you wish to do?~ */
  IF ~PartyHasItem("PLOT04f")
PartyHasItem("PLOT04b")
~ THEN REPLY #63308 /* ~Light the torch with the red oil.~ */ DO ~SetGlobal("TorchLit4","GLOBAL",1)
IncrementGlobal("Torches","GLOBAL",1)
StaticPalette("PLT_RED","AMB_Flame04")
AmbientActivate("AMB_Flame04",TRUE)
PlaySound("am3017f0")
DestroySelf()
~ GOTO 6
  IF ~PartyHasItem("PLOT04f")
PartyHasItem("PLOT04a")
~ THEN REPLY #63309 /* ~Light the torch with the blue oil.~ */ DO ~SetGlobal("TorchLit4","GLOBAL",2)
StaticPalette("PLT_BLUE","AMB_Flame04")
AmbientActivate("AMB_Flame04",TRUE)
PlaySound("am3017f0")
DestroySelf()
~ GOTO 6
  IF ~PartyHasItem("PLOT04f")
PartyHasItem("PLOT04c")
~ THEN REPLY #63310 /* ~Light the torch with the purple oil.~ */ DO ~SetGlobal("TorchLit4","GLOBAL",3)
StaticPalette("PLT_PURP","AMB_Flame04")
AmbientActivate("AMB_Flame04",TRUE)
PlaySound("am3017f0")
DestroySelf()
~ GOTO 6
  IF ~~ THEN REPLY #63311 /* ~Leave the torch for now.~ */ GOTO 4
END

IF ~Global("TorchLit4","GLOBAL",1)~ THEN BEGIN 1 // from:
  SAY #63303 /* ~The torch burns with a red flame.  If you wish you could extinguish the torch.
What do you wish to do?~ */
  IF ~~ THEN REPLY #63312 /* ~Extinguish the flame.~ */ DO ~IncrementGlobal("Torches","GLOBAL",-1)~ GOTO 5
  IF ~~ THEN REPLY #63313 /* ~Leave the torch for now.~ */ GOTO 4
END

IF ~Global("TorchLit4","GLOBAL",2)~ THEN BEGIN 2 // from:
  SAY #63304 /* ~The torch burns with a blue flame.  If you wish you could extinguish the torch.
What do you wish to do?~ */
  IF ~~ THEN REPLY #63314 /* ~Extinguish the flame.~ */ GOTO 5
  IF ~~ THEN REPLY #63315 /* ~Leave the torch for now.~ */ GOTO 4
END

IF ~Global("TorchLit4","GLOBAL",3)~ THEN BEGIN 3 // from:
  SAY #63305 /* ~The torch burns with a purple flame.  If you wish you could extinguish the torch.
What do you wish to do?~ */
  IF ~~ THEN REPLY #63316 /* ~Extinguish the flame.~ */ GOTO 5
  IF ~~ THEN REPLY #63317 /* ~Leave the torch for now.~ */ GOTO 4
END

IF ~~ THEN BEGIN 4 // from: 3.1 2.1 1.1 0.3
  SAY #63306 /* ~You leave the torch as it is for now.~ */
  IF ~~ THEN DO ~DestroySelf()
~ EXIT
END

IF ~~ THEN BEGIN 5 // from: 3.0 2.0 1.0
  SAY #63307 /* ~You extinguish the flame.~ */
  IF ~~ THEN DO ~SetGlobal("TorchLit4","GLOBAL",0)
AmbientActivate("AMB_Flame04",FALSE)
PlaySound("am3017f2")
DestroySelf()
~ EXIT
END

IF ~~ THEN BEGIN 6 // from: 0.2 0.1 0.0
  SAY #72830 /* ~You light the torch.~ */
  IF ~~ THEN EXIT
END
