if sm.hasQuest(1801):
    sm.lockInGameUI(True)
    sm.removeEscapeButton()
    sm.spawnNpc(1033230, 61, 136)
    sm.spawnNpc(9075302, 176, 136)
    sm.spawnNpc(9075303, 381, 136)
    sm.setSpeakerID(1033230)
    sm.sendNext("Lotus? Lotus! Are you awake?!")
    sm.setSpeakerID(9075302)
    sm.sendNext("........")
    sm.setSpeakerID(1033230)
    sm.sendNext("Oh, brother, I've missed you so much! You've been napping all this time and I've had to blow up SO many people.")
    sm.setSpeakerID(9075302)
    sm.sendNext("........")
    sm.setSpeakerID(1033230)
    sm.sendNext("Now we can be together again! We can take over this whole planet of stupid monkeys and rule it like we're supposed to!")
    sm.setSpeakerID(9075302)
    sm.sendNext("........")
    sm.setSpeakerID(1033230)
    sm.sendNext("Lotus? Can you hear me? Remember your sister, Orchid?")
    sm.setSpeakerID(9075302)
    sm.sendNext("........")
    sm.setSpeakerID(1033230)
    sm.sendNext("I thought you said he was waking up, Gelimer! If you scrambled his brains, I'm going to turn you inside out!")
    sm.setSpeakerID(9075303)
    sm.sendNext("I assure you, Commander Orchid. Lotus is perfectly fine. Do you wish to see? Here... Execute Program Alpha-97")
    sm.showFieldEffect("evolving/swoo2", 0)
    sm.sendDelay(4000)
    sm.removeNpc(1033230)
    sm.spawnNpc(9075002, -83, 136)
    sm.setSpeakerID(9075002)
    sm.sendNext("L... Lotus? What's going on?!")
    sm.setSpeakerID(9075303)
    sm.sendNext("Perhaps it needs a little more juice, but the controls seem to be functional. My hypothesis was correct. His spirit could not withstand the impulses of his physical form.")
    sm.setSpeakerID(9075002)
    sm.sendNext("Gelimer... You...")
    sm.setSpeakerID(9075303)
    sm.sendNext("Have completed my experiments, yes. Your brother's body is awake once more. It does not yet have volition, but that is only a small inconvenience.")
    sm.setSpeakerID(9075002)
    sm.sendNext("What... did you do... to Lotus?!")
    sm.setSpeakerID(9075303)
    sm.sendNext("I have taken control of the man who has the ability to control others, foolish girl. Unfortunately, his brain is still in hibernation, but his powers are all that are truly important.")
    sm.setSpeakerID(9075002)
    sm.sendNext("Why? Why Lotus?")
    sm.setSpeakerID(9075303)
    sm.sendNext("The Black Mage requires a vessel, child, not another follower. Do be a good girl and die now, won't you? I doubt we will be needing your services any more. Hahahaha!")
    sm.setSpeakerID(9075002)
    sm.sendNext("No... No... Not Lotus! Stop!")
    sm.lockInGameUI(False)
    sm.warpInstanceOut(957020003, 0)
if sm.hasQuest(1846):
    sm.lockInGameUI(True)
    sm.removeEscapeButton()
    sm.deleteQuest(1849)
    sm.spawnNpc(9075301, 13, 55)
    sm.spawnNpc(9075300, -106, 136)
    sm.setSpeakerID(9075300)
    sm.sendNext("Lotus... Lotus! It's you, right?")
    sm.setSpeakerID(9075301)
    sm.sendNext("")
    sm.setSpeakerID(9075300)
    sm.sendNext("Why aren't you answering? Did you forget me? Lotus, talk, please?")
    sm.setSpeakerID(9075301)
    sm.sendNext("Checking user information. \r\n\r\n Orchid, is not a registered user name.")
    sm.setSpeakerID(9075300)
    sm.sendNext("Lotus, what are you talking about? I can't understand a thing.")
    sm.setSpeakerID(9075301)
    sm.sendNext("You must register to use the Evolution System. Would you like to register?")
    sm.setSpeakerID(9075300)
    sm.sendNext("You're not Lotus? Who are you? Who are you to take his form?")
    sm.setSpeakerID(9075301)
    sm.sendNext("I am ESS, the artificial intelligence that regulates the Evolution System. I was designed for maximum efficiency.")
    sm.setSpeakerID(9075300)
    sm.sendNext("Artificial intelligence? Did Gelimer make you?")
    sm.setSpeakerID(9075301)
    sm.sendNext("Due to a system reset, all previous user information has been deleted.")
    sm.setSpeakerID(9075300)
    sm.sendNext("I don't like it. I don't like it one bit. Why do you look like Lotus? He is Orchid's twin. My twin! Why is Gelimer making robot brothers?!")
    sm.showNpcSpecialActionByTemplateId(9075300, "summon", 0)
    sm.removeNpc(9075300)
    sm.spawnNpc(9075307, -106, 136, True)
    sm.setSpeakerID(9075307)
    sm.sendNext("Where is Lotus? Give him back, now! Bring back Lotus!")
    sm.reservedEffectRepeat("Effect/Direction5.img/effect/attack/1", True)
    sm.reservedEffectRepeat("Effect/Direction5.img/effect/attack/2", True)
    sm.reservedEffectRepeat("Effect/Direction5.img/effect/attack/3", True)
    sm.setSpeakerID(9075301)
    sm.sendNext("System has detected attack. Activating the defense system.")
    sm.hideUser(False)
    sm.setPlayerAsSpeaker()
    sm.sendNext("Orchid? She hasn't lost all her powers?")
    sm.setSpeakerID(9075301)
    sm.sendNext("Switching to target tracking mode. Tracking target.")
    sm.deleteQuest(1849)
    sm.createQuestWithQRValue(1849, "1")
    sm.setSpeakerID(9075301)
    sm.sendNext("Enemy recognition complete. Switching to attack mode. Initiating attacks. Attack... Starting.")
    sm.showFieldEffect("Effect/Direction5.img/effect/attack/0")
    sm.sendDelay(4000)
    sm.setPlayerAsSpeaker()
    sm.sendNext("Orchid!")
    sm.setSpeakerID(9075301)
    sm.sendNext("New target found. Enemy recognition initiated.")

    sm.sendNext("User name #h #. User verified. Ending defense system and switcing to system enhancement mode.")
    sm.setPlayerAsSpeaker()
    sm.sendNext("Orchid! Wake up, Orchid!")
    sm.setSpeakerID(9075307)
    sm.sendNext("I miss Lotus.")
    sm.lockInGameUI(False)
    sm.warp(957020004)