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

BEGIN ~GORTAN1~
//////////////////////////////////////////////////
// WARNING: this file contains non-trivial WEIGHTs
//////////////////////////////////////////////////

IF WEIGHT #2 /* Triggers after states #: 16 17 even though they appear after this state */
~Global("TanEnemy","GLOBAL",0)
Detect(Player1)
OR(2)
Class(Player1,PALADIN_ALL)
Class(Player1,CLERIC_ALL)
Alignment(Player1,LAWFUL_GOOD)
Global("zGorTan1Job","GLOBAL",0)~ THEN BEGIN 0 // from:
  SAY #63099 /* ~What are thee, mortal?  Another crusader sucked into this dire prison along with the tanar'ri?  Bah! Die, mortal, and be grateful!~ [GORTAN07] */
  IF ~~ THEN DO ~SetGlobal("TanEnemy","GLOBAL",1)~ EXIT
END

IF WEIGHT #3 /* Triggers after states #: 16 17 even though they appear after this state */
~Global("zGorTan1Job","GLOBAL",0)~ THEN BEGIN 1 // from:
  SAY #63101 /* ~What are thee, mortal?  Another fleshling drawn from the planes into this prison of the tanar'ri?  Mmmm... I do not smell the Blood War on thee, mortal.  Speak quickly or suffer our wrath!~ [GORTAN08] */
  IF ~~ THEN REPLY #63112 /* ~I am here to destroy you, demon!~ */ GOTO 2
  IF ~~ THEN REPLY #63113 /* ~I have no idea what you are talking about... but now you die, creature.~ */ GOTO 2
  IF ~~ THEN REPLY #63116 /* ~What are you talking about?  What is this Blood War?~ */ GOTO 3
  IF ~~ THEN REPLY #63118 /* ~I think I'll be leaving, now...~ */ GOTO 13
END

IF ~~ THEN BEGIN 2 // from: 1.1 1.0
  SAY #63120 /* ~Is this so?  Then Tahazzar will destroy thee, fleshling, as he would any other!~ */
  IF ~~ THEN DO ~SetGlobal("TanEnemy","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 3 // from: 1.2
  SAY #63122 /* ~We tanar'ri have been drawn here to this interminable maze... and we know not why.  Try though we might, the planes be closed to us.~ [GORTAN09] */
  IF ~~ THEN GOTO 4
END

IF ~~ THEN BEGIN 4 // from: 3.0
  SAY #63124 /* ~Our ancient foes of the Blood War, fiends of Baator, are in this maze as well.  We have little doubt that it is their machinations which have trapped us here.  Their destruction will free us, I be sure.~ [GORTAN10] */
  IF ~OR(2)
Alignment(LastTalkedToBy,MASK_GOOD)
Alignment(LastTalkedToBy,LAWFUL_NEUTRAL)~ THEN GOTO 5
  IF ~!Alignment(LastTalkedToBy,MASK_GOOD)
!Alignment(LastTalkedToBy,LAWFUL_NEUTRAL)~ THEN GOTO 6
END

IF ~~ THEN BEGIN 5 // from: 4.0
  SAY #63125 /* ~But the baatezu be strong, indeed... it has been a challenge to... hmmm.  Perhaps thou, mortal, might... nay.  Nay, thou hast the stench of order and good on thee.  Best to kill thee now and be done with it.~ */
  IF ~~ THEN DO ~SetGlobal("TanEnemy","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 6 // from: 4.1
  SAY #63127 /* ~But the baatezu be strong, indeed... it has been a challenge to... hmmm.  Perhaps thou, mortal, might play a part in this.  Dispatch the hated baatezu, Ka'rashur, and I would reward thee handsomely.~ */
  IF ~!Dead("GorBat1")~ THEN REPLY #63128 /* ~What manner of reward are you offering?~ */ GOTO 7
  IF ~!Dead("GorBat1")~ THEN REPLY #63130 /* ~I'll do the deed.  Where do I find this fiend?~ */ GOTO 8
  IF ~~ THEN REPLY #63131 /* ~Forget it.  I'll bargain with no demon.~ */ GOTO 9
  IF ~Dead("GorBat1")
!PartyHasItem("PLOT02j")~ THEN REPLY #63132 /* ~I have already destroyed the fiend, I believe.~ */ GOTO 10
  IF ~Dead("GorBat1")
PartyHasItem("PLOT02j")~ THEN REPLY #63133 /* ~I have already destroyed the fiend, and I have its heart, here.~ */ DO ~TakePartyItem("PLOT02j")
DestroyItem("PLOT02j")~ GOTO 12
END

IF ~~ THEN BEGIN 7 // from: 6.0
  SAY #63135 /* ~Thou striketh me as the sort who appreciate baubles with mystic dweomers.  I could summon such an item for thee and thou wouldst have the gratitude of the tanar'ri.  No small thing, that.~ */
  IF ~~ THEN REPLY #63137 /* ~Very well, I'll do the deed.  Where do I find this fiend?~ */ GOTO 8
  IF ~~ THEN REPLY #63138 /* ~No, not interested.~ */ GOTO 9
END

IF ~~ THEN BEGIN 8 // from: 7.0 6.1
  SAY #63140 /* ~Thou art a most intelligent being... for a mortal.  The baatezu pit fiend, Ka'rashur, may be found elsewhere in this maze.  I cannot tell thee where, exactly.  Good hunting, fleshing!~ */
  IF ~~ THEN DO ~SetGlobal("zGorTan1Job","GLOBAL",1)~ UNSOLVED_JOURNAL #63736 /* ~The Blood War

I have agreed to do a job for a tanar'ri baalor named Tahazzar to find a baatezu pit fiend named Ka'rashur elsewhere in this maze and to destroy it... and then return to Tahazzar with its heart.  He has promised me not only a material reward but also the goodwill of the tanar'ri.~ */ EXIT
END

IF ~~ THEN BEGIN 9 // from: 14.2 10.1 7.1 6.2
  SAY #63141 /* ~Bah!  Then die, as thou should!~ */
  IF ~~ THEN DO ~SetGlobal("TanEnemy","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 10 // from: 6.3
  SAY #63143 /* ~Is this so?  What a grand day this would be... if it is true.  Bring me the heart of that pit fiend, fleshling, and I shall reward thee handsomely for it.  Something of magic... and our gratitude.~ */
  IF ~~ THEN REPLY #63144 /* ~Very well, I'll return with the heart.~ */ GOTO 11
  IF ~~ THEN REPLY #63145 /* ~Forget it... I'd rather destroy you here and now.~ */ GOTO 9
END

IF ~~ THEN BEGIN 11 // from: 14.1 10.0
  SAY #63146 /* ~I look forward to seeing it, truly.  Good luck to thee, fleshling.~ */
  IF ~~ THEN DO ~SetGlobal("zGorTan1Job","GLOBAL",1)~ UNSOLVED_JOURNAL #63736 /* ~The Blood War

I have agreed to do a job for a tanar'ri baalor named Tahazzar to find a baatezu pit fiend named Ka'rashur elsewhere in this maze and to destroy it... and then return to Tahazzar with its heart.  He has promised me not only a material reward but also the goodwill of the tanar'ri.~ */ EXIT
END

IF ~~ THEN BEGIN 12 // from: 14.0 6.4
  SAY #63147 /* ~Mmmm... most excellent of thee, fleshling.  You have earned the gratitude of the tanar'ri.  Odd, however, that we still cannot open our gate.  Bah!  Here is your reward... now begone and leave us be.~ [GORTAN11] */
  IF ~~ THEN DO ~EraseJournalEntry(63736)
EraseJournalEntry(63737)
SetGlobal("zGorTan1Job","GLOBAL",2)
GiveItemCreate("Helm29",LastTalkedToBy,0,0,0)
GiveItem("PLOT02d",LastTalkedToBy)
AddXP2DA("PLOT3A")~ SOLVED_JOURNAL #63739 /* ~The Blood War

I have destroyed a baatezu pit fiend named Ka'rashur and given its heart to a baalor, Tahazzar, as requested.  Surprisingly, the demon seems to have lived up to its part of the bargain.~ */ EXIT
END

IF ~~ THEN BEGIN 13 // from: 1.3
  SAY #63149 /* ~Nay, mortal.  I think it better that thou dost perish here and now...~ */
  IF ~~ THEN DO ~SetGlobal("TanEnemy","GLOBAL",1)~ EXIT
END

IF WEIGHT #4 /* Triggers after states #: 16 17 even though they appear after this state */
~Global("zGorTan1Job","GLOBAL",1)
Global("TanEnemy","GLOBAL",0)~ THEN BEGIN 14 // from:
  SAY #63150 /* ~You return, little mortal.  And what have you brought with you?  Ka'rashur's heart, perhaps?~ [GORTAN14] */
  IF ~PartyHasItem("PLOT02j")~ THEN REPLY #63159 /* ~Yes, indeed.  Here it is.~ */ DO ~TakePartyItem("PLOT02j")
DestroyItem("PLOT02j")~ GOTO 12
  IF ~~ THEN REPLY #63161 /* ~No I don't... but I intend to get it soon.~ */ GOTO 11
  IF ~~ THEN REPLY #63162 /* ~No, I don't.  And I have no intention of getting it, either.~ */ GOTO 9
END

IF WEIGHT #5 /* Triggers after states #: 16 17 even though they appear after this state */
~Global("zGorTan1Job","GLOBAL",2)
Global("TanEnemy","GLOBAL",0)~ THEN BEGIN 15 // from:
  SAY #63163 /* ~We will not harm thee, little mortal.  But we be busy finding our gate, now... begone before I have a change of heart.~ [GORTAN13] */
  IF ~~ THEN EXIT
END

IF WEIGHT #0 ~Global("TanAttacked","GLOBAL",1)
GlobalGT("zGorTan1Job","GLOBAL",0)
Global("TanEnemy","GLOBAL",0)~ THEN BEGIN 16 // from:
  SAY #63165 /* ~What?!  Outrage!  Insolence!  How dare thee!!~ [GORTAN15] */
  IF ~~ THEN DO ~SetGlobal("TanEnemy","GLOBAL",1)~ EXIT
END

IF WEIGHT #1 ~Global("zGorBat1Job","GLOBAL",1)~ THEN BEGIN 17 // from:
  SAY #63211 /* ~I smell the Blood War upon these, these mortals!!  Baatezu conspirators all!!  Kill them!!~ [GORTAN12] */
  IF ~~ THEN DO ~SetGlobal("TanEnemy","GLOBAL",1)~ EXIT
END
