// creator  : weidu.exe (version 23100)
// argument : GORBAT1.DLG
// game		 : .
// source	 : ./override/GORBAT1.DLG
// dialog	 : ./DIALOG.TLK
// dialogF  : (none)

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

IF WEIGHT #0 ~Global("BatAttacked","GLOBAL",1)
GlobalGT("zGorBat1Job","GLOBAL",0)
Global("BatEnemy","GLOBAL",0)~ THEN BEGIN 0 // from:
  SAY #63166 /* ~Ahh... betrayal comes as no surprise to demons made only of lies...~ [GORBAT08] */
  IF ~~ THEN DO ~SetGlobal("BatEnemy","GLOBAL",1)~ EXIT
END

IF WEIGHT #2 /* Triggers after states #: 17 even though they appear after this state */
~Global("BatEnemy","GLOBAL",0)
Detect(Player1)
Class(Player1,PALADIN_ALL)
Alignment(Player1,LAWFUL_GOOD)
Global("zGorBat1Job","GLOBAL",0)~ THEN BEGIN 1 // from:
  SAY #63168 /* ~(hiss)  A gleaming knight with holy purpose, I see.  When holy knights and baatezu meet at all, one or the other is sure to fall.  (hiss)~ [GORBAT07] */
  IF ~~ THEN DO ~SetGlobal("BatEnemy","GLOBAL",1)~ EXIT
END

IF WEIGHT #3 /* Triggers after states #: 17 even though they appear after this state */
~Global("BatEnemy","GLOBAL",0)
Global("zGorBat1Job","GLOBAL",0)~ THEN BEGIN 2 // from:
  SAY #63169 /* ~Ahhh... (hiss)  ... a mortal new, a fleshling true.  With you there is no Blood War; speak, mortal, and stay your sword...~ [GORBAT10] */
  IF ~~ THEN REPLY #63170 /* ~I am here to destroy you, devil!~ */ GOTO 3
  IF ~~ THEN REPLY #63172 /* ~I have no idea what you are talking about... but now you die, creature.~ */ GOTO 3
  IF ~~ THEN REPLY #63173 /* ~What are you talking about?  What is this Blood War?~ */ GOTO 4
  IF ~~ THEN REPLY #63194 /* ~I think I'll be leaving, now...~ */ GOTO 14
END

IF ~~ THEN BEGIN 3 // from: 2.1 2.0
  SAY #63171 /* ~You've met your match, mortal man.  Come destroy me if you can.~ */
  IF ~~ THEN DO ~SetGlobal("BatEnemy","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 4 // from: 2.2
  SAY #63174 /* ~To this maze we have been brought, led by the force we long have sought.  We wish to return to Baator again... but our attempts to Gate are all in vain.~ [GORBAT12] */
  IF ~~ THEN GOTO 5
END

IF ~~ THEN BEGIN 5 // from: 4.0
  SAY #63175 /* ~Our ancient Blood War foes... the tanar'ri (hisss)... are also in this place.  No doubt they are responsible for the plight we now face.~ [GORBAT13] */
  IF ~OR(2)
Alignment(LastTalkedToBy,LAWFUL_GOOD)
Alignment(LastTalkedToBy,NEUTRAL_GOOD)~ THEN GOTO 6
  IF ~!Alignment(LastTalkedToBy,LAWFUL_GOOD)
!Alignment(LastTalkedToBy,NEUTRAL_GOOD)~ THEN GOTO 7
END

IF ~~ THEN BEGIN 6 // from: 5.0
  SAY #63176 /* ~But the tanar'ri be too strong; our battles are many and long.  Perhaps you, mortal, might... nay.  I sense you are too good to rid us of the hated brood.  Best kill you now before trouble you become.~ */
  IF ~~ THEN DO ~SetGlobal("BatEnemy","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 7 // from: 5.1
  SAY #63177 /* ~But the tanar'ri be too strong; our battles have been many and long.  You have great power, mortal, it is true...  kill the baalor, Tahazzar, and be rewarded by the baatezu.~ [GORBAT14] */
  IF ~!Dead("GorTan1")~ THEN REPLY #63178 /* ~What manner of reward are you offering?~ */ GOTO 8
  IF ~!Dead("GorTan1")~ THEN REPLY #63184 /* ~Very well, I'll do the deed.  Where do I find this fiend?~ */ GOTO 9
  IF ~~ THEN REPLY #63185 /* ~Forget it.  I'll bargain with no devil.~ */ GOTO 10
  IF ~Dead("GorTan1")
!PartyHasItem("PLOT02i")~ THEN REPLY #63186 /* ~This tanar'ri you speak of... I have already destroyed the demon, I believe.~ */ GOTO 11
  IF ~Dead("GorTan1")
PartyHasItem("PLOT02i")~ THEN REPLY #63192 /* ~This tanar'ri you speak of... I have already destroyed the demon, and I have its heart, here.~ */ DO ~TakePartyItem("PLOT02i")
DestroyItem("PLOT02i")~ GOTO 13
END

IF ~~ THEN BEGIN 8 // from: 7.0
  SAY #63179 /* ~Magic is plentiful in Baator, you see, and while I cannot go there I may draw things to me.  Something sufficient will be given to you... plus the goodwill of the baatezu.~ */
  IF ~~ THEN REPLY #63180 /* ~Very well, I'll do the deed.  Where do I find this fiend?~ */ GOTO 9
  IF ~~ THEN REPLY #63182 /* ~No, not interested.~ */ GOTO 10
END

IF ~~ THEN BEGIN 9 // from: 8.0 7.1
  SAY #63181 /* ~Ahhh... (hissss) ... it is always good to meet intelligent mortals.  The Baalor, Tahazzar, is in this maze.  Search the portals.~ */
  IF ~~ THEN DO ~SetGlobal("zGorBat1Job","GLOBAL",1)~ UNSOLVED_JOURNAL #63737 /* ~The Blood War

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

IF ~~ THEN BEGIN 10 // from: 15.2 11.1 8.1 7.2
  SAY #63183 /* ~(hisssss)  ... I see.  Then die quickly.~ */
  IF ~~ THEN DO ~SetGlobal("BatEnemy","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 11 // from: 7.3
  SAY #63187 /* ~How grand that would be... if you speak true.  Bring his heart to me, mortal, and I shall reward you.  An item of power... and the goodwill of the baatezu.~ */
  IF ~~ THEN REPLY #63188 /* ~Very well, I'll return with the heart.~ */ GOTO 12
  IF ~~ THEN REPLY #63190 /* ~Forget it... I'd rather destroy you here and now.~ */ GOTO 10
END

IF ~~ THEN BEGIN 12 // from: 15.1 11.0
  SAY #63189 /* ~I will be pleased to have the heart soon... ah, to cause the tanar'ri ruin.~ */
  IF ~~ THEN DO ~SetGlobal("zGorBat1Job","GLOBAL",1)~ UNSOLVED_JOURNAL #63737 /* ~The Blood War

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

IF ~~ THEN BEGIN 13 // from: 15.0 7.4
  SAY #63193 /* ~You have the heart of the baalor!  You have our gratitude forever more.  (hisss)  Strange, though, that we still cannot gate... perhaps the tanar'ri had naught to do with our fate?~ [GORBAT15] */
  IF ~~ THEN DO ~EraseJournalEntry(63736)
EraseJournalEntry(63737)
SetGlobal("zGorBat1Job","GLOBAL",2)
GiveItemCreate("Helm29",LastTalkedToBy,0,0,0)
GiveItem("PLOT02c",LastTalkedToBy)
AddXP2DA("PLOT3A")~ SOLVED_JOURNAL #63738 /* ~The Blood War

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

IF ~~ THEN BEGIN 14 // from: 2.3
  SAY #63195 /* ~No, you will go nowhere.  Best you die now...'tis far more fair.~ */
  IF ~~ THEN DO ~SetGlobal("BatEnemy","GLOBAL",1)~ EXIT
END

IF WEIGHT #4 /* Triggers after states #: 17 even though they appear after this state */
~Global("zGorBat1Job","GLOBAL",1)
Global("BatEnemy","GLOBAL",0)~ THEN BEGIN 15 // from:
  SAY #63196 /* ~Ahhh... (hisssss)  The mortal returns once more.  Sooooo... have you the heart of Tahazzar in tow?~ */
  IF ~PartyHasItem("PLOT02i")~ THEN REPLY #63197 /* ~Yes, indeed.  Here it is.~ */ DO ~TakePartyItem("PLOT02i")
DestroyItem("PLOT02i")~ GOTO 13
  IF ~~ THEN REPLY #63198 /* ~No I don't... but I intend to get it soon.~ */ GOTO 12
  IF ~~ THEN REPLY #63199 /* ~No, I don't.  And I have no intention of getting it, either.~ */ GOTO 10
END

IF WEIGHT #5 /* Triggers after states #: 17 even though they appear after this state */
~Global("zGorBat1Job","GLOBAL",2)
Global("BatEnemy","GLOBAL",0)~ THEN BEGIN 16 // from:
  SAY #63200 /* ~We are busy, mortal, attempting to summon our gate.  Whatever you are wishing, it will have to wait.~ [GORBAT11] */
  IF ~~ THEN EXIT
END

IF WEIGHT #1 ~Global("zGorTan1Job","GLOBAL",1)
Global("BatEnemy","GLOBAL",0)~ THEN BEGIN 17 // from:
  SAY #63213 /* ~Tanar'ri!  Tanar'ri in the guise of mortals, it is so!  The Blood War anew, kill our ancient foe!!~ [GORBAT09] */
  IF ~~ THEN DO ~SetGlobal("BatEnemy","GLOBAL",1)~ EXIT
END
