BEGIN ~7XQUAYB~

IF WEIGHT #-96~Global("QuayleWineTalk","GLOBAL",1)~ THEN BEGIN QuayleWineTalk
SAY @0
=
@1 
IF ~~ THEN DO ~SetGlobal("QuayleWineTalk","GLOBAL",2)~ EXIT
END

IF WEIGHT #-96~NumInPartyGT("4")Global("7XQUAYGroupAdvice","GLOBAL",2)~ THEN BEGIN 7XQUAYGroupAdvice1
SAY @2
IF ~~ THEN DO ~SetGlobal("7XQUAYGroupAdvice","GLOBAL",3)~ EXIT
END

IF WEIGHT #-96~AreaCheck("AR1002")
  Global("7XQUAYAR1002","GLOBAL",1)~ THEN BEGIN QuayleCouncilComment
SAY @3
=
@4 
IF~~THEN DO ~SetGlobal("7XQUAYAR1002","GLOBAL",2)~ EXIT
END

CHAIN IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)InParty("Aerie") !StateCheck("Aerie",CD_STATE_NOTVALID)
Global("AerieQTalk","GLOBAL",0)~ THEN BAERIE AerieQuayleTalk1
@5
=
@6
DO ~SetGlobal("AerieQTalk","GLOBAL",1)~
== 7XQUAYB
@7
=
@8
=
@9
== BAERIE
@10
=
@11
== 7XQUAYB
@12
EXIT


CHAIN
IF WEIGHT #-100 ~Global("TiaxQuayle","GLOBAL",0) See("7XQUAY")InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)
See("7XTIAX")InParty("7XTIAX")
!StateCheck("7XTIAX",CD_STATE_NOTVALID)~ THEN 7XTIAXB QuayleTiaxBanter1
@13
=
@14
DO ~SetGlobal("TiaxQuayle","GLOBAL",1)~
== 7XQUAYB @15
== 7XTIAXB @16
=
@17
== 7XQUAYB @18
== 7XTIAXB @19
== 7XQUAYB @20
=
@21
=
@22
== 7XTIAXB @23
== 7XQUAYB @24
=
@25
EXIT


CHAIN IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)InParty("Jan")
Range("Jan",30)!StateCheck("Jan",CD_STATE_NOTVALID)Global("7XQUAYJanbANTER","GLOBAL",0)~ THEN BJAN 7XQUAYJAN1
@26
=
@27 DO ~SetGlobal("7XQUAYJanbANTER","GLOBAL",1)~
== 7XQUAYB @28
=
@29
== BJAN @30
== 7XQUAYB @31
=
@32
=
@33
=
@34
=
@35
=
@36
=
@37
=
@38
=
@39
=
@40
== BJAN @41
== 7XQUAYB @42 
== BJAN @43
=
@44
== 7XQUAYB @45
== BJAN @46
== 7XTIAXB IF ~InParty("7XTIAX")
!StateCheck("7XTIAX",CD_STATE_NOTVALID)~ THEN @47
EXIT

CHAIN
IF ~InParty("Jaheira")
InParty("7XQUAY")
!StateCheck("7XQUAY",CD_STATE_NOTVALID)
IsValidForPartyDialog("Jaheira")
HPPercentGT("7XQUAY",20)
Global("JahQuayle","GLOBAL",0)~ THEN BJAHEIR JahQuayle01
@48
=
@49
DO ~SetGlobal("JahQuayle","GLOBAL",1)~
== 7XQUAYB
@50
=
@51
== BJAHEIR
@52
=
@53
== 7XQUAYB @54
== BJAHEIR
@55 DO ~ApplyDamage("7XQUAY",2,SLASHING)~ 
== 7XQUAYB @56
== BJAHEIR @57
EXIT


CHAIN IF ~InParty("Korgan")See("Korgan")!StateCheck("Korgan",STATE_SLEEPING)InParty("7XQUAY")
!StateCheck("7XQUAY",CD_STATE_NOTVALID)Global("QUAYLEKorgan","GLOBAL",0)~ THEN 7XQUAYB QUAYLEkorgan1
@58
=
@59
DO ~SetGlobal("QUAYLEKorgan","GLOBAL",1)~
== BKORGAN @60
=
@61
== 7XQUAYB @62
== BKORGAN @63
== 7XQUAYB @64
EXIT


CHAIN IF ~Global("MinscQuayle","GLOBAL",0)InParty("Minsc")IsValidForPartyDialog("Minsc")See("Minsc")InParty("7XQUAY")
!StateCheck("7XQUAY",CD_STATE_NOTVALID)CombatCounter(0)~ THEN 7XQUAYB MinscQuayle1
  @65
=
@66 
=
@67 DO ~SetGlobal("MinscQuayle","GLOBAL",1)~
 == BMINSC @68
 == 7XQUAYB @69
 == BMINSC @70
 == 7XQUAYB @71
 == BMINSC @72
=
@73
EXIT

CHAIN IF ~InParty("Valygar")IsValidForPartyDialog("Valygar")
See("Valygar")InParty("7XQUAY")
!StateCheck("7XQUAY",CD_STATE_NOTVALID)
Global("QuayleValygar","GLOBAL",0)~ THEN 7XQUAYB QuayleValygar1
@74 DO ~SetGlobal("QuayleValygar","GLOBAL",1)~
== BVALYGA @75
== 7XQUAYB  @76
=
@77
=
@78
== BVALYGA @79
== 7XQUAYB  @80
=
@81
== BVALYGA @82
== 7XQUAYB  @83
=
@84
== BVALYGA @85
== 7XQUAYB  @86
EXIT


CHAIN
IF ~InParty("Mazzy")
See("Mazzy")
!StateCheck("Mazzy",STATE_SLEEPING)InParty("7XQUAY")
!StateCheck("7XQUAY",CD_STATE_NOTVALID)
Global("MazzyQuayle","GLOBAL",0)~ THEN 7XQUAYB MazzyQuayle1
@87
=
@88 
DO ~SetGlobal("MazzyQuayle","GLOBAL",1)~
== BMAZZY @89
=
@90
== 7XQUAYB  @91
=
@92
=
@93
== BMAZZY @94
== 7XQUAYB @95
=
@96
=
@97
== BMAZZY @98
=
@99
=
@100
== 7XQUAYB @101
EXIT

CHAIN
IF ~Global("TiaxQuayle","GLOBAL",1)InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)
See("7XTIAX")InParty("7XTIAX")!StateCheck("7XTIAX",CD_STATE_NOTVALID)~ THEN 7XTIAXB QuayleTiaxBanter2
@102 
DO ~SetGlobal("TiaxQuayle","GLOBAL",2)~
== 7XQUAYB @103
== 7XTIAXB @104
=
@105
== 7XQUAYB @106
=
@107
== 7XTIAXB @108
=
@109
== 7XQUAYB @110
=
@111
== 7XTIAXB @112
=
@113
EXIT

CHAIN IF ~InParty("Korgan")See("Korgan")!StateCheck("Korgan",STATE_SLEEPING)InParty("7XQUAY")
!StateCheck("7XQUAY",CD_STATE_NOTVALID)Global("QUAYLEKorgan","GLOBAL",1)~ THEN ~BKORGAN~ QUAYLEkorgan2
@114 
DO ~SetGlobal("QUAYLEKorgan","GLOBAL",2)~
== 7XQUAYB @115
=
@116
== BKORGAN @117
=
@118
== 7XQUAYB @119
=
@120
=
@121
=
@122
== BKORGAN @123 DO ~ApplyDamage("Korgan",5,SLASHING)~ 
EXIT



CHAIN IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)InParty("Jan")Range("Jan",30)
!StateCheck("Jan",CD_STATE_NOTVALID)Global("7XQUAYJanbANTER","GLOBAL",1)~ THEN BJAN 7XQUAYJAN2
@124 DO ~SetGlobal("7XQUAYJanbANTER","GLOBAL",2)~
== 7XQUAYB @125
=
@126
=
@127
=
@128
== BJAN @129
== 7XQUAYB @130
=
@131
=
@132
=
@133
== BJAN @134
== 7XQUAYB @135
=
@136
=
@137
=
@138
== BJAN @139
== 7XQUAYB @140
EXIT


CHAIN
IF ~Global("TiaxQuayle","GLOBAL",2)See("7XQUAY")InParty("7XQUAY")
!StateCheck("7XQUAY",CD_STATE_NOTVALID)See("7XTIAX")InParty("7XTIAX")
!StateCheck("7XTIAX",CD_STATE_NOTVALID)~ THEN 7XQUAYB QuayleBanter3
@141
DO ~SetGlobal("TiaxQuayle","GLOBAL",3)~
== 7XTIAXB @142
== 7XQUAYB @143
=
@144
== 7XTIAXB @145
== 7XQUAYB @146
=
@147
== 7XTIAXB @148
== 7XQUAYB @149
EXIT

CHAIN IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)InParty("Jan")Range("Jan",30)
!StateCheck("Jan",CD_STATE_NOTVALID)Global("7XQUAYJanbANTER","GLOBAL",2)~ THEN BJAN 7XQUAYJAN3
@150 DO ~SetGlobal("7XQUAYJanbANTER","GLOBAL",3)~
== BJAN @151
== 7XQUAYB @152
== BJAN @153
== 7XQUAYB @154
=
@155
== BJAN @156
== 7XQUAYB @157 
EXIT

CHAIN IF ~Global("TiaxQuayle","GLOBAL",3)See("7XQUAY")InParty("7XQUAY")
!StateCheck("7XQUAY",CD_STATE_NOTVALID)See("7XTIAX")InParty("7XTIAX")
!StateCheck("7XTIAX",CD_STATE_NOTVALID)~ THEN 7XQUAYB QuayleBanter4
@158
DO ~SetGlobal("TiaxQuayle","GLOBAL",4)~
== 7XTIAXB @159
== 7XQUAYB @160
== 7XTIAXB @161
=
@162
== 7XQUAYB @163
== 7XTIAXB @164
== 7XQUAYB @165
EXIT


CHAIN
IF ~Global("TiaxQuayle","GLOBAL",4)
	See("7XQUAY")
	InParty("7XQUAY")
!StateCheck("7XQUAY",CD_STATE_NOTVALID)
See("7XTIAX")
	InParty("7XTIAX")
!StateCheck("7XTIAX",CD_STATE_NOTVALID)~ THEN 7XQUAYB QuayleBanter5
@166
=
@167
DO ~SetGlobal("TiaxQuayle","GLOBAL",5)~
== 7XTIAXB @168 
== 7XQUAYB @169
== 7XTIAXB @170 
== 7XQUAYB @171 
== 7XTIAXB @172  
EXIT




//////////////////////////////////////////////////////////////////////////////

I_C_T VICONI 0 QuayleViconia-0
  == 7XQUAYJ   IF ~InParty("7XQUAY")
!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN @173 
END


INTERJECT_COPY_TRANS RUFPAL2 5 QuayleRUFPAL2-5
== 7XQUAYJ   IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @174
END



INTERJECT_COPY_TRANS HENDAK 1 QUAYLEHENDAK1
== 7XQUAYJ   IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@175
END



INTERJECT_COPY_TRANS SEWERM1 13 QUAYLESEWERM1-13
== 7XQUAYJ   IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @176
END



INTERJECT_COPY_TRANS SEWERM1 23 QUAYLESEWERM1-23
== 7XQUAYJ   IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @177
END


INTERJECT_COPY_TRANS TOLGER 75 QUAYLETOLGER75
== 7XQUAYJ   IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @178
=
@179
END




INTERJECT_COPY_TRANS TOLGER 84 QUAYLETOLGER84
== 7XQUAYJ   IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @180
== TOLGER @181
END


INTERJECT_COPY_TRANS VALYGAR 8 QUAYLEVALYGAR8
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @182
END

INTERJECT_COPY_TRANS FIRKRA01 9 QUAYLEFIRKRA01-9
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@183
END


INTERJECT_COPY_TRANS RENFELD 6 QUAYLERENFELD6
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @184
END




CHAIN
IF ~IsGabber("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN CELVAN QUAYLECELVAN
@185
=
@186
== 7XQUAYJ @187
EXTERN CELVAN 1



INTERJECT_COPY_TRANS RENAL 30 QUAYLERENAL30
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @188
END

INTERJECT_COPY_TRANS EDWIN 26 QUAYLEEDWIN26
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @189
END



INTERJECT_COPY_TRANS RENAL 69 QUAYLERENAL69
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @190
END



INTERJECT_COPY_TRANS GAAL 4 QUAYLEGAAL4
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @191
END

INTERJECT_COPY_TRANS GAAL 20 QUAYLEGAAL20
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @192
=
@193
END


INTERJECT_COPY_TRANS SCSARLES 11 QUAYLESCSARLES11
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @194
END


INTERJECT_COPY_TRANS DELON 4 QUAYLEDELON4
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@195
END

INTERJECT_COPY_TRANS DELON 15 QUAYLEDELON15
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
 @196
END



I_C_T BOOTER 10 Quaylebooter
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@197
END

I_C_T ARNBOY01 0 Quaylearnboy01
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@198
END

I_C_T BHOISIG 19 Quaylebhoisig
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@199
=
@200
END


I_C_T BHARVAL 17 Quaylebharval
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@199
=
@200
END

I_C_T BMERCH1 2 Quaylebmerch1
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@201
END


I_C_T BODHI2 12 Quaylebodhi2
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@202
END

I_C_T C6CORAN 6 Quaylecoran
  == 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@203
END


I_C_T SAFE EDWIN 49 Quayleedwin2
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@204
  == EDWIN @205
END



I_C_T UHOGRE01 6 Quayleuhogre01
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@206
END

INTERJECT_COPY_TRANS BEGGAR2 6 QuayleBEGGAR2-6
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@207
=
@208
END

INTERJECT_COPY_TRANS BEGGAR1 1 QuayleBEGGAR1-1
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@209
END

INTERJECT_COPY_TRANS BEGGAR3 1 QuayleBEGGAR3-1
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@210
END


INTERJECT_COPY_TRANS FIRKRA01 9 QuayleFIRKRA01-9
== 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@211
==FIRKRA01 IF~IsValidForPartyDialogue("Rylorn")~THEN
@212
END

I_C_T FIRKRA02 15 Quaylefirkraag2
  == 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@213
END


I_C_T EDWIN 0 QuayleEDWIN-0
  == 7XQUAYJ IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN
@214
END

// Hell
I_C_T PLAYER1 25 7xQuayle_Hell
  == 7XQUAYJ IF ~InParty("7XQUAY") !StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN @220
END

// Tree of Life
INTERJECT PLAYER1 33 TreeOLifeQuayle1
== PLAYER1 IF ~InParty("7XQUAY")!StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN @215
END
++ @216 EXTERN 7XQUAYJ TreeOLifeQuayle2
++ @217 EXTERN 7XQUAYJ TreeOLifeQuayle2
++ @218 EXTERN 7XQUAYJ TreeOLifeQuayle2

APPEND 7XQUAYJ
IF ~~ THEN BEGIN TreeOLifeQuayle2
SAY @219
COPY_TRANS PLAYER1 33
END
END

INTERJECT_COPY_TRANS3 IF_FILE_EXISTS OHNMERET 16 7XQUAYOHNMERET-16
== 7XQUAYJ IF ~InParty("7XQUAY") InMyArea("7XQUAY") !StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN @221
=@222
== AERIEJ IF ~InParty("Aerie") InMyArea("Aerie") !StateCheck("Aerie",CD_STATE_NOTVALID) InParty("7XQUAY") InMyArea("7XQUAY") !StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN @223
== OHNMERET IF ~InParty("7XQUAY") InMyArea("7XQUAY") !StateCheck("7XQUAY",CD_STATE_NOTVALID)~ THEN @224
END