BEGIN BKido25

CHAIN
  IF ~Global("booknowskido","GLOBAL",0)
  InParty("DKido")
  See("DKido")
  !StateCheck("DKido",STATE_SLEEPING)~ THEN BMINSC25 minscquekido
  @0
DO ~SetGlobal("booknowskido","GLOBAL",1)~
 == BKIDO25
 @1
 == BMINSC25
 @2
 == BKIDO25
 @3
 == BMINSC25
 @4
 == BKIDO25
 @5
EXIT

CHAIN
  IF ~Global("atrest","LOCALS",0)
  InParty("Imoen2")
  See("Imoen2")
  !StateCheck("Imoen2",STATE_SLEEPING)~ THEN BKIDO25 fateimoen
  @6
DO ~SetGlobal("atrest","LOCALS",1)~
 == BIMOEN25
 @7
 == BKIDO25
 @8
 == BIMOEN25
 @9
 == BKIDO25
 @10
 == BIMOEN25
 @11
 == BKIDO25
 @12
 == BIMOEN25
 @13
 == BKIDO25
 @14
EXIT

CHAIN
  IF ~Global("harperatkido","GLOBAL",0)
  InParty("DKido")
  See("DKido")
  !StateCheck("DKido",STATE_SLEEPING)~ THEN BJAHEI25 JahdearKido
  @15
DO ~SetGlobal("harperatkido","GLOBAL",1)~
 == BKIDO25
 @16
 == BJAHEI25
 @17
 == BKIDO25
 @18
 == BJAHEI25
 @19
 == BKIDO25
 @20
EXIT

CHAIN
  IF ~Global("firstmeet","LOCALS",0)
  InParty("Sarevok")
  See("Sarevok")
  !StateCheck("Sarevok",STATE_SLEEPING)~ THEN BKIDO25 questioningS
  @21
DO ~SetGlobal("firstmeet","LOCALS",1)~
 == BSAREV25
 @22
 == BKIDO25
 @23
 == BSAREV25
 @24
 == BKIDO25
 @25
 == BSAREV25
 @26
 == BKIDO25
 @27
 == BSAREV25
 @28
 == BKIDO25
 @29
EXIT

CHAIN
  IF ~Global("tortureS1","LOCALS",0)
  InParty("Sarevok")
  See("Sarevok")
  InParty("Imoen2")
  See("Imoen2")
  Global("firstmeet","LOCALS",1)
  !Global("tortureS2","LOCALS",1)
  !StateCheck("Sarevok",STATE_SLEEPING)~ THEN BKIDO25 planofyoufail1
  @30
DO ~SetGlobal("tortureS1","LOCALS",1)~
 == BSAREV25
 @31
 == BKIDO25
 @32
 == BSAREV25
 @33
 == BIMOEN25
 @34
 == BSAREV25
 @35 
EXIT

CHAIN
  IF ~Global("tortureS2","LOCALS",0)
  InParty("Sarevok")
  See("Sarevok")
  !InParty("Imoen2")
  Global("firstmeet","LOCALS",1)
  !Global("tortureS1","LOCALS",1)
  !StateCheck("Sarevok",STATE_SLEEPING)~ THEN BKIDO25 planofyoufail2
  @30
DO ~SetGlobal("tortureS2","LOCALS",1)~
 == BSAREV25
 @31
 == BKIDO25
 @36
 == BSAREV25
 @37
 == BKIDO25
 @38
 == BSAREV25 
 @39
 == BKIDO25
 @40
EXIT

CHAIN
  IF ~Global("lovepixie","LOCALS",0)
  InParty("Aerie")
  See("Aerie")
  !StateCheck("Aerie",STATE_SLEEPING)~ THEN BKIDO25 becomepixie
  @41
DO ~SetGlobal("lovepixie","LOCALS",1)~
 == BAERIE25
 @42
 == BKIDO25
 @43
 == BAERIE25
 @44
 == BKIDO25
 @45
 == BAERIE25
 @46
 == BKIDO25
 @47
EXIT

CHAIN
  IF ~Global("longroad","GLOBAL",0)
  InParty("Korgan")
  See("Korgan")
  !StateCheck("Korgan",STATE_SLEEPING)~ THEN BKIDO25 battlesong
  @48
DO ~SetGlobal("longroad","GLOBAL",1)~
 == BKORGA25
 @49
 == BKIDO25
 @50
 == BKORGA25
 @51
 == BKIDO25
 @52
 =
 @53
 =
 @54
=
 @55
 == BKORGA25
 @56
 == BKIDO25
 @57
EXIT

CHAIN
  IF ~Global("mightygnome","LOCALS",0)
  InParty("Jan")
  See("Jan")
  !StateCheck("Jan",STATE_SLEEPING)~ THEN BKIDO25 bestgnome
  @58
DO ~SetGlobal("mightygnome","LOCALS",1)~
 == BJAN25
 @59
 == BKIDO25
 @60
 == BJAN25
 @61
 == BKIDO25
 @62 
EXIT

CHAIN
  IF ~Global("revengetime","LOCALS",0)
  InParty("Viconia")
  See("Viconia")
  !StateCheck("Viconia",STATE_SLEEPING)~ THEN BKIDO25 strikebackatv
  @63
DO ~SetGlobal("revengetime","LOCALS",1)~
 == BVICON25
 @64
 == BKIDO25
 @65
 == BVICON25
 @66
 == BKIDO25
 @67
 == BVICON25
 @68
 == BKIDO25
 @69
EXIT

CHAIN
  IF ~Global("theplanes","LOCALS",0)
  InParty("HaerDalis")
  See("HaerDalis")
  !StateCheck("HaerDalis",STATE_SLEEPING)~ THEN BKIDO25 planesop
  @70
DO ~SetGlobal("theplanes","LOCALS",1)~
 == BHAERD25
 @71
 == BKIDO25
 @72
 == BHAERD25
 @73
 == BKIDO25
 @74
 == BHAERD25
 @75
 == BKIDO25
 @76
 == BHAERD25
 @77
 == BKIDO25
 @78
 == BHAERD25
 @79
 == BKIDO25
 @80
 == BHAERD25
 @81
EXIT

CHAIN
  IF ~Global("peril","LOCALS",0)
  InParty("Edwin")
  See("Edwin")
  !StateCheck("Edwin",STATE_SLEEPING)~ THEN BKIDO25 whyconjurer
  @82
DO ~SetGlobal("peril","LOCALS",1)~
 == BEDWIN25
 @83
 == BKIDO25
 @84
 == BEDWIN25
 @85
 == BKIDO25
 @86
EXIT

CHAIN
  IF ~Global("epichalffigh","LOCALS",0)
  InParty("Mazzy")
  See("Mazzy")
  !StateCheck("Mazzy",STATE_SLEEPING)~ THEN BKIDO25 bigsmall
  @87
DO ~SetGlobal("epichalffigh","LOCALS",1)~
 == BMAZZY25
 @88
 == BKIDO25
 @89
 == BMAZZY25
 @90
 == BKIDO25
 @91
 == BMAZZY25
 @92
 == BKIDO25
 @93
 == BMAZZY25
 @94
 == BKIDO25
 @95
 == BMAZZY25
 @96
 == BKIDO25
 @97
EXIT

CHAIN
  IF ~Global("crazytrans","LOCALS",0)
  InParty("Cernd")
  See("Cernd")
  !StateCheck("Cernd",STATE_SLEEPING)~ THEN BKIDO25 trycerndagain
  @98
DO ~SetGlobal("crazytrans","LOCALS",1)~
 == BCERND25
 @99
 == BKIDO25
 @100
 == BCERND25
 @101
 == BKIDO25
 @102
 == BCERND25
 @103
 == BKIDO25
 @104
 == BCERND25
 @105
 == BKIDO25
 @106
 == BCERND25
 @107
 == BKIDO25
 @108
EXIT

CHAIN
  IF ~Global("showprideba","LOCALS",0)
  InParty("Anomen")
  See("Anomen")
  Global("AnomenIsNotKnight","GLOBAL",1)
  !StateCheck("Anomen",STATE_SLEEPING)~ THEN BKIDO25 dareanomen
  @109
DO ~SetGlobal("showprideba","LOCALS",1)~
 == BANOME25
 @110
 == BKIDO25
 @111
 == BANOME25
 @112
 == BKIDO25
 @113
 == BANOME25
 @114
 == BKIDO25
 @115
EXIT

CHAIN
  IF ~Global("KandAcombat25","GLOBAL",0)
  InParty("DKido")
  See("DKido")
  Global("AnomenIsKnight","GLOBAL",1)
  !StateCheck("DKido",STATE_SLEEPING)~ THEN BANOMEN killkido25
  @116
DO ~SetGlobal("KandAcombat25","GLOBAL",1)~
 == BKIDO
 @117
 == BANOMEN
 @118
 == BKIDO
 @119
 == BANOMEN
 @120 DO ~ClearAllActions() ActionOverride(Anomen,Attack("DKido")) ActionOverride(DKido,Attack("Anomen"))~
EXIT

APPEND ANOMENJ
IF ~Global("finalconAak25","GLOBAL",1)
  See("Player1")
  Dead("DKido")
  Global("KandAcombat25","GLOBAL",1)
  !StateCheck("Player1",STATE_SLEEPING)~ THEN BEGIN lastquabkijo25
 SAY @121
  IF ~Alignment(Player1,MASK_GOOD)~ THEN REPLY @122 DO ~SetGlobal("finalconAak25","GLOBAL",2)~ GOTO iundnow25
  IF ~~ THEN REPLY @123 DO ~SetGlobal("finalconAak25","GLOBAL",2)~ GOTO iundnow25
  IF ~~ THEN REPLY @124 DO ~SetGlobal("finalconAak25","GLOBAL",2)~ GOTO iundnow25
  IF ~~ THEN REPLY @125 DO ~SetGlobal("finalconAak25","GLOBAL",2)~ GOTO iundnow25
  IF ~Alignment(Player1,MASK_EVIL)~ THEN REPLY @126 DO ~SetGlobal("finalconAak25","GLOBAL",2)~ GOTO fightpla125
END

IF ~Global("Anofightplay25","GLOBAL",0)
  See("Player1")
  Dead("DKido")
  Global("KandAcombat25","GLOBAL",1)
  Global("finalconAak25","GLOBAL",2)
  !StateCheck("Player1",STATE_SLEEPING)~ THEN BEGIN fightpla125
 SAY @127  IF ~~ THEN DO ~SetGlobal("Anofightplay25","GLOBAL",1) ClearAllActions() Attack("Player1")~ EXIT
END

IF ~Global("Anomundnow25","GLOBAL",0)
  See("Player1")
  Dead("DKido")
  Global("KandAcombat25","GLOBAL",1)
  Global("finalconAak25","GLOBAL",2)
  !StateCheck("Player1",STATE_SLEEPING)~ THEN BEGIN iundnow25
 SAY @128
  IF ~~ THEN DO ~SetGlobal("Anomundnow25","GLOBAL",1)~ EXIT
END
END

CHAIN
  IF ~Global("troublewithme","LOCALS",0)
  InParty("Valygar")
  See("Valygar")
  !StateCheck("DKido",STATE_SLEEPING)~ THEN BKIDO25 hastimecome
  @129
DO ~SetGlobal("troublewithme","LOCALS",1)~
 == BVALYG25
 @130
 == BKIDO25
 @131
 == BVALYG25
 @132
 == BKIDO25
 @133
 == BVALYG25
 @134
EXIT

CHAIN
  IF ~Global("powerfullNalia","GLOBAL",0)
  InParty("Nalia")
  See("Nalia")
  !StateCheck("Nalia",STATE_SLEEPING)~ THEN BKIDO25 begincorrupt
  @135
DO ~SetGlobal("powerfullNalia","GLOBAL",1)~
 == BNALIA25
 @136
 == BKIDO25
 @137
 == BNALIA25
 @138
 == BKIDO25
 @139 
 == BNALIA25
 @140
 == BKIDO25
 @141
 == BNALIA25
 @142
EXIT

CHAIN
  IF ~Global("corruption","GLOBAL",0)
  InParty("Nalia")
  See("Nalia")
  Global("noremorse","GLOBAL",1)
  Global("powerfullNalia","GLOBAL",1)
  !StateCheck("Nalia",STATE_SLEEPING)~ THEN BKIDO25 endcorrupt
  @143
DO ~SetGlobal("corruption","GLOBAL",1)~
 == BNALIA25
 @144
 == BKIDO25
 @145
 == BNALIA25
 @146
 == BKIDO25
 @147
 =
 @148
 == BNALIA25
 @149
 END
 IF ~~ THEN REPLY @150 EXTERN BNALIA25 corrupted
 IF ~~ THEN REPLY @151 EXTERN BNALIA25 corrupted
 IF ~~ THEN REPLY @152 EXTERN BNALIA25 notcorrupted

APPEND BNALIA25
IF ~Global("Nalcor","GLOBAL",0)
  InParty("DKido")
  See("DKido")
  Global("corruption","GLOBAL",1)
  Global("noremorse","GLOBAL",1)
  Global("powerfullNalia","GLOBAL",1)
  !StateCheck("DKido",STATE_SLEEPING)~ THEN BEGIN corrupted
 SAY @153
 IF ~~ THEN DO ~SetGlobal("Nalcor","GLOBAL",1) ChangeAlignment(CHAOTIC_NEUTRAL) SetGlobal("ALIGN_CHANGE","LOCALS",1)~ EXIT
END

IF ~Global("Nalnocor","GLOBAL",0)
  InParty("DKido")
  See("DKido")
  Global("corruption","GLOBAL",1)
  Global("noremorse","GLOBAL",1)
  Global("powerfullNalia","GLOBAL",1)
  !StateCheck("DKido",STATE_SLEEPING)~ THEN BEGIN notcorrupted
 SAY @154
 IF ~~ THEN DO ~SetGlobal("Nalnocor","GLOBAL",1)~ EXIT
END
END

CHAIN
  IF ~Global("Iwillgo25","GLOBAL",0)
  InParty("DKido")
  See("DKido")
  !StateCheck("DKido",STATE_SLEEPING)~ THEN BKELDO25 KidoKeldorn125
  @155
DO ~SetGlobal("Iwillgo25","GLOBAL",1)~
 == BKIDO25
 @156
 == BKELDO25
 @157
 == BKIDO25
 @158
 == BKELDO25
 @159  
END
 IF ~~ THEN REPLY @160 EXTERN BKIDO Kiwilepa25
 IF ~~ THEN REPLY @161 EXTERN BKELDOR Kewilepa25

CHAIN
  IF ~Global("Kidwilleapar25","GLOBAL",0)
  See("Player1")
  Global("Iwillgo25","GLOBAL",1)
  !StateCheck("Player1",STATE_SLEEPING)~ THEN BKIDO Kiwilepa25
  @162
DO ~ SetGlobal("Kidwilleapar25","GLOBAL",1) LeaveParty() EscapeArea()~
EXIT

APPEND BKELDOR
  IF ~Global("Kelwilleapar25","GLOBAL",0)
  See("Player1")
  Global("Iwillgo25","GLOBAL",1)
  !StateCheck("Player1",STATE_SLEEPING)~ THEN BEGIN Kewilepa25
 SAY @163
 IF ~~ THEN DO ~SetGlobal("Kelwilleapar25","GLOBAL",1) LeaveParty() EscapeArea()~ EXIT
END
END
