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

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

IF WEIGHT #0 ~  NumberOfTimesTalkedTo(0)
~ THEN BEGIN 0 // from:
  SAY #498 /* ~Hold travelers, I challenge your best warrior to a duel. I don't fight women, so only men should step forward.~ */
  IF ~~ THEN REPLY #509 /* ~We don't have the time to waste on such stupidity.~ */ GOTO 6
  IF ~~ THEN REPLY #510 /* ~Sure, what are the rules and reward for winning?~ */ GOTO 1
END

IF ~~ THEN BEGIN 1 // from: 0.1
  SAY #499 /* ~I win, and you give me 20 gold. In the unlikely event that one of you bests me, I'll pledge my sword to your cause.~ */
  IF ~~ THEN REPLY #511 /* ~Not interested.~ */ GOTO 6
  IF ~  InParty([0.0.0.0.0.FEMALE])
InParty([0.0.0.0.0.MALE])
~ THEN REPLY #512 /* ~Sounds good to us.~ */ GOTO 2
  IF ~  !InParty([0.0.0.0.0.FEMALE])
~ THEN REPLY #515 /* ~Sounds good to us.~ */ GOTO 3
  IF ~Global("X#SHARTE1","GLOBAL",0)
InParty("edwin")
InMyArea("edwin")
!StateCheck("edwin",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#SHARTE1","GLOBAL",1)~ EXTERN ~EDWINJ~ 189
  IF ~Global("X#SHARTE1","GLOBAL",0)
InParty("xan")
InMyArea("xan")
!StateCheck("xan",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#SHARTE1","GLOBAL",1)~ EXTERN ~XANJ~ 242
END

IF ~~ THEN BEGIN 2 // from: 4.1 1.1
  SAY #500 /* ~Will your champion step forward? I only fight men, so your women will have to be satisfied with just watching. Don't entertain any thoughts about cheating. If any of the rest of you try to interfere in this fight, I'll kill them outright.~ */
  IF ~~ THEN DO ~SetGlobal("SHARTEELFIGHT","GLOBAL",1)
~ EXIT
END

IF ~~ THEN BEGIN 3 // from: 4.2 1.2
  SAY #501 /* ~Will your champion step forward? Don't entertain any thoughts about cheating. If any of the rest of you try to interfere in this fight, I'll kill them outright.~ */
  IF ~~ THEN DO ~SetGlobal("SHARTEELFIGHT","GLOBAL",1)
~ EXIT
END

IF WEIGHT #7 /* Triggers after states #: 5 9 12 13 14 17 even though they appear after this state */
~  Global("BeatSharteel","GLOBAL",3)
~ THEN BEGIN 4 // from:
  SAY #503 /* ~Do you want another try? If you've such a desire to have the snot beaten out of you, then I'll be happy to oblige.~ */
  IF ~~ THEN REPLY #513 /* ~We know when we're beaten.~ */ DO ~ChangeAIScript("SHARTEEL",OVERRIDE)
~ GOTO 6
  IF ~  InParty([0.0.0.0.0.FEMALE])
~ THEN REPLY #514 /* ~Sure, this time we won't be so easy on you.~ */ GOTO 2
  IF ~  !InParty([0.0.0.0.0.FEMALE])
~ THEN REPLY #516 /* ~Sure, this time we won't be so easy on you.~ */ GOTO 3
END

IF WEIGHT #1 ~  Global("BeatSharteel","GLOBAL",2)
~ THEN BEGIN 5 // from:
  SAY #505 /* ~I can't believe this. I'm beaten, by a man no less. I guess I must keep my word. I pledge my sword to your cause, however stupid it may be.~ */
  IF ~~ THEN REPLY #517 /* ~Actually, we don't need your assistance.~ */ DO ~AddexperienceParty(300)
ChangeAIScript("SHARTEEL",OVERRIDE)
SetGlobal("BeatSharteel","GLOBAL",5)
EscapeArea()
~ GOTO 7
  IF ~~ THEN REPLY #518 /* ~Good, you had better prove your worth.~ */ DO ~ChangeAIScript("SHARTEEL",OVERRIDE)
~ GOTO 8
END

IF ~~ THEN BEGIN 6 // from: 4.0 1.0 0.0
  SAY #506 /* ~When I first saw you, I took you for cowards. I guess I was right. Good riddance.~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 7 // from: 5.0
  SAY #507 /* ~If you're too stupid to see my worth, then that's your problem.~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 8 // from: 5.1
  SAY #508 /* ~Of course I'll prove my worth! It won't be too hard in this group.~ */
  IF ~~ THEN DO ~DestroyItem("MIHP1")
JoinParty()
~ EXIT
END

IF WEIGHT #2 ~  False()
~ THEN BEGIN 9 // from:
  SAY #2147 /* ~Why are you doing this, Angelo?~ */
  IF ~~ THEN EXTERN ~ANGELO~ 5
END

IF ~~ THEN BEGIN 10 // from:
  SAY #2148 /* ~Your daughter is who speaks to you, Angelo, or have you somehow forgotten?~ */
  IF ~~ THEN JOURNAL #26842 /* ~Afoul of the Law
Angelo has sentenced us to die by hanging.~ */ EXTERN ~ANGELO~ 6
END

IF ~~ THEN BEGIN 11 // from:
  SAY #6391 /* ~You don't have the money?! I guess I'll have to take it out of your hide.~ */
  IF ~~ THEN DO ~DestroyItem("MIHP1")
ChangeAIScript("",OVERRIDE)
Enemy()
~ EXIT
END

IF WEIGHT #3 ~  Global("BeatSharteel","GLOBAL",1)
~ THEN BEGIN 12 // from:
  SAY #13960 /* ~Well, that was pathetic, but then, men are the weaker sex. Thanks for the easy cash.~ */
  IF ~~ THEN DO ~TakePartyGold(20)
ChangeAIScript("SHARTEEL",OVERRIDE)
SetGlobal("BeatSharteel","GLOBAL",3)
~ EXIT
END

IF WEIGHT #4 ~  HPPercentLT(StrongestOfMale,50)
~ THEN BEGIN 13 // from:
  SAY #13961 /* ~You're the most sickly group of adventurers I've ever laid eyes on. Get out of my sight before I throw up.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #5 ~  False()
~ THEN BEGIN 14 // from:
  SAY #13753 /* ~A party of women, is it? Well met. Hey, if you ever happen to have a man tagging along with you, bring him down this way. I'd love to rub his nose in it, a little.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 15 // from:
  SAY #13754 /* ~Ah, I'm finally released from this infernal duty! I swear by every god in a million pantheons that I will NEVER lose a duel to another overly masculine thug in my life.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 16 // from:
  SAY #13755 /* ~Damn it, you lose one well-fought duel to an oafish lout of a man and you get attached. I almost hate to say it but you've earned my respect.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #6 ~  Global("Sharhit","GLOBAL",1)
~ THEN BEGIN 17 // from:
  SAY #10638 /* ~I told you, I only fight men! You'll regret hitting me, woman, you and your entire party!~ */
  IF ~~ THEN DO ~DestroyItem("MIHP1")
ChangeAIScript("",OVERRIDE)
Enemy()
~ EXIT
END
