BEGIN ~BHTOLV~

IF ~NumberOfTimesTalkedTo(0) AreaCheck("BH1400")~ THEN BEGIN 0
  SAY @1
  IF ~~ THEN GOTO 1
END

IF ~~ THEN BEGIN 1
  SAY @2
  IF ~IfValidForPartyDialogue("Xan")~ THEN EXTERN ~XANJ~ XANTOLV
  IF ~~ THEN EXIT
END

IF ~AreaCheck("BH1400")~ THEN BEGIN 2
  SAY @3
  IF ~~ THEN REPLY @4 GOTO 3
  IF ~~ THEN REPLY @5 EXIT
END

IF ~~ THEN BEGIN 3
  SAY @6
  IF ~~ THEN REPLY @7 GOTO 4
  IF ~~ THEN REPLY @8 EXIT
END

IF ~~ THEN BEGIN 4
  SAY @9
  IF ~~ THEN REPLY @10 GOTO 5
  IF ~~ THEN REPLY @11 GOTO 7
END

IF ~~ THEN BEGIN 5
  SAY @12
  IF ~~ THEN REPLY @13 GOTO 6
  IF ~~ THEN REPLY @14 GOTO 6
END

IF ~~ THEN BEGIN 6
  SAY @15
  IF ~~ THEN REPLY @16 GOTO 8
END

IF ~~ THEN BEGIN 7
  SAY @17
  IF ~~ THEN REPLY @16 GOTO 8
END

IF ~~ THEN BEGIN 8
  SAY @18
  IF ~GlobalGT("BHBanditQuestAccept","GLOBAL",1)~ THEN REPLY @19 GOTO 9
  IF ~~ THEN REPLY @20 GOTO 9
END

IF ~~ THEN BEGIN 9
  SAY @21
  IF ~~ THEN DO ~SetGlobal("BHWizTraining","GLOBAL",1) AddexperienceParty(2000) EscapeArea()~ EXIT
END

IF ~Global("BHWizTraining","GLOBAL",2) AreaCheck("BH0109")~ THEN BEGIN 10
  SAY @22
  IF ~IfValidForPartyDialogue("Xan")~ THEN EXTERN ~XANJ~ XANTOLV2
  IF ~~ THEN EXIT
END

APPEND ~XANJ~

IF ~~ THEN BEGIN XANTOLV 
  SAY @23 
  IF ~~ THEN EXIT
END

END

APPEND ~XANJ~

IF ~~ THEN BEGIN XANTOLV2
  SAY @24
  IF ~~ THEN EXIT
END

END