function E0090()
    MNA()CMU("CS_Grand")FAI(0)
end
function E0091()
    MNA()CMU("CS_Grand")FAI(1)
end
function E0092()
    MNA()CMU("CS_Grand")FAI(2)
end
function E0093()
    MNA()CMU("CS_Grand")FAI(3)
end
function E0094()
    MNA()CMU("CS_Grand")FAI(4)
end

function Door_GoPeaceTown()
    PRI()MM0()SOU("CS_011_door")ANP("Door_GoPeaceTown",0,1)FAO(2)TRA("CS_peace_town","E0090",20,31)
end

function Misery1Chat()
    DNP("Misery1Chat")
    if(FLJ("GiveToMisery")) then
        Misery1Chat_Firefly()
    else
        Misery1Chat_Getout()
    end
end

function Misery1Chat_Firefly()
    KEY()
    FAC("misery_normal")
    MYB(0,PLY())
    MS3("You again?")WAS()NOD()
    CAT("\nDidn't you see the")
    CAT("\n'No Pets Allowed' sign outside...")NOD()CLR()
    CAT("Though I must say,")NOD()
    CAT("\nyou're quite brave to")
    CAT("\ncome back again.")NOD()
    CAT("\nBut I won't be helping you")
    CAT("\nthis time.")NOD()
    CAT("\nSo what brings you here now...")NOD()CLR()
    GIT("Firefly")
    FAC("jack_normal")CAT("\nWe brought you this...")NOD()CLR()
    FAC("misery_normal")
    CAT("Oh, fireflies?")NOD()
    FAC("misery_excite")CAT("\nI'll accept them gratefully.")NOD()CLR()
    ITS("Firefly")
    GIT()
    FAC("misery_normal")CAT("However,")NOD()
    CAT("\nI sense you have other")
    CAT("\nmagical items on you.")NOD()CLR()
    CAT("For safety reasons,")
    CAT("\nlet me see what it is...")NOD()CLR()
    GIT("DemonFlower")
    FAC("jack_normal")CAT("\nIs it this?")NOD()CLR()
    FAC("misery_normal")CAT("Hmm, looks like an")
    CAT("\ninteresting material.")NOD()CLR()
    FAC("jack_normal")CAT("I'll give it to you,")NOD()
    CAT("\nwe have no use for it anyway")NOD()CLR()
    FAC("misery_normal")CAT("\nI'll take it then.")NOD()CLR()
    ITS("DemonFlower")
    GIT()
    CAT("But receiving two gifts at once,")NOD()
    CAT("\nit's bad for business")
    CAT("\nif I don't respond somehow.")NOD()CLR()
    FAC("misery_excite")CAT("\nWhy don't you draw fortunes?")NOD()CLO()
    FAO(0)
    WAI(64)
    MOV(18,12,PLY())
    MOV(19,12,1-PLY())
    SLR(0)
    AMC("normal")
    FAI(2)
    WAI(32)
    FAC("misery_normal")MS3("\nWhat's the result?")NOD()CLR()
    FAC("jack_><")CAT("\nMine is")FCL(0)CAT("[GREAT MISFORTUNE]")FCL()NOD()CLR()
    FAC()CAT("\nMine too")FCL(0)CAT("[GREAT MISFORTUNE]")FCL()NOD()CLR()
    FAC("misery_normal")CAT("It seems this is fate's arrangement,")NOD()
    CAT("\nI cannot change it.")NOD()CLR()
    FAC("misery_excite")CAT("You're going to experience")
    CAT("\nsome very interesting things today.")NOD()CLR()
    FAC("misery_normal")CAT("By the way, are you looking")
    CAT("\nfor a Mimiga?")NOD()
    CAT("\nThen go to Jenka.")NOD()
    CAT("\nHer dogs will surely")
    CAT("\nbe able to help.")NOD()CLR()
    CAT("Also, to pass through")
    CAT("\nthe gate of the Fire Cave,")NOD()
    CAT("\nyou'll need")
    CAT("\nthe magic of a fire spirit.")NOD()
    CAT("\nI'll arrange that for you.")NOD()CLO()
    WAI(32)
    ANP("Misery1","magic_powerful")
    WAI(50)
    ITS("Fireball")
    ITP("GhostFire")
    CMU("CS_Fanfale1")
    GIT("GhostFire")
    MS3("=FIREBALL=")
    CAT("\nupgraded to =GHOSTFIRE=")WAI(160)NOD()RMU()CLR()GIT()
    AMC("ghostfire_get")
    FAC("jack_normal")CAT("\nThank you for helping us!")NOD()CLR()
    FAC("misery_normal")CAT("No,")NOD()
    FAC("misery_excite")CAT("\nthis is merely preparation")
    CAT("\nso I can enjoy")
    CAT("\nwatching your desperate struggle.")NOD()CLR()
    CAT("\nHave a pleasant day~")NOD()CLO()
    PMU(1)
    FAO(0)
    TRA("CS_peace_town_hotel","GoFindJenka",15,19)

end

function Misery1Chat_Getout()
    KEY()
    FAC("misery_normal")
    MYB(0,PLY())
    MS3("Stop right there,")WAS()NOD()
    CAT("\nonly human travelers")
    CAT("\nare welcome here.")NOD()CLO()
    FAO(0)
    MOV(18,12,PLY())
    MOV(19,12,1-PLY())
    SLR(0)
    AMC("normal")
    AMC("hide_gun")
    FAI(2)
    ---[[
    FAC("misery_normal")
    MS3("\n.")WAI(8) CAT(".")WAI(8) CAT(".")WAI(8) CAT(".")WAI(8) CAT(".")WAI(8)CLR()
    CAT("However,")NOD()
    CAT("\nI believe you might be") 
    CAT("\none of those Mimigas")
    CAT("\nI caught before.")NOD()CLR()
    CAT("Now that little Mimiga and")
    CAT("\nthe red-eyed one have been revived...")NOD()CLR()
    CAT("\nWhat brings you here?")NOD()CLR()
    FAC("jack_normal")CAT("Monsters have appeared near")
    CAT("\nMimigga Village recently,")NOD()
    CAT("\nthey've taken Sue and Toroko.")NOD()
    FAC("jack_><")CAT("\nI want to ask for your help")
    CAT("\nfinding them...")NOD()CLR()
    CMU("XXXX")
    FAC("misery_normal")CAT("Don't dream,")NOD()
    CAT("\nI'm not your genie.")NOD()CLR()
    FAC("misery_not_well")CAT("\nAnd no pets allowed in here!")NOD()CLO()
    --]]
    --用泡泡把赶走
    ANP("Misery1","magic")
    SNP("CS_bubble_catcher",16,10,0,"mainLayer","Bubble1")--泡泡
    ANP("Bubble1","set_target")
    ANP("Bubble1",MCN(PLY()))
    WAI(24)
    if(MCN(PLY()) == "CS_mychar_jack") then
        ANP("Bubble1","caught_jack")
    else
        ANP("Bubble1","caught_santa")
    end
    HMC(PLY())
    SOU("CS_021_bubble")
    ANP("Bubble1","set_target")
    ANP("Bubble1","Door_GoPeaceTown")
    WAI(16)
    --捕获玩家2
    ANP("Misery1","magic")
    SNP("CS_bubble_catcher",16,10,0,"mainLayer","Bubble2")--泡泡
    ANP("Bubble2","set_target")
    ANP("Bubble2",MCN(1-PLY()))
    WAI(24)
    SOU("CS_011_door")ANP("Door_GoPeaceTown",0,1)
    if(MCN(1-PLY()) == "CS_mychar_jack") then
        ANP("Bubble2","caught_jack")
    else
        ANP("Bubble2","caught_santa")
    end
    HMC(1-PLY())
    SOU("CS_021_bubble")
    ANP("Bubble2","set_target")
    ANP("Bubble2","Door_GoPeaceTown")
    WAI(32)
    DNP("Bubble1")
    WAI(36)
    DNP("Bubble2")
    FAO(2)TRA("CS_peace_town","GetOutDivination",20,31)
end

function KazumaMSG()
    KEY()
    SNP("CS_kazuma_animate",20,12,1,"mainLayer","Kazuma1")
    ANP("Kazuma1","back")
    SNP("CS_sakamoto_sue_animate",18,12,0,"mainLayer","SakamotoSue1")
    FAI(0)
    WAI(16)
    CMU("CS_Kodou")
    FAC("kazuma_normal")MS3("This is terrible!")NOD()
    CAT("\nThe witch said that Quote and Curly")
    CAT("\nmight sacrifice themselves during") 
    CAT("\nthis rescue.")NOD()CLR()
    FAC("professorbooster_normal")CAT("\nWhy?")NOD()CLR()
    FAC("kazuma_normal")CAT("I don't know the details,")
    CAT("\nbut once you find the puppy,")NOD()
    CAT("\nhurry to Gaudi City!")NOD()CLR()
    CAT("\nI'll follow soon on a sky dragon.")NOD()CLR()
    FAC("professorbooster_normal")CAT("\nUnderstood.")NOD()CLO()
    FAO(2)
    TRA("CS_soapcastle_golemhall","ProfessorBoosterGoGaudiCity",41,18)
end