// creator  : weidu.exe (version 23600)
// argument : GALLOR.DLG
// game     : .
// source   : ./override/GALLOR.DLG
// dialog   : lang\en_us/dialog.tlk
// dialogF  : (none)

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

IF WEIGHT #1 /* Triggers after states #: 10 even though they appear after this state */
~  NumberOfTimesTalkedTo(0)
~ THEN BEGIN 0 // from:
  SAY #8593 /* ~Why, hello there. Could we just step aside a moment and have a little chat away from prying ears?~ */
  IF ~~ THEN GOTO 1
END

IF ~~ THEN BEGIN 1 // from: 0.0
  SAY #8595 /* ~First, my name is Gallor. Second, we never had this conversation. I'm the "partner" of that old mister Charleston you met, except I'm none too thrilled about the non-profit aspects of the whole thing. The old man seems to think we should donate all our findings to some museum, whereas I am ever so much more practical. I should think certain people would pay dearly for the magical treasure we are about to unearth, and if they would be so eager, who are we to stand in their way? I would like you to steal the item and "remove" Mr. Nib from my little equation. You up to the task?~ */
  IF ~  OR(3)
!InParty("ajantis")
!InMyArea("ajantis")
StateCheck("ajantis",CD_STATE_NOTVALID)
~ THEN REPLY #8607 /* ~I would have to kill many of the working men if I attacked Charleston. It would be a veritable slaughter, and I want no part of it.~ */ GOTO 2
  IF ~  OR(3)
!InParty("ajantis")
!InMyArea("ajantis")
StateCheck("ajantis",CD_STATE_NOTVALID)
~ THEN REPLY #8608 /* ~Magical treasure? I was under the impression that no one knows what is to be found there. Why are you so sure of its value?~ */ GOTO 3
  IF ~  OR(3)
!InParty("ajantis")
!InMyArea("ajantis")
StateCheck("ajantis",CD_STATE_NOTVALID)
~ THEN REPLY #8609 /* ~It's a bloody task that you ask of me. What would be my reward for such a risk?~ */ GOTO 5
  IF ~  OR(3)
!InParty("ajantis")
!InMyArea("ajantis")
StateCheck("ajantis",CD_STATE_NOTVALID)
Global("HelpCharleston","GLOBAL",0)
~ THEN REPLY #8610 /* ~I need little excuse to partake in bloodshed. Consider them dead tonight.~ */ GOTO 6
  IF ~  OR(3)
!InParty("ajantis")
!InMyArea("ajantis")
StateCheck("ajantis",CD_STATE_NOTVALID)
Global("HelpCharleston","GLOBAL",1)
~ THEN REPLY #8625 /* ~I need little excuse to partake in bloodshed. Consider them dead tonight.~ */ GOTO 7
  IF ~  InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID)
Global("X#AjantisNoHelpGallor","GLOBAL",0)
~ THEN EXTERN ~AJANTJ~ 93
  IF ~Global("X#DynaheirGallor1","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DynaheirGallor1","GLOBAL",1)~ EXTERN ~DYNAHJ~ 73
END

IF ~~ THEN BEGIN 2 // from: 22.0 5.0 4.0 3.0 1.0 GARRIJ:175.0
  SAY #8596 /* ~Blast you! You are playing just as safe as the old man! So be it; I will find other means to acquire a fair measure of profit from this fiasco! Best you continue on whatever errand you be on.~ */
  IF ~~ THEN DO ~MoveToPoint([3005.1722])
EscapeArea()
~ EXIT
  IF ~Global("X#GALLOR2","GLOBAL",0)
InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR2","GLOBAL",1)~ GOTO 24
  IF ~Global("X#GALLOR2","GLOBAL",0)
InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR2","GLOBAL",1)~ EXTERN ~KIVANJ~ 365
  IF ~Global("X#GALLOR2","GLOBAL",0)
InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR2","GLOBAL",1)~ GOTO 26
  IF ~Global("X#GALLOR2","GLOBAL",0)
InParty("imoen")
InMyArea("imoen")
!StateCheck("imoen",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR2","GLOBAL",1)~ EXTERN ~IMOEN2~ 417
END

IF ~~ THEN BEGIN 3 // from: 5.1 1.1 GARRIJ:175.1
  SAY #8597 /* ~Old mister Nib would never admit it, but that is mainly because he doesn't wish to jinx the dig. From what I could decipher in the ancient writings, the final room contains "the plate that provides bounty, leading food unto god." Doesn't take a genius to figure out what that means. Obviously the item under all that dirt and rubble is enchanted such that it "provides bounty." Whether it's through increased crops or good hunting, I care not. Regardless, an object of that age and enchantment should command a hefty price and I intend to see that it does. You can be a part of it if you wish.~ */
  IF ~~ THEN REPLY #8611 /* ~I would have to kill many of the working men if I attacked Charleston. It would be a veritable slaughter, and I want no part of it.~ */ GOTO 2
  IF ~~ THEN REPLY #8612 /* ~It's a bloody task that you ask of me. What would be my reward for such a risk?~ */ GOTO 5
  IF ~~ THEN REPLY #8613 /* ~It is a very sketchy description that you offer. I should think that different deities would require different "bounty" to be delivered. Do you know if this ancient one preferred "bounty" that we would find valuable?~ */ GOTO 4
  IF ~Global("X#VicGallor","GLOBAL",0)
InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#VicGallor","GLOBAL",1)~ EXTERN ~VICONJ~ 108
END

IF ~~ THEN BEGIN 4 // from: 3.2
  SAY #8598 /* ~I care not whether the primitives who lived here worshipped chickens and the plate produces fodder! It does not matter! What DOES matter, is that we potentially have an item associated with a god long since lost to the mists of time. Its former enchantments may not even work, but it will still command an exorbitant price from a historian or collector. Do you wish a piece of the pie or don't ya?~ */
  IF ~~ THEN REPLY #8614 /* ~I would have to kill many of the working men if I attacked Charleston. It would be a veritable slaughter, and I want no part of it.~ */ GOTO 2
  IF ~~ THEN REPLY #8615 /* ~I need little excuse to partake in bloodshed. Consider them dead tonight.~ */ GOTO 6
  IF ~~ THEN REPLY #8616 /* ~It's a bloody task that you ask of me. What would be my reward for such a risk?~ */ GOTO 5
END

IF ~~ THEN BEGIN 5 // from: 4.2 3.1 1.2
  SAY #8599 /* ~Consider a payment of 900 gold. Would that be to your liking? Not a bad price for the heads of an old man and his dirty hired ditch-diggers. What say you?~ */
  IF ~~ THEN REPLY #8617 /* ~I would have to kill many of the working men if I attacked Charleston. It would be a veritable slaughter, and I want no part of it.~ */ GOTO 2
  IF ~~ THEN REPLY #8618 /* ~Magical treasure? I was under the impression that no one knows what is to be found there. Why are you so sure of its value?~ */ GOTO 3
  IF ~  Global("HelpCharleston","GLOBAL",0)
~ THEN REPLY #8619 /* ~I need little excuse to partake in bloodshed. Consider them dead tonight.~ */ GOTO 6
  IF ~  Global("HelpCharleston","GLOBAL",1)
~ THEN REPLY #8626 /* ~I need little excuse to partake in bloodshed. Consider them dead tonight.~ */ GOTO 7
  IF ~Global("X#GALLOR5","GLOBAL",0)
InParty("sharteel")
InMyArea("sharteel")
!StateCheck("sharteel",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR5","GLOBAL",1)~ EXTERN ~SHARTJ~ 168
  IF ~Global("X#GALLOR5","GLOBAL",0)
InParty("sharteel")
InMyArea("sharteel")
!StateCheck("sharteel",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR5","GLOBAL",1)~ EXTERN ~SHARTJ~ 169
  IF ~Global("X#GALLOR5","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR5","GLOBAL",1)~ EXTERN ~GARRIJ~ 175
END

IF ~~ THEN BEGIN 6 // from: 5.2 4.1 1.3 GARRIJ:175.2
  SAY #8600 /* ~Excellent, but just you make sure you do not attack them until AFTER they have breached the inner sanctum. It's unlikely you could uncover the item without their help. I will meet with you here after the deed to make our exchange. Remember to get everyone! I will be the sole survivor to tell the tale.~ */
  IF ~~ THEN DO ~SetGlobal("HelpGallor","GLOBAL",1)
~ EXIT
  IF ~Global("X#GALLOR6","GLOBAL",0)
InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR6","GLOBAL",1)~ EXTERN ~KIVANJ~ 368
  IF ~Global("X#GALLOR6","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
OR(3)
!InParty("minsc")
!InMyArea("minsc")
StateCheck("minsc",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR6","GLOBAL",1)~ EXTERN ~DYNAHJ~ 207
  IF ~Global("X#GALLOR6","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
InParty("minsc")
InMyArea("minsc")
!StateCheck("minsc",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR6","GLOBAL",1)~ EXTERN ~DYNAHJ~ 208
END

IF ~~ THEN BEGIN 7 // from: 5.3 1.4 GARRIJ:175.3
  SAY #8601 /* ~Excellent, but best that you hurry back to the camp. They were just about to breach the inner sanctum when I left, and it would be best to take care of them before a runner is dispatched with the news. I will meet with you here after the deed to make our exchange. Remember to get everyone! I will be the sole survivor to tell the tale.~ */
  IF ~~ THEN DO ~SetGlobal("HelpGallor","GLOBAL",1)
~ EXIT
  IF ~Global("X#GALLOR7","GLOBAL",0)
InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR7","GLOBAL",1)~ EXTERN ~KIVANJ~ 371
  IF ~Global("X#GALLOR7","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
OR(3)
!InParty("minsc")
!InMyArea("minsc")
StateCheck("minsc",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR7","GLOBAL",1)~ EXTERN ~DYNAHJ~ 210
  IF ~Global("X#GALLOR7","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
InParty("minsc")
InMyArea("minsc")
!StateCheck("minsc",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GALLOR7","GLOBAL",1)~ EXTERN ~DYNAHJ~ 211
END

IF WEIGHT #2 /* Triggers after states #: 10 even though they appear after this state */
~  NumDeadLT("CharleDig",6)
!Dead("Charleston")
Global("HelpGallor","GLOBAL",1)
~ THEN BEGIN 8 // from:
  SAY #8602 /* ~You fool! Charleston and his men are not dead! How am I to blame the theft of the item on bandits if they are alive to say otherwise?! Finish the task or you get nothing from me!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #3 /* Triggers after states #: 10 even though they appear after this state */
~  NumDeadGT("CharleDig",5)
Dead("Charleston")
PartyHasItem("MISC48")
Global("HelpGallor","GLOBAL",1)
~ THEN BEGIN 9 // from:
  SAY #8603 /* ~Well... it's done and done. Here is your 900, and here is my beauty. Hmm... it's not quite as I had expected, but no matter. I have it to myself, and that is all that matters. I shall concoct a tragic story of an expedition hijacked by bandits, with all hands lost and payrolls stolen... strange... it is warm to the touch... Leave me now, our business is done.~ */
  IF ~  !See("Doomsayer")
~ THEN DO ~GiveGoldForce(900)
SetGlobal("HelpGallor","GLOBAL",2)
TakePartyItem("MISC48")
ReputationInc(-2)
MoveToPoint([3005.1722])
EscapeArea()
~ EXIT
  IF ~  See("Doomsayer")
~ THEN DO ~ActionOverride("Doomsayer",Enemy())
ChangeAIScript("WTASIGHT",DEFAULT)
GiveGoldForce(900)
TakePartyItem("MISC48")
SetGlobal("HelpGallor","GLOBAL",2)
ReputationInc(-2)
~ EXTERN ~DOOMSAY~ 5
END

IF WEIGHT #0 ~  StateCheck(Myself,STATE_CHARMED)
~ THEN BEGIN 10 // from:
  SAY #9021 /* ~I don't have much to tell you that would be a surprise. I got roped into helping fund this ridiculous old man, and now he won't use what he finds for profit. I'd rather have the whole dig to myself.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #5 /* Triggers after states #: 12 even though they appear after this state */
~  Global("BetrayGallor","GLOBAL",1)
!PartyHasItem("MISC48")
~ THEN BEGIN 11 // from:
  SAY #9022 /* ~I'll not speak a word after what you did! I'll get that fool artifact and sell it on my own.~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
  IF ~  See("Doomsayer")
~ THEN DO ~ActionOverride("Doomsayer",Enemy())
ChangeAIScript("WTASIGHT",DEFAULT)
~ EXTERN ~DOOMSAY~ 5
END

IF WEIGHT #4 ~  NumDeadGT("CharleDig",5)
Dead("Charleston")
!PartyHasItem("MISC48")
Global("HelpGallor","GLOBAL",1)
~ THEN BEGIN 12 // from:
  SAY #1186 /* ~You don't have the artifact! That is what I hired you to retrieve. You won't see one gold piece until you bring it to me!~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 13 // from:
  SAY #14377 /* ~BLOOD QUIETS!~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 14 // from:
  SAY #14378 /* ~KOZAH A PLET 'DAR CASS TOGLAH! KOZAH!~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 15 // from:
  SAY #14379 /* ~Q' AL TE-PAH KOZAH! SHE CAL KOZAH!~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 16 // from:
  SAY #31816 /* ~I really don't feel so great... THE VOICES ARE SCREAMING... AHHHHH!~ */
  IF ~~ THEN GOTO 17
END

IF ~~ THEN BEGIN 17 // from: 16.0
  SAY #14377 /* ~BLOOD QUIETS!~ */
  IF ~~ THEN GOTO 18
END

IF ~~ THEN BEGIN 18 // from: 17.0
  SAY #14379 /* ~Q' AL TE-PAH KOZAH! SHE CAL KOZAH!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 19 // from:
  SAY #31816 /* ~I really don't feel so great... THE VOICES ARE SCREAMING... AHHHHH!~ */
  IF ~~ THEN GOTO 20
END

IF ~~ THEN BEGIN 20 // from: 19.0
  SAY #14377 /* ~BLOOD QUIETS!~ */
  IF ~~ THEN GOTO 21
END

IF ~~ THEN BEGIN 21 // from: 20.0
  SAY #14379 /* ~Q' AL TE-PAH KOZAH! SHE CAL KOZAH!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 22 // from:
  SAY #46142 /* ~Hey, I was talking to *<HIMHER>*, or is it you who makes the decisions?~ */
  IF ~~ THEN REPLY #46144 /* ~Ajantis is absolutely right. We will do no such thing as you intended!~ */ GOTO 2
  IF ~~ THEN REPLY #46145 /* ~Er.. Ajantis? I would like to listen to what this man is actually suggesting.~ */ GOTO 23
  IF ~~ THEN REPLY #46146 /* ~Ajantis, keep your mouth shut! *I* make the decisions, all right? I think this man has a very interesting proposal and I would like to hear it.~ */ GOTO 23
  IF ~  InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID)
Global("X#AjantisNoHelpGallor","GLOBAL",0)
~ THEN EXTERN ~AJANTJ~ 94
END

IF ~~ THEN BEGIN 23 // from: 22.2 22.1
  SAY #46147 /* ~Ah, no, no - forget it. I don't think you are of much help in this case. Damn! Well, I will find someone else who'll help me succeed. You'd better be gone!~ */
  IF ~~ THEN DO ~MoveToPoint([3005.1722])
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 24 // from: 2.1
  SAY #49981 /* ~Off with you!~ */
  IF ~~ THEN DO ~MoveToPoint([3005.1722])
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 25 // from: KIVANJ:365.1
  SAY #49981 /* ~Off with you!~ */
  IF ~~ THEN DO ~MoveToPoint([3005.1722])
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 26 // from: 2.3
  SAY #49979 /* ~Ah, get lost.~ */
  IF ~~ THEN DO ~MoveToPoint([3005.1722])
EscapeArea()
~ EXIT
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN GOTO 27
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 366
END

IF ~~ THEN BEGIN 27 // from: 26.1 KIVANJ:366.1
  SAY #49981 /* ~Off with you!~ */
  IF ~~ THEN DO ~MoveToPoint([3005.1722])
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 28 // from: IMOEN2:417.3
  SAY #49979 /* ~Ah, get lost.~ */
  IF ~~ THEN DO ~MoveToPoint([3005.1722])
EscapeArea()
~ EXIT
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN GOTO 29
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 367
END

IF ~~ THEN BEGIN 29 // from: 28.1 IMOEN2:417.1 KIVANJ:367.1
  SAY #49981 /* ~Off with you!~ */
  IF ~~ THEN DO ~MoveToPoint([3005.1722])
EscapeArea()
~ EXIT
END
