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

function GoSoapCastleEntrance()
    if(FLJ("HeroBack")) then
        PRI()FAO(3)TRA("CS_soapcastle_entrance","E0091",36,8,0,4)
    else
        PRI()
        FAC("jack_normal")MS3("We won't turn into fish") 
        CAT("\nin the sea again.")NOD()
    end
end

function SwimSoapCastleEntrance()
    PRI()FAO(3)TRA("CS_soapcastle_entrance","E0091",38,17)
end

function GoSoapCastleJail()
    PRI()FAO(1)TRA("CS_soapcastle_jail","E0093",3,12)
end

function SwimSoapCastleJail()
    PRI()FAO(1)TRA("CS_soapcastle_jail","E0093",1,21)
end

function GoPuuRestaurant()
    PRI()FAO(1)TRA("CS_puu_restaurant","E0093",6,26,0,47)
end

function GoSoapCastleGolemHall()
    PRI()FAO(3)TRA("CS_soapcastle_golemhall","E0091",76,17,0,19)
end

function GoSoapCastleStoreRoom()
    PRI()FAO(1)TRA("CS_soapcastle_storeroom","E0093",7,16)
end

function GoSoapCastleWaterFall()
    if(FLJ("ExploreEscapeRoutes")) then
        PRI()FAO(3)TRA("CS_soapcastle_waterfall","E0091",75,17,0,4)
    else
        PRI()FAC("jack_normal")MS3("\nWe don't need to go there yet.")NOD()
    end
end

function GoSoapCastlePuuRoom()
    if(FLJ("PuuRoomUnlock")) then
        PRI()FAO(3)TRA("CS_soapcastle_puuroom","E0091",34,13)
    elseif(FLJ("PlayedIronDyedAni")) then
        KEY()MS3("There are monsters inside,")NOD()
        CAT("\nwe'll be discovered if we go in now.")NOD()
    else
        KEY()
        MS3("\nI hear something moving inside...")NOD()CLO()
        PRI()FAO(3)
        HMC()
        POS(true)
        TRA("CS_soapcastle_puuroom","IronheadDyed",34,13)
    end
end

function GoSoapCastleTalaRoom()
    PRI()FAO(1)TRA("CS_soapcastle_talaroom","E0093",6,13)
end

function PlayedIronDyedAniEnd()
    PRI()
    POS(false)
    SMC()
    FLP("PlayedIronDyedAni")
    MNA()CMU("CS_Vivi")FAI(3)
end

--塔拉
function TalaCatchChako()
    KEY()
    FLS("PlayCastleAni")
    FLP("PlaceChakoToJail")
    HMC()
    SNP("CS_puu_animate",17,51,1,"mainLayer","Puu1")
    CMU("CS_Vivi")
    FAI(2)
    WAI(32)
    ANP("Puu1",0,0)
    WAI(32)
    FAC("puu_normal")MSG("\nWhy isn't Tala back yet...")NOD()CLO()
    WAI(32)
    MS3("\nI'm back!!")NOD()CLO()
    SNP("CS_soapwalker_animate",9,41,1,"mainLayer","Tala1")
    ANP("Tala1","with_chako",0)
    ANP("Tala1",1060)
    WAI(128)
    ANP("Tala1","with_chako",1)
    WAI(64)
    FAC("puu_normal")MSG("Wow! Where did you catch that?!")NOD()
    CAT("\nAnd it's a shiny one too.")NOD()CLR()
    FAC("soapwalker_normal")MSG("\nHehe, not telling you.")NOD()CLR()
    FAC("puu_normal")CAT("Stingy...")NOD()CAT("Oh well,")NOD()
    CAT("\nthis makes four now.")NOD()CLR()
    FAC("soapwalker_normal")CAT("But what about the other three?")NOD()
    CAT("\nEven if we breed them,") 
    CAT("\nwho knows how long it'll take.")NOD()CLR()
    CAT("Are you confident you can keep") 
    CAT("\nhiding this from the King")
    CAT("\nuntil you can buy a new arowana fish") 
    CAT("\nfrom the black market?")NOD()CLR()
    CAT("Or maybe we could paint Ironhead red")
    CAT("\nto make him look similar") 
    CAT("\nenough to fool him...")NOD()CLR()
    FAC("puu_normal")CAT("\nLet me think...")NOD()CLO()
    ANP("Puu1","normal",1)
    WAI(64)
    ANP("Puu1","normal",0)
    WAI(32)
    FAC("puu_normal")MSG("That's our only option...")NOD()
    CAT("\nI'll prepare the paint,")NOD()
    CAT("\nafter you lock this one in the cell,")NOD()
    CAT("\nbring Ironhead to my room.")NOD()CLR()
    FAC("soapwalker_normal")CAT("\nOK————!")NOD()CLO()
    FAO(0)
    SMC("CS_mychar_jackfish_p1")
    SMC("CS_mychar_santafish_p2")
    SMC("CS_mychar_puppyfish_p3")
    TRA("CS_soapcastle_entrance","E0092",14,19)
end

function SoapKingGoResturant()
    KEY()
    SNP("CS_puu_animate",43,12,1,"mainLayer","Puu1")
    SNP("CS_soapking_animate",46,11,1,"mainLayer","Soapking1")
    FAC("puu_normal")MS3("\nYour Majesty, wait!")NOD()CLO()
    FAI(2)
    WAI(32)
    ANP("Soapking1","normal",0)
    WAI(16)
    FAC()MS3("\nWhat is it now?")NOD()CLR()
    FAC("puu_normal")CAT("The inside isn't properly") 
    CAT("\ncleaned yet...")NOD()CLR()
    FAC()CAT("It's fine, Puu,")
    CAT("\nI don't mind...")NOD()CLO()
    ANP("Soapking1","normal",1)
    WAI(16)
    ANP("Soapking1","walk",1)
    WAI(16)
    DNP("Soapking1")
    PMU(5)
    WAI(64)
    FAC("puu_normal")MS3("This is bad,")NOD()
    ANP("Puu1","normal",0)
    CAT("\nCan I still make it to Tala's room")
    CAT("\nand escape using the teleporter...")NOD()CLO()
    WAI(64)
    WAI(64)
    SNP("CS_soapking_animate",47,11,0,"mainLayer","Soapking1")
    WAI(16)
    ANP("Soapking1","walk",0)
    WAI(16)
    ANP("Soapking1","normal",0)
    WAI(16)
    ANP("Puu1","normal",1)
    WAI(32)
    RMU(5)
    MS3("By the way, haven't you been") 
    CAT("\ntaking good care of Kuron lately?")NOD()
    CAT("\nHe's lost a lot of weight") 
    CAT("\nand seems low on energy,")NOD()
    CAT("\nI don't like seeing him like this,")NOD()
    CAT("\nyou'd better put more effort")
    CAT("\ninto taking care of him.")NOD()CLR()
    CAT("\nI'm going to sleep now...")NOD()CLR()
    FAC("puu_normal")MS3("\nYes, Your Majesty.")NOD()CLO()
    WAI(32)
    FAO(0)
    TRA("CS_puu_restaurant","IronheadDeadAni",8,26)
end