IF
  Clicked([ANYONE])
  Range(LastTrigger,16)
  Global("BhaalDoor","GLOBAL",0)
THEN
  RESPONSE #100
    DisplayString(Myself,300) // Five eyes surround this hellish door, as if part of the very stone itself. The eyes follow you as you move, and a palpable aura of evil emanates from them. They guard this door and if you wish to pass through, you must find some way of bypassing their guard.
    SetGlobal("BhaalDoor","GLOBAL",1)
    SaveGame(2)
END

IF
  Clicked([ANYONE])
  Range(LastTrigger,16)
  !PartyHasItem("miscb5") // Tears of Bhaal
  !PartyHasItem("miscb6") // Tears of Bhaal
  !PartyHasItem("miscb7") // Tears of Bhaal
  !PartyHasItem("miscb8") // Tears of Bhaal
  !PartyHasItem("miscb9") // Tears of Bhaal
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    DisplayString(Myself,301) // With the tools you currently have, there is no way to close the eyes or open the door. The answer must be found elsewhere.
END

IF
  Clicked([ANYONE])
  !InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    DisplayString(Myself,6459) // Only <CHARNAME> may use the Tear of Bhaal.
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb5") // Tears of Bhaal
  GlobalLT("Player1Fear","GLOBAL",2)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[1850.433])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,6473) // You have become immune to +1 weapons and less.
    TakePartyItem("miscb5") // Tears of Bhaal
    CloseDoor("Eye01")
    SetGlobal("TearEye1","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpell(Player1,HELL_FEAR_GOOD)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb5") // Tears of Bhaal
  Global("Player1Fear","GLOBAL",2)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[1850.433])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,6470) // You have been granted +2 to your constitution.
    TakePartyItem("miscb5") // Tears of Bhaal
    CloseDoor("Eye01")
    SetGlobal("TearEye1","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpell(Player1,HELL_FEAR_EVIL)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb5") // Tears of Bhaal
  Global("Player1Fear","GLOBAL",3)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[1850.433])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,@151) // No such index
    TakePartyItem("miscb5") // Tears of Bhaal
    CloseDoor("Eye01")
    SetGlobal("TearEye1","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpellRES("SPHL001",Player1)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb6") // Tears of Bhaal
  GlobalLT("Player1Selfish","GLOBAL",2)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[1868.306])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,6477) // You have been granted +10% magic resistance.
    TakePartyItem("miscb6") // Tears of Bhaal
    CloseDoor("Eye02")
    SetGlobal("TearEye2","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpell(Player1,HELL_SELFISH_GOOD)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb6") // Tears of Bhaal
  Global("Player1Selfish","GLOBAL",2)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[1868.306])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,6474) // You have been granted +2 to your armor class.
    TakePartyItem("miscb6") // Tears of Bhaal
    CloseDoor("Eye02")
    SetGlobal("TearEye2","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpell(Player1,HELL_SELFISH_EVIL)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb6") // Tears of Bhaal
  Global("Player1Selfish","GLOBAL",3)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[1868.306])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,@152) // No such index
    TakePartyItem("miscb6") // Tears of Bhaal
    CloseDoor("Eye02")
    SetGlobal("TearEye2","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpellRES("SPHL002",Player1)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb7") // Tears of Bhaal
  GlobalLT("Player1Greed","GLOBAL",2)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[2015.182])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,61968) // You have been granted +2 to all of your saving throws.
    TakePartyItem("miscb7") // Tears of Bhaal
    CloseDoor("Eye03")
    SetGlobal("TearEye3","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpell(Player1,HELL_GREED_GOOD)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb7") // Tears of Bhaal
  Global("Player1Greed","GLOBAL",2)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[2015.182])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,6478) // You have been granted +15 to your hit points.
    TakePartyItem("miscb7") // Tears of Bhaal
    CloseDoor("Eye03")
    SetGlobal("TearEye3","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpell(Player1,HELL_GREED_EVIL)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb7") // Tears of Bhaal
  Global("Player1Greed","GLOBAL",3)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[2015.182])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,@153) // No such index
    TakePartyItem("miscb7") // Tears of Bhaal
    CloseDoor("Eye03")
    SetGlobal("TearEye3","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpellRES("SPHL003",Player1)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb8") // Tears of Bhaal
  GlobalLT("Player1Pride","GLOBAL",2)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[2161.323])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,61970) // You have been granted +20% resistance to fire, cold and electricity.
    TakePartyItem("miscb8") // Tears of Bhaal
    CloseDoor("Eye04")
    SetGlobal("TearEye4","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpell(Player1,HELL_PRIDE_GOOD)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb8") // Tears of Bhaal
  Global("Player1Pride","GLOBAL",2)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[2161.323])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,61969) // You have been granted +200000 XP.
    TakePartyItem("miscb8") // Tears of Bhaal
    CloseDoor("Eye04")
    SetGlobal("TearEye4","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpell(Player1,HELL_PRIDE_EVIL)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb8") // Tears of Bhaal
  Global("Player1Pride","GLOBAL",3)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[2161.323])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,@154) // No such index
    TakePartyItem("miscb8") // Tears of Bhaal
    CloseDoor("Eye04")
    SetGlobal("TearEye4","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpellRES("SPHL004",Player1)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb9") // Tears of Bhaal
  GlobalLT("Player1Wrath","GLOBAL",2)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[2174.451])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,61972) // You have been granted +1 to your wisdom and charisma.
    TakePartyItem("miscb9") // Tears of Bhaal
    CloseDoor("Eye05")
    SetGlobal("TearEye5","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpell(Player1,HELL_WRATH_GOOD)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb9") // Tears of Bhaal
  Global("Player1Wrath","GLOBAL",2)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[2174.451])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,61971) // You have been granted +2 to your strength.
    TakePartyItem("miscb9") // Tears of Bhaal
    CloseDoor("Eye05")
    SetGlobal("TearEye5","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpell(Player1,HELL_WRATH_EVIL)
END

IF
  Clicked([ANYONE])
  InPartySlot(LastTrigger,0)
  Range(LastTrigger,16)
  PartyHasItem("miscb9") // Tears of Bhaal
  Global("Player1Wrath","GLOBAL",3)
  Global("BhaalDoor","GLOBAL",1)
THEN
  RESPONSE #100
    ScreenShake([4.4],5)
    CreateVisualEffect("spnpoisi",[2174.451])
    PlaySound("EFF_M18a")
    Wait(1)
    DisplayString(Myself,302) // You take a Tear of Bhaal from your pack and place it in an eye. The eye closes and guards the door no longer.
    DisplayStringHead(Player1,@155) // No such index
    TakePartyItem("miscb9") // Tears of Bhaal
    CloseDoor("Eye05")
    SetGlobal("TearEye5","GLOBAL",1)
    IncrementGlobal("TearDoor","GLOBAL",1)
    ApplySpellRES("SPHL005",Player1)
END

IF
  Clicked([ANYONE])
  !Range(LastTrigger,16)
THEN
  RESPONSE #100
    DisplayString(Myself,14702) // You are too far away to use that.
END

IF
  Global("TearDoor","GLOBAL",15)
  GlobalGT("C7Counter","GLOBAL",7)
  !Alignment(Player1,MASK_GOOD)
THEN
  RESPONSE #100
    SetGlobal("C7AlignmentAdjust","GLOBAL",1)
    Continue()
END

IF
  Global("TearDoor","GLOBAL",15)
  GlobalLT("C7Counter","GLOBAL",3)
  !Alignment(Player1,MASK_EVIL)
THEN
  RESPONSE #100
    SetGlobal("C7AlignmentAdjust","GLOBAL",2)
    Continue()
END

IF
  Global("TearDoor","GLOBAL",15)
  GlobalLT("C7Counter","GLOBAL",8)
  GlobalGT("C7Counter","GLOBAL",2)
  !Alignment(Player1,MASK_GENEUTRAL)
THEN
  RESPONSE #100
    SetGlobal("C7AlignmentAdjust","GLOBAL",3)
    Continue()
END

IF
  Global("C7AlignmentAdjust","GLOBAL",1)
  Alignment(Player1,LAWFUL_NEUTRAL)
THEN
  RESPONSE #100
    ChangeAlignment(Player1,LAWFUL_GOOD)
    SetGlobal("C7AlignmentAdjust","GLOBAL",4)
    DisplayStringHead(Player1,@156) // No such index
    Continue()
END

IF
  Global("C7AlignmentAdjust","GLOBAL",1)
  OR(2)
    Alignment(Player1,MASK_LCNEUTRAL)
    Alignment(Player1,LAWFUL_EVIL)
THEN
  RESPONSE #100
    ChangeAlignment(Player1,NEUTRAL_GOOD)
    SetGlobal("C7AlignmentAdjust","GLOBAL",4)
    DisplayStringHead(Player1,@157) // No such index
    Continue()
END

IF
  Global("C7AlignmentAdjust","GLOBAL",1)
  Alignment(Player1,MASK_CHAOTIC)
THEN
  RESPONSE #100
    ChangeAlignment(Player1,CHAOTIC_GOOD)
    SetGlobal("C7AlignmentAdjust","GLOBAL",4)
    DisplayStringHead(Player1,@158) // No such index
    Continue()
END

IF
  Global("C7AlignmentAdjust","GLOBAL",2)
  Alignment(Player1,MASK_LAWFUL)
THEN
  RESPONSE #100
    ChangeAlignment(Player1,LAWFUL_EVIL)
    SetGlobal("C7AlignmentAdjust","GLOBAL",4)
    DisplayStringHead(Player1,@159) // No such index
    Continue()
END

IF
  Global("C7AlignmentAdjust","GLOBAL",2)
  Alignment(Player1,MASK_LCNEUTRAL)
THEN
  RESPONSE #100
    ChangeAlignment(Player1,NEUTRAL_EVIL)
    SetGlobal("C7AlignmentAdjust","GLOBAL",4)
    DisplayStringHead(Player1,@160) // No such index
    Continue()
END

IF
  Global("C7AlignmentAdjust","GLOBAL",2)
  Alignment(Player1,MASK_CHAOTIC)
THEN
  RESPONSE #100
    ChangeAlignment(Player1,CHAOTIC_EVIL)
    SetGlobal("C7AlignmentAdjust","GLOBAL",4)
    DisplayStringHead(Player1,@161) // No such index
    Continue()
END

IF
  Global("C7AlignmentAdjust","GLOBAL",3)
  Alignment(Player1,MASK_LAWFUL)
THEN
  RESPONSE #100
    ChangeAlignment(Player1,LAWFUL_NEUTRAL)
    SetGlobal("C7AlignmentAdjust","GLOBAL",4)
    DisplayStringHead(Player1,@162) // No such index
    Continue()
END

IF
  Global("C7AlignmentAdjust","GLOBAL",3)
  Alignment(Player1,MASK_LCNEUTRAL)
THEN
  RESPONSE #100
    ChangeAlignment(Player1,NEUTRAL)
    SetGlobal("C7AlignmentAdjust","GLOBAL",4)
    DisplayStringHead(Player1,@163) // No such index
    Continue()
END

IF
  Global("C7AlignmentAdjust","GLOBAL",3)
  Alignment(Player1,MASK_CHAOTIC)
THEN
  RESPONSE #100
    ChangeAlignment(Player1,CHAOTIC_NEUTRAL)
    SetGlobal("C7AlignmentAdjust","GLOBAL",4)
    DisplayStringHead(Player1,@164) // No such index
    Continue()
END

IF
  Global("TearDoor","GLOBAL",15)
  GlobalGT("C7SinCounter","GLOBAL",1)
  Global("PaladinGone","AR2900",0)
  Class(Player1,PALADIN_ALL)
THEN
  RESPONSE #100
    Wait(2)
    SetGlobal("PaladinGone","AR2900",1)
    ActionOverride(Player1,RemovePaladinHood())
    Continue()
END

IF
  Global("TearDoor","GLOBAL",15)
  GlobalGT("C7SinCounter","GLOBAL",2)
  Global("RangerGone","AR2900",0)
  Class(Player1,RANGER_ALL)
  !Class(Player1,CLERIC_RANGER)
THEN
  RESPONSE #100
    Wait(2)
    SetGlobal("RangerGone","AR2900",1)
    ActionOverride(Player1,RemoveRangerHood())
    Continue()
END

IF
  OR(3)
    Kit(Player1,GODTALOS)
    Kit(Player1,GODLATHANDER)
    Kit(Player1,GODHELM)
  !Global("C7AlignmentAdjust","GLOBAL",0)
  Global("ClericGone","AR2900",0)
THEN
  RESPONSE #100
    Wait(2)
    ActionOverride(Player1,AddKit(0))
    DisplayStringHead(Player1,@165) // No such index
    SetGlobal("ClericGone","AR2900",1)
    Continue()
END

IF
  Global("TearDoor","GLOBAL",15)
  Global("C7TearDoorDelay","GLOBAL",0)
THEN
  RESPONSE #100
    SetGlobalTimer("C7TearDoorTime","GLOBAL",3)
    SetGlobal("C7TearDoorDelay","GLOBAL",1)
END
