if Yap = 0 {MsgBox.Msg= "#Oh, "+global.Name+"...      #Listen... You see..."
Talk=1}

if Yap = 1 {MsgBox.Msg="Well, do you think you'll be staying in Gaius #tonight, "+global.Name+"?          #It's just that... well...        #I have something to give you..."
MsgBox.QTxt= "Okay, Tiel#Not tonight"
MsgBox.Question = 2
}

if Yap = 2{
if MsgBox.QChoose = 1 {MsgBox.Msg="#...well, what I want to give you is very important...        #...and probably rather helpful for you..."
} else MsgBox.Msg="#Great! I'll see you later, "+global.Name+"!"
MsgBox.Question = 0
}

if Yap = 3{
if MsgBox.QChoose = 1 {MsgBox.Msg="!"
Talk=0
} else {
Talk=0
instance_create(0,0,SimpleFadeInOut)
alarm[4]= 30
alarm[1]=0
Yap = 4
MsgBox.Msg = "?."
MsgBox.Dist = 0
MsgBox.Act = 0
MsgBox.Letter = 1
Rick.Strafe=0
Targeted=0
alarm[1]=0
Persist=80
}
}

if Yap = 5 {Yap = 6 
SimpleFadeInOut.Act = 1
TielInTown.x=1140
TielInTown.y=1324
TielInTown.z=40
TielInTown.direction= 270
Rick.x=1112
Rick.y=1324
Rick.z=40
Rick.direction= 270
with NPC {
visible=0
}
visible=1
Rick.visible=1
instance_create(0,0,BlueFilter)
sound_loop(SlowTielTheme)
GameCam.x=TielInTown.x-32
GameCam.y=TielInTown.y+144
GameCam.z=TielInTown.z+8
GameCam.direction=point_direction(GameCam.x,GameCam.y,TielInTown.x,TielInTown.y)+2
BGA.SkyTop=c_black
BGA.SkyBot=c_navy
d3d_set_fog(true,c_black,32,800)
}

if Yap = 6 {MsgBox.Msg="#"+global.Name+"...        #The stars are beautiful tonight, aren't they?"
Talk=1
}

if Yap = 7 MsgBox.Msg="They almost remind me of...            #...of that night when I was a blossoming young #woman."

if Yap = 8 MsgBox.Msg="I know we vowed we'd never mention that again, but #it still was a special day to me.         #"+global.Name+"... you still remember that day, don't #you?"

if Yap = 9 MsgBox.Msg="I know I caught you off-guard, and it was awkward #for you, and yes, I know I was young and foolish, but #I just couldn't help it."

if Yap = 10 {MsgBox.Msg="#Yeah...        #That was rather awkward..."
Rick.Talk=1
Talk=0
Rick.direction= 315}

if Yap = 11 {MsgBox.Msg="...but it was just one kiss... that's all.        #One little kiss on the cheek...        #I thought you would appreciate it."
Talk=1
Rick.Talk=0}

if Yap = 12 {MsgBox.Msg="#..."
Rick.direction=270
Talk=0}

if Yap = 13 {MsgBox.Msg="#...Tiel?         #You're not still sad about that, are you?"
Rick.Talk=1
Rick.direction=315
}

if Yap = 14 {MsgBox.Msg="...No.        #It's just...         #I knew, on that day, exactly how much I liked you."
Talk=1
Rick.Talk=0
direction=180
}

if Yap = 15 {MsgBox.Msg="#..."
Talk=0
Rick.direction=270
direction=270
}

if Yap = 16 {MsgBox.Msg="You know, when you first came up to me...       #I cried so much for my mom.          #...and you told me how you lost your mom..."
Talk=1}

if Yap = 17 MsgBox.Msg="I know you exaggerated a bit more than you should, #but it helped me a lot.        #You made me happy again."

if Yap = 18 {MsgBox.Msg="#I knew, from then on, that you would be my friend...         #always..."
direction=180
}

if Yap = 19 {MsgBox.Msg="#..."
Talk=0
direction=270
}

if Yap = 20 {MsgBox.Msg="I know you have a long road ahead of you, having to #save the princess and all... so, I want to give you #something for good luck."
Talk=1
direction=point_direction(x,y,Rick.x,Rick.y)}

if Yap = 21 {MsgBox.Msg="?."
Yap=22
MsgBox.Act=0
MsgBox.Letter=1
MsgBox.Dist=0
alarm[4]=16
Talk=0
speed=1
Rick.direction=0
}

if Yap = 23 {MsgBox.Msg="#...your pendant?"
Talk=0
Rick.Talk=1
Rick.direction=0
speed=0
}

if Yap = 24 {MsgBox.Msg="Yes. I got this from my Aunt Midge.       #It's always been a reminder of home for me.       #I hope it will help you, too."
Talk=1
Rick.Talk=0}

if Yap = 25 MsgBox.Msg="#I was told that with this pendant, I would never fall #as long as I had a bottle with something inside..."

if Yap = 26 MsgBox.Msg="I want you to have it.      #I don't want you to fall on your journey to save the #princess... or the world we know..."

if Yap = 27 {MsgBox.Msg="#Tiel...       #Thanks."
Rick.Talk=1
Talk=0}

if Yap = 28 {MsgBox.Msg="#My heart will always be with you, "+global.Name+".         #Good night...        "
Rick.Talk=0
Talk=1}

if Yap = 29
{global.TielHeart+=1
global.TielLove +=100
global.SQItemC = 18
ds_list_add(global.KHDB,"TLOVE")
Yap = 30
alarm[4] =30
instance_create(0,0,SimpleFadeInOut)
MsgBox.Msg = "?."
MsgBox.Dist = 0
MsgBox.Act = 0
MsgBox.Letter = 1
alarm[1]= 30
direction=0
speed =3
Talk=0
}

if Yap = 31 {
with BlueFilter{instance_destroy()}
d3d_set_fog(true,c_white,128,5000)
BGA.SkyTop=make_color_rgb(111,183,255)
BGA.SkyBot=make_color_rgb(0,128,255)
MsgBox.Msg = "!"
Persist=1
SimpleFadeInOut.Act = 1
sound_loop(TownBGM)
with NPC {
visible=1
}
Dialog = "Scripts/ThirdTiel.txt"
}