Update of /cvsroot/exult/./exult/content/bgkeyring/src/quests/keyring/cutscenes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6030/src/quests/keyring/cutscenes Added Files: cheaters_cataclysm.uc mage_and_goons.uc zauriel_make_potion.uc zauriel_ritual.uc Log Message: Adding the Keyring mod to CVS. --- NEW FILE: cheaters_cataclysm.uc --- /* * This source file contains some functions specific to a cutscene * from the Keyring Quest. This happens only if the player hackmoves * Laurianna (with roots) near her father. Maybe I will change it * in the future to trigger when the player takes too long to * bring Laurianna to her father, but not yet. * * Author: Marzo Junior * Last Modified: 2001-01-20 */ enum Cataclism_levels { LAURIANNA_DIES = 1, LAURIANNA_INSANE = 2, CATACLISM_START = 3, ARMAGEDDON = 4, END_GAME = 5 }; beginCataclysm () { if ((event == LAURIANNA_DIES) || (event == LAURIANNA_INSANE)) { //Begin a magic storm: gflags[MAGIC_STORM_SPELL] = true; UI_set_weather(3); //Get party list and append Zauriel to it: var party = UI_get_party_list(); party = party & ZAURIEL; var member; var counter; var party_count; //Make everyone SHY away: for (member in party with counter to party_count) member->set_schedule_type(SHY); //Long, long earthquake: UI_earthquake(3600); if (event == LAURIANNA_DIES) { //Halt the above scripts: ZAURIEL->halt_scheduled(); AVATAR->halt_scheduled(); //Zauriel's message: ZAURIEL.say("@NO! Thou hast forgotten the necklace! NOOOOO!@"); ZAURIEL.hide(); //Unfreeze Zauriel and Avatar: ZAURIEL->unfreeze(); AVATAR->unfreeze(); var pos = LAURIANNA->get_object_position(); //Laurianna will lie down unconscious and trigger the cataclysm: UI_sprite_effect(1, pos[X], pos[Y], 0, 0, 0, -1); script LAURIANNA { call trueFreeze; nohalt; sfx SOUND_BIG_BLAST; wait 2; say "@Aaahhhh...@"; wait 3; actor frame LEAN; wait 3; actor frame KNEEL; wait 3; actor frame LIE; wait 3; call beginCataclysm, CATACLISM_START; } } else { member->set_schedule_type(DANCE); //Laurianna has gone insane. Not used yet. script LAURIANNA { repeat 20 { wait 6; say "@Tra-la-la...@"; wait 6; say "@Let the world burn!@"; wait 6; say "@Fire is so pretty...@"; wait 6; say "@Look! It burns!@"; wait 6; say "@Wilt thou die? For me?@"; wait 6; say "@Can I burn those flowers?@"; wait 6; say "@Pretty birds. Dead birds.@"; }; } script AVATAR after 18 ticks call beginCataclysm, CATACLISM_START; } } else if (event == CATACLISM_START) { //Get party list and append Zauriel: var party = UI_get_party_list(); party = party & ZAURIEL; //Select one of them randomly: var rand = UI_get_random(UI_get_array_size(party)); var member = party[rand]; //Get position for the above NPC and for the Avatar: var npc_pos = member->get_object_position(); var avatar_pos = AVATAR->get_object_position(); //Get a random position around the Avatar: var rand_pos = [avatar_pos[X] + UI_get_random(41) - 21, avatar_pos[Y] + UI_get_random(41) - 21, 0]; //Random barks: var barks = ["@Argh!@", "@Ouch!@", "@That hurts!@", "@Please stop!@"]; rand = UI_get_random(UI_get_array_size(barks)); //Exploding lightning bolts: //One for the randomly selected party member: UI_sprite_effect(1, npc_pos[X], npc_pos[Y], 0, 0, 0, -1); UI_sprite_effect(17, npc_pos[X], npc_pos[Y], 0, 0, 0, -1); UI_play_sound_effect2(SOUND_BIG_BLAST, member); member->reduce_health(HEALTH, UI_die_roll(3, 9)); script member { say barks[rand]; wait 2; actor frame LEAN; wait 2; actor frame KNEEL; wait 2; actor frame LEAN; wait 2; actor frame STAND; } //One for the random position: UI_sprite_effect(1, rand_pos[X], rand_pos[Y], 0, 0, 0, -1); UI_sprite_effect(17, rand_pos[X], rand_pos[Y], 0, 0, 0, -1); UI_play_sound_effect2(SOUND_BIG_BLAST, AVATAR); //Queue the next lightning bolts: script AVATAR after 12 ticks call beginCataclysm, CATACLISM_START; if (AVATAR->get_npc_prop(HEALTH) <= 5) { //The Avatar is dying //Halt cataclysm: AVATAR->halt_scheduled(); //make Avatar lie down to die: script AVATAR { call trueFreeze; say "@Too hurt...@"; wait 6; actor frame LEAN; wait 2; actor frame KNEEL; wait 2; actor frame LIE; wait 6; call beginCataclysm, END_GAME; } } } else if (event == END_GAME) { //Thus we reach the end of Britannia: avatarSpeak("With your dying breath, you see the world of Britannia being sundered appart by violent earthquakes... then, darkness surrounds you."); UI_restart_game(); } } --- NEW FILE: mage_and_goons.uc --- /* * This source file contains some functions specific to a cutscene * from the Keyring Quest. * * Author: Marzo Junior * Last Modified: 2001-01-20 */ //Cutscene levels: enum MageAndGoons_levels { BEGIN_CUTSCENE = 1, FADE_SCREEN = 2, CENTER_VIEW = 3, UNFADE_SCREEN = 4, DISPLAY_REGION = 5, MAKE_VISIBLE = 6, GENERATE_SCRIPTS = 7, FIREWORKS_LAURIANNA = 8, GARGOYLE_WARNS = 9, LAUNDO_SPEAKS = 10, BEGIN_COMBAT = 11, PREPARE_NPC = 12 }; beginCutsceneMageAndGoons () { var mage; var gargoyle; var cyclops; var troll; var fighter; var pos; var dir; if (event == BEGIN_CUTSCENE) { //Cutscene begins HERE, with item == AVATAR //Play music: UI_play_music(21, 0); //Cutscene mode :-) AVATAR->trueFreeze(); //Create magical effect: pos = get_object_position(); UI_sprite_effect(ANIMATION_BLUE_BEADS, pos[X], pos[Y], 0, 0, 0, -1); //Screen fader: script item after 5 ticks call beginCutsceneMageAndGoons, FADE_SCREEN; //Find Laundo: mage = LAURIANNA->find_nearest(SHAPE_MAGE_MALE, 80); //Use him to unfade screen and kick-start the rest of the scene: script mage after 10 ticks { nohalt; call beginCutsceneMageAndGoons, CENTER_VIEW; wait 2; call beginCutsceneMageAndGoons, UNFADE_SCREEN; wait 5; call beginCutsceneMageAndGoons, DISPLAY_REGION; }; } else if (event == FADE_SCREEN) { //Fade screen to black: UI_fade_palette(12, 1, 0); } else if (event == CENTER_VIEW) { //center around item: center_view(); } else if (event == UNFADE_SCREEN) { //Unfade screen: UI_fade_palette(12, 1, 1); } else if (event == DISPLAY_REGION) { //The magical effect of the Gem of Dispelling //item == mage //Play a sound effect: UI_play_sound_effect2(SOUND_MOONGATE, item); //Get each of the mage's goons: gargoyle = LAURIANNA->find_nearest(SHAPE_GARGOYLE_WARRIOR, 80); cyclops = LAURIANNA->find_nearest(SHAPE_CYCLOPS, 80); troll = LAURIANNA->find_nearest(SHAPE_TROLL, 80); fighter = LAURIANNA->find_nearest(SHAPE_FIGHTER_MALE, 80); //Make Laurianna visible and generate the scripts for the mage and goons: script LAURIANNA after 6 ticks { nohalt; call trueFreeze; call beginCutsceneMageAndGoons, MAKE_VISIBLE; wait 4; call beginCutsceneMageAndGoons, GENERATE_SCRIPTS; }; //Make the mage and his goons visible: script item after 6 ticks {nohalt; call beginCutsceneMageAndGoons, MAKE_VISIBLE;}; script gargoyle after 6 ticks {nohalt; call beginCutsceneMageAndGoons, MAKE_VISIBLE;}; script cyclops after 6 ticks {nohalt; call beginCutsceneMageAndGoons, MAKE_VISIBLE;}; script troll after 6 ticks {nohalt; call beginCutsceneMageAndGoons, MAKE_VISIBLE;}; script fighter after 6 ticks {nohalt; call beginCutsceneMageAndGoons, MAKE_VISIBLE;}; } else if (event == MAKE_VISIBLE) { //item varies //Clears DONT_RENDER flag: clear_item_flag(DONT_RENDER); //Play sound effect: UI_play_sound_effect2(110, item); //Show magic bubbles: pos = get_object_position(); UI_sprite_effect(ANIMATION_PURPLE_BUBBLES, pos[X], pos[Y], 0, 0, 0, -1); } else if (event == GENERATE_SCRIPTS) { //item = LAURIANNA //Make Laurianna have fireworks around her: script LAURIANNA call beginCutsceneMageAndGoons, FIREWORKS_LAURIANNA; //Get references for the mage and his goons: mage = find_nearest(SHAPE_MAGE_MALE, 80); gargoyle = find_nearest(SHAPE_GARGOYLE_WARRIOR, 80); cyclops = find_nearest(SHAPE_CYCLOPS, 80); troll = find_nearest(SHAPE_TROLL, 80); fighter = find_nearest(SHAPE_FIGHTER_MALE, 80); //Laundo's script; he casts a couple spells and wonders why they failed; then, //he turns to the Avatar and begins to talk: script mage { wait 2; actor frame CAST_1; wait 2; actor frame CAST_2; wait 2; actor frame CAST_1; wait 2; actor frame CAST_2; wait 2; say "@An Sanct Ort!@"; wait 2; actor frame STAND; wait 2; actor frame CAST_1; wait 2; actor frame CAST_2; wait 2; actor frame CAST_1; wait 2; actor frame CAST_2; wait 2; say "@An Ort Sanct!@"; wait 2; actor frame STAND; wait 2; face EAST; say "@Damn! Why doesn't it work?@"; wait 18; say "@The spell is correct!@"; wait 18; say "@It -should- work!@"; wait 18; say "@Something -must- protect her!@"; wait 34; say "@What?!@"; wait 18; say "@Intruders?!?@"; wait 20; say "@I'll talk to them!@"; wait 12; call beginCutsceneMageAndGoons, LAUNDO_SPEAKS;} //Agra-Lem's script. He patrols around until he sees the Avatar and gang; //then he sounds the alarm: script gargoyle { repeat 4 {step WEST; wait 2;}; actor frame STAND; wait 1; face NORTH; wait 1; face EAST; wait 1; repeat 5 {step EAST; wait 2;}; actor frame STAND; wait 1; face NORTH; wait 1; face WEST; wait 1; repeat 2 {step WEST; wait 2;}; actor frame STAND; wait 1; face NORTH; wait 1; actor frame STAND; repeat 3 {step NORTH; wait 2;}; actor frame STAND; wait 1; face EAST; wait 1; face SOUTH; wait 1; repeat 4 {step SOUTH; wait 2;}; wait 2; say "@!!!@"; wait 6; say "@To see intruders!@"; repeat 2 {step WEST; wait 2;}; call beginCutsceneMageAndGoons, GARGOYLE_WARNS;} //The cyclop's script. He just plays a game of Dragon, Sword, Gold //with the troll: script cyclops { actor frame SWING_1; wait 4; say "@Dragon...@"; actor frame USE; wait 4; actor frame SWING_1; wait 4; say "@... sword...@"; actor frame USE; wait 4; actor frame SWING_1; wait 4; say "@... gold!@"; actor frame SWING_3; wait 4; actor frame STAND; wait 8; say "@Damn!@"; wait 56; say "@Yer cheatin'!@"; wait 18; say "@Yer winnin' always!@"; wait 22; say "@Huh?@";} //The troll's script. He just plays a game of Dragon, Sword, Gold //with the cyclops: script troll { wait 5; actor frame SWING_1; wait 4; say "@Dragon...@"; actor frame USE; wait 4; actor frame SWING_1; wait 4; say "@... sword...@"; actor frame USE; wait 4; actor frame SWING_1; wait 4; say "@... gold!@"; actor frame SWING_3; wait 4; actor frame STAND; wait 6; say "@Haha! My sword...@"; wait 18; say "@... kills yer dragon!@"; wait 18; say "@I win again!@"; wait 22; say "@Am not!@"; wait 18; say "@Yer too dumb!@"; wait 14; face EAST; say "@Intruders? Kill!@";} //The human is having second doubts, but he is there for //the money anyway... script fighter { wait 4; say "@What am I doing here?@"; wait 10; say "@I mean, look who is around...@"; face NORTH; wait 16; say "@One dumb troll...@"; wait 16; say "@... a dumber cyclops...@"; wait 16; say "@... one pissed-off gargoyle...@"; face EAST; wait 16; say "@... and a mad mage.@"; wait 20; say "@The only good thing...@"; wait 16; say "@... is the gold I get.@"; wait 24; say "@Intruders? Where?@";} } else if (event == FIREWORKS_LAURIANNA) { //item = LAURIANNA //This portion of the function is looped over and over //again until Laundo's death halts it. //Creates fireworks around Laurianna: pos = LAURIANNA->get_object_position(); UI_sprite_effect(ANIMATION_FIREWORKS, pos[X], pos[Y], 0, 0, 0, -1); //Loop: script item after 10 ticks call beginCutsceneMageAndGoons, FIREWORKS_LAURIANNA; } else if (event == GARGOYLE_WARNS) { //item = gargoyle //Gargoyle sounds the alarm: script item { say "@To see intruders!@"; wait 12; say "@To believe intruders...@"; wait 12; say "@... to see us too!@";} //A party member reacts to it: script randomPartyMember() after 20 ticks say "@Ooops...@"; } else if (event == LAUNDO_SPEAKS) { //Laundo begins talking to Avatar: KEYRING_ENEMY->show_npc_face(LAUNDO_FACE); say("@Hey! Thou there! Who art thou?@"); //Laundo demands Avatar's name... var choice = askForResponse([getAvatarName(), "Avatar", "None of thy business"]); if (choice == "Avatar") say("The mage whispers to his companions. @I think we are safe. This one seems mad.@"); else if (choice == "None of thy business") say("@A fiery spirit! I like that! No, wait -- I don't.@ He adds menacingly."); else say("@Bah, thy name is not really important and means nothing to me.@"); //...rapid-fires a lot of questions without giving time for answers... say("@-I- am the archmage Laundo. Now, who art thou?"); say("@No, wait -- I have already asked that. What did I want to ask again?"); say("@Ah, yes! How didst thou -- a mere mortal -- dispel my warding spells?"); say("@And what art thou doing in my tower?"); say("@Wait -- I am -not- in my tower! Regardless, what art thou doing here?"); say("@Come now, speak quickly! Shouldst thou speak not, I shall kill thee where thou standest!"); say("@Won't thou say anything? Hast thou a death wish?"); say("@I am in the middle of an experiment! I don't have time for this! Speak or die!@"); //...and is warned by Agra-Lem of his behaviour: const int GARGOYLE_FACE = -262; GARGOYLE_FACE.say("The gargoyle interrupts. @Master! To not be letting intruder speak!@"); GARGOYLE_FACE.hide(); say("@Ah, thou art correct, Agra-lem. Go on, peasant! Speak! I shall listen."); say("@Perhaps thou shalt amuse me before dying...@ he adds, sounding hopeful."); add(["name", "job", "bye", "dispel", "tower", "Doing here", "rescue", "experiment", "Laurianna", "Rooted woman"]); converse (0) { case "name" (remove): say("@-I- am the archmage Laundo. Now, who art thou?"); say("@No, wait -- I have already asked that. Never mind.@"); case "job" (remove): say("He looks at you with impatience. @I am a mage! An -arch-mage!@"); add("archmage"); case "archmage" (remove): say("He gives you an exasperated look. @A mage so powerful he transcends other mages!"); say("@And I am one! Hahaha! Behold my powers and beware!@"); case "bye" (remove): say("@Not so fast, peasant! Thou didst not tell me what thou art doing here!@"); case "dispel" (remove): say("@Yes, I want to know how a nothing like thee dispelled my protection spells!"); say("@Wilt thou tell me or wilt thou die?@"); if (chooseFromMenu2(["tell", "die"]) == 2) //Quickest way to end the talk: break; avatarSpeak("You quickly explain about the Gem of Dispelling to Laundo."); AVATAR.hide(); say("@Gems of Dispelling? Never heard of them. It doesn't matter anyway.@"); case "tower" (remove): say("@Yes, I have a tower. All wizards have one. But I want a -castle- instead.@"); add("castle"); case "castle" (remove): say("@I mean castle British, of course. None others are worthy!"); say("@But alas, I must first slay that tyrant British to have his castle...@"); add("Tyrant British"); case "Doing here" (remove): say("@Wilt thou tell me what art doing here?@"); if (chooseFromMenu2(["rescue", "lie"]) == 1) say("@I am sorry to say thou hast wasted thy time. That mad mage sent thee on a wild goose chase."); else say("@I am sorry to say thou art wasting my time. I can feel the touch of that mad mage upon thee!"); say("@In any case, thou wilt fail to rescue this mageling! She is mine!@"); add("fail", "mad mage"); remove("rescue"); case "rescue" (remove): say("@I am sorry to say thou hast wasted thy time. That mad mage sent thee on a wild goose chase."); say("@In any case, thou wilt fail to rescue this mageling! She is mine!@"); add("fail", "mad mage"); remove("Doing here"); case "fail" (remove): say("@Yes, thou wilt fail. By which I mean thou shalt die if thou dost try to rescue her."); say("@And even if thou survivest, she will not be going anywhere..."); say("@Seest thou the necklace she wears? It is -my- handiwork.@"); add("necklace"); case "mad mage" (remove): say("@Yes, that mage that wants to keep this menace alive!@ he points towards Laurianna."); say("@He wants to keep that -beast- alive! And he helps people! He is -mad-!"); say("@With all the power he has, he could -- I mean, -should- -- kill the tyrant British!@"); add("Tyrant British"); case "Laurianna" (remove): say("@Who? Never heard of her.@"); avatarSpeak("You explain that Laurianna is the woman with roots just nearby."); AVATAR.hide(); say("@Ah, so -that- is her name? Well, it doesn't matter. She won't be going anywhere."); say("@Seest thou the necklace she wears? It is -my- handiwork.@"); add("necklace"); case "necklace" (remove): say("@It is lovely, is it not? It is a mighty artifact!"); say("@The person wearing it -- in this case, this dangerous lady here -- cannot move at all from where she is!"); say("@Not even magic can move her! And the necklace also cannot be removed! Hah! She shall be here forever!"); say("@And the best part is that the necklace will simply -explode- should someone powerful enough to dispel its magic"); say("@come even -near- it. That keeps that mad mage from trying to rescue her! Isn't it brilliant?"); case "experiment" (remove): say("@Since thou wilt die anyway, I don't see why not explain the greatness of my plans to thee!"); say("@This woman is a menace. She wields enormous power, and has no control over them."); say("@So I intend to give her powers to a worthy receptacle -- -me-!"); say("@I can then do what I want with them, and she won't be a menace anymore! Haha!"); say("@Of course, then I can remove other menaces from the face of Britannia."); say("@One that comes to mind is that tyrant British. He -must- die!@"); add("Tyrant British"); case "Tyrant British" (remove): say("@Thou knowest, that bloke with a crown which calls himself 'king'"); say("@That miserable excuse of a tyrant must perish for his misdeeds!@"); case "Rooted woman" (remove): say("@Yes, that is an effect of the necklace I made for her. Isn't it lovely?@"); add("necklace"); } //When all options are exhausted (or the player chose the quick rout), //we get to this point: say("@Well, it was interesting. But thou art boring me. So now it is time to die!@"); //Return view to avatar: script AVATAR { nohalt; call beginCutsceneMageAndGoons, FADE_SCREEN; wait 2; call beginCutsceneMageAndGoons, CENTER_VIEW; wait 3; call beginCutsceneMageAndGoons, UNFADE_SCREEN; wait 3; call beginCutsceneMageAndGoons, BEGIN_COMBAT;}; } else if (event == BEGIN_COMBAT) { //item = AVATAR //Get references to the mage and his goons: mage = LAURIANNA->find_nearest(SHAPE_MAGE_MALE, 80); gargoyle = LAURIANNA->find_nearest(SHAPE_GARGOYLE_WARRIOR, 80); cyclops = LAURIANNA->find_nearest(SHAPE_CYCLOPS, 80); troll = LAURIANNA->find_nearest(SHAPE_TROLL, 80); fighter = LAURIANNA->find_nearest(SHAPE_FIGHTER_MALE, 80); //Make them hostile and in combat: script mage {nohalt; call beginCutsceneMageAndGoons, PREPARE_NPC;}; script gargoyle {nohalt; call beginCutsceneMageAndGoons, PREPARE_NPC;}; script cyclops {nohalt; call beginCutsceneMageAndGoons, PREPARE_NPC;}; script troll {nohalt; call beginCutsceneMageAndGoons, PREPARE_NPC;}; script fighter {nohalt; call beginCutsceneMageAndGoons, PREPARE_NPC;}; //Release the Avatar from cutscene mode: AVATAR->trueUnfreeze(); } else if (event == PREPARE_NPC) { //item varies //Make npc hostile: set_alignment(2); //Puts him in combat mode: set_schedule_type(IN_COMBAT); } } registerDeathOfMageOrGoon () { //This is called whenever the mage or one of his goons die //Removes the mage/goon from tournament mode: clear_item_flag(SI_TOURNAMENT); //Kill them: reduce_health(50, true); //Increase Laurianna's NPC ID: var new_id = 1 + LAURIANNA->get_npc_id(); LAURIANNA->set_npc_id(new_id); if (new_id == 5) { //Everyone is dead; halt scripts for Laurianna: LAURIANNA->halt_scheduled(); //Prepare the next portion of the quest: script LAURIANNA after 20 ticks call Laurianna, CLEAR_FLAGS; } } --- NEW FILE: zauriel_make_potion.uc --- /* * This source file contains usecode for the Keyring Quest. * Specifically, it contains a cutscene where Zauiel makes * the Blackrock potion. * * Author: Marzo Junior * Last Modified: 2001-01-20 */ enum MakePotion_levels { CAST_TELEPORT = 1, TELEPORT_WIDGETS = 2, POTION_FADE_SCREEN = 3, MOVE_TO_LAB = 4, POTION_UNFADE_SCREEN = 5, MAKE_POTION = 6, PLACE_BLACKROCK = 7, UPDATE_CAULDRON = 8, DELETE_POTIONS = 9, BEGIN_DIALOG_1 = 10, MOVE_TO_LBCASTLE = 11, BEGIN_DIALOG_2 = 12, TELEPORT_TO_SKARABRAE = 13 }; zaurielMakePotion () { var pos; var npc; var party = UI_get_party_list(); var index; var max; var casting; if (event == CAST_TELEPORT) { //item = ZAURIEL ZAURIEL->show_npc_face(0); say("@I shall teleport us all into my lab so that we have some privacy while I work on the potion.@"); //Teleportation spell: script item { nohalt; finish; face SOUTH; call showCastingFrames; actor frame CAST_1; wait 2; say "@Vas In Por@"; next frame; wait 2; previous frame; wait 2; next frame; wait 2; previous frame; sfx SOUND_TELEPORT; call zaurielMakePotion, TELEPORT_WIDGETS; wait 8; call zaurielMakePotion, POTION_FADE_SCREEN; actor frame STAND; wait 5; call zaurielMakePotion, MOVE_TO_LAB;} abort; } else if (event == TELEPORT_WIDGETS) { //item = ZAURIEL //The spell effect animation: pos = get_object_position(); UI_sprite_effect(ANIMATION_TELEPORT, pos[X], pos[Y], 0, 0, 0, -1); for (npc in party with index to max) { pos = npc->get_object_position(); UI_sprite_effect(ANIMATION_TELEPORT, pos[X], pos[Y], 0, 0, 0, -1); } } else if (event == POTION_FADE_SCREEN) //Fade to black: UI_fade_palette(12, 1, 0); else if (event == MOVE_TO_LAB) { //item = ZAURIEL //Move Zauriel move_object([0x535, 0xA47, 0x0]); set_item_frame_rot(STAND_EAST); //Use the Avatar to unfade the screen: script AVATAR { face WEST; wait 2; call zaurielMakePotion, POTION_UNFADE_SCREEN; wait 5; call zaurielMakePotion, MAKE_POTION; } //Move the party: pos = [0x53D, 0xA46, 0x0]; PARTY->move_object(pos); } else if (event == POTION_UNFADE_SCREEN) //Unfade from black: UI_fade_palette(12, 1, 1); else if (event == MAKE_POTION) { script AVATAR after 2 ticks call trueFreeze; ZAURIEL->show_npc_face(0); say("@There, I can work unfettered by other concerns now. Here, let me have the ingredients.@"); //Take the ingredients away: UI_remove_party_items(1, SHAPE_BLACKROCK, QUALITY_ANY, FRAME_ANY, true); UI_remove_party_items(1, SHAPE_VENOM, QUALITY_ANY, FRAME_ANY, true); say("Zauriel takes the Blackrock and the Silver Serpent venom from you. @Thank thee, Avatar.@"); //The cutscene: script ZAURIEL after 3 ticks { nohalt; finish; step NORTHEAST; wait 2; step EAST; actor frame STAND; wait 2; actor frame LEAN; wait 2; call zaurielMakePotion, PLACE_BLACKROCK; actor frame STAND; wait 2; step SOUTHWEST; wait 2; step WEST; wait 2; step WEST; actor frame STAND; wait 2; actor frame USE; call zaurielMakePotion, DELETE_POTIONS; wait 2; actor frame STAND; wait 2; step NORTHEAST; wait 2; repeat 2 {step EAST; wait 2;}; actor frame STAND; wait 2; actor frame USE; wait 2; call zaurielMakePotion, UPDATE_CAULDRON; actor frame STAND; wait 2; actor frame USE; wait 2; call zaurielMakePotion, UPDATE_CAULDRON; actor frame STAND; wait 2; repeat 2 {step SOUTH; wait 2;}; repeat 2 {step WEST; wait 2;}; actor frame STAND; wait 2; actor frame USE; call zaurielMakePotion, DELETE_POTIONS; wait 2; actor frame STAND; wait 2; repeat 2 {step NORTH; wait 2;}; repeat 2 {step EAST; wait 2;}; actor frame STAND; wait 2; actor frame USE; wait 2; call zaurielMakePotion, UPDATE_CAULDRON; actor frame STAND; wait 5; actor frame USE; call zaurielMakePotion, UPDATE_CAULDRON; wait 2; actor frame STAND; wait 2; call zaurielMakePotion, BEGIN_DIALOG_1; } } else if (event == PLACE_BLACKROCK) { var blackrock = UI_create_new_object(SHAPE_BLACKROCK); UI_update_last_created([1337, 2630, 2]); } else if (event == DELETE_POTIONS) { var potions = ZAURIEL->find_nearest(SHAPE_BLACKROCK_POTION, 3); potions->remove_item(); UI_play_sound_effect(SOUND_KEY); } else if (event == UPDATE_CAULDRON) { var cauldron = ZAURIEL->find_nearest(SHAPE_CAULDRON, 10); var blackrock = ZAURIEL->find_nearest(SHAPE_BLACKROCK, 10); var framemap = [ 4, -1, 3, 0, 2]; var sfxmap = [67, 67, 67, SOUND_KEY, 67]; var frameindex = cauldron->get_item_frame() + 1; if (blackrock) blackrock->UI_remove_item(); if (framemap[frameindex] != 0) UI_sprite_effect(ANIMATION_POOF, 1336, 2629, 0, 0, 0, -1); UI_play_sound_effect(sfxmap[frameindex]); cauldron->set_item_frame(framemap[frameindex]); } else if (event == BEGIN_DIALOG_1) { var potion; ZAURIEL->show_npc_face(0); say("Zauriel finally turns to you and hands you the potion. @Here, the potion is ready."); say("@Make good use of it, for I shall -not- give thee any more!@ In the vial is a glowing black potion."); //Try to create the potion in the Avatar's inventory: UI_set_last_created(get_cont_items(SHAPE_BLACKROCK_POTION, QUALITY_ANY, FRAME_ANY)); if (!AVATAR->give_last_created()) { say("@Since thou art so overburdened, I shall place the potion on the ground.@"); UI_update_last_created(AVATAR->get_object_position()); } //Remind the player that a piece of Blackrock is still needed: var blackrock_count = PARTY->count_objects(SHAPE_BLACKROCK, QUALITY_ANY, FRAME_ANY); if (!blackrock_count) say("@Remember that thou dost still need to gather a piece of Blackrock ore in order to neutralize the necklace!@"); say("@I shall now tell thee where my daughter is being held.@"); add("Where are they?"); converse (0) { case "Where are they?" (remove): say("@Yes, I was just about to say that! A little more patience, Avatar, if thou wilt!"); say("@There is a small island to the north of Skara Brae; that is where the mage and his thugs are located."); say("@My divinations indicate that they are in the northwestern portion of the island."); say("@There -is- the issue that the island is disconnected from the mainland, being reachable only by boat or through flying..."); say("@But thou art resourceful enough to bypass this minor obstacle.@"); gflags[ZAURIEL_TOLD_LOCATION] = true; } say("@Now that everything is said, I shall take us back to where we were.@"); //Teleportation animation: script item { nohalt; finish; face SOUTH; call showCastingFrames; actor frame CAST_1; wait 2; say "@Vas In Por@"; next frame; wait 2; previous frame; wait 2; next frame; wait 2; previous frame; sfx SOUND_TELEPORT; call zaurielMakePotion, TELEPORT_WIDGETS; wait 8; call zaurielMakePotion, POTION_FADE_SCREEN; actor frame STAND; wait 5; call zaurielMakePotion, MOVE_TO_LBCASTLE; } abort; } else if (event == MOVE_TO_LBCASTLE) { //item = ZAURIEL AVATAR->trueUnfreeze(); //Move Zauriel: move_object([0x3A2, 0x4E0, 0x0]); set_item_frame_rot(STAND_SOUTH); //Use Avatar to unfade screen: script AVATAR { face NORTH; wait 2; call zaurielMakePotion, POTION_UNFADE_SCREEN; wait 5; call zaurielMakePotion, BEGIN_DIALOG_2; } //Move party: pos = [0x3A2, 0x4E6, 0x0]; PARTY->move_object(pos); } else if (event == BEGIN_DIALOG_2) { ZAURIEL->show_npc_face(0); say("@Here we are again. Thou knowest now what needs to be done, so I ask thee to do so quickly."); say("@But before thou dost go, I must confess that I find this place far too crowded for me."); say("@When thou hast rescued my daughter, come meet me near the Skara Brae Moongate."); if (PARTY->count_objects(SHAPE_SEXTANT, QUALITY_ANY, FRAME_ANY)) say("@Thy sextant shall guide thee: I shall be at 45 degrees south, 38 degrees west.@"); else say("@Shouldst thou acquire a sextant, take this as a reference: I shall be at 45 degrees south, 38 degrees west.@"); giveExperience(100); //Fire the teleport animation and move Zauriel: gflags[ZAURIEL_TELEPORTED] = true; var pos = ZAURIEL->get_object_position(); UI_sprite_effect(ANIMATION_TELEPORT, pos[X], pos[Y], 0, 0, 0, -1); script ZAURIEL { nohalt; say "@Meet me near Skara Brae!@"; sfx SOUND_TELEPORT; wait 6; call zaurielMakePotion, TELEPORT_TO_SKARABRAE; } } else if (event == TELEPORT_TO_SKARABRAE) { //Move him to the destination: move_object([0x224, 0x630, 0x0]); set_item_frame_rot(STAND_SOUTH); set_new_schedules([DAWN, MORNING, AFTERNOON, EVENING, NIGHT], [WAIT, WAIT, WAIT, WAIT, WAIT], [0x224, 0x630, 0x224, 0x630, 0x224, 0x630, 0x224, 0x630, 0x224, 0x630]); } } --- NEW FILE: zauriel_ritual.uc --- /* * This source file contains usecode for the Keyring Quest. * Specifically, it contains the last cutscene of the quest. * * Author: Marzo Junior * Last Modified: 2001-01-20 */ enum Ritual_levels { BEGIN_RITUAL = 1, SPRITE_EFFECTS_LAURIANNA = 2, ERECT_BARRIER = 3, SPRITE_EFFECTS_ZAURIEL = 4, DRAGON_SHAPESHIFT = 5, PARTING_REMARKS = 6, BEGIN_ZAURIEL_COMBAT = 7, ZAURIEL_DIED = 8, RITUAL_END = 9 }; zaurielTeleportPartyAround () { //Get party list and append Laurianna: var party = [UI_get_party_list(), LAURIANNA->get_npc_object()]; var dist = 20; //Get Zauriel's position: var pos = get_object_position(); //Find nearby eggs: var eggs = pos->find_nearby(SHAPE_EGG, dist, MASK_EGG); //Find nearby barriers: var barriers = pos->find_nearby(SHAPE_BARRIER, 3 * dist, MASK_TRANLUCENT); var egg; var count = 0; var max; var index; var new_pos; //The only four which are allowed to fight: var companions = [UI_get_avatar_ref(), SHAMINO->get_npc_object(), IOLO->get_npc_object(), DUPRE->get_npc_object()]; for (egg in eggs with index to max) { //Each egg has a quality equal to the number //of a joinable NPC var qual = egg->get_item_quality(); var npc; if (qual == 0) //Quality 0 means it is for the avatar: npc = UI_get_avatar_ref(); else //Get a reference to the NPC npc = qual->get_npc_object(); if (npc in party) { //The NPC is in the party new_pos = egg->get_object_position(); if (!(npc in companions)) { //And he is not one of the 'companions' if (npc != LAURIANNA->get_npc_object()) //Remove npc from party npc->remove_from_party(); //Place them in WAIT mode facing south: npc->set_schedule_type(WAIT); npc->set_item_frame_rot(STAND_SOUTH); //Move the appropriate barrier: count = count + 1; pos = [new_pos[X] + 1, new_pos[Y] + 1, new_pos[Z]]; barriers[count]->move_object(pos); } //Move the NPC to the egg: UI_sprite_effect(ANIMATION_TELEPORT, new_pos[X], new_pos[Y], 0, 0, 0, -1); npc->move_object(new_pos); } //Remove the egg egg->remove_item(); } } zaurielRitualCutscene () { var pos; var barrier; var body; var zauriel_journal; if (event == BEGIN_RITUAL) { //item = ZAURIEL //Prevents all party movement: freezeParty(); //Make Laurianna invulnerable: pos = LAURIANNA->get_object_position(); LAURIANNA->set_item_shape(SHAPE_LAURIANNA_MONSTER); LAURIANNA->set_last_created(); UI_update_last_created(pos); pos = get_object_position(); UI_sprite_effect(ANIMATION_FIREWORKS, pos[X], pos[Y], 0, 0, 0, -1); item->begin_casting_mode(); //Zauriel script: script item { //cast spells: freeze party (Vas An Por), create magical barrier around //Laurianna (Vas Ort Sanct Grav) and move party around (Vas In Por): nohalt; continue; sfx 110; face NORTH; say "@Vas An Por@"; actor frame STAND; wait 1; actor frame CAST_1; wait 1; next frame; wait 1; previous frame; sfx 108; say "@Vas Ort Sanct Grav@"; wait 2; next frame; wait 2; previous frame; wait 2; next frame; wait 2; previous frame; sfx SOUND_TELEPORT; say "@Vas In Por@"; //Actually teleport the party: call zaurielTeleportPartyAround; //Long casting ritual: wait 2; actor frame SWING_2H_1; wait 2; next frame; wait 2; next frame; wait 3; //Make more spell effects: call zaurielRitualCutscene, SPRITE_EFFECTS_ZAURIEL; //Cast the dragon form spell (Rel An-Quas Ailem In BAL-ZEN) actor frame STAND; say "@Rel An-Quas...@"; actor frame CAST_1; wait 2; sfx 66; wait 2; next frame; wait 2; previous frame; wait 2; say "@...Ailem In BAL-ZEN@";wait 2; //Actually shapeshift Zauriel: call zaurielRitualCutscene, DRAGON_SHAPESHIFT; //Finish the ritual: next frame; sfx 64; wait 2; previous frame; wait 2; next frame; wait 2; face WEST; wait 2; //Say last words and wait a bit: call zaurielRitualCutscene, PARTING_REMARKS; wait 2; //Begin combat: call zaurielRitualCutscene, BEGIN_ZAURIEL_COMBAT; } var npc; var party = [UI_get_party_list(), LAURIANNA]; var index; var max; var companions = [UI_get_avatar_ref(), SHAMINO->get_npc_object(), IOLO->get_npc_object(), DUPRE->get_npc_object()]; for (npc in party with index to max) { if (!(npc in companions)) { script npc { nohalt; continue; wait 15; //Make the spell effects: call zaurielRitualCutscene, SPRITE_EFFECTS_LAURIANNA; wait 12; //Create the magical barrier: call zaurielRitualCutscene, ERECT_BARRIER; } } } //Avatar script: script AVATAR { nohalt; continue; wait 2; say "@I-I... I can't move!@"; } } else if (event == SPRITE_EFFECTS_LAURIANNA) { //item = LAURIANNA pos = get_object_position(); UI_sprite_effect(ANIMATION_CIRCLE_BARRIER, pos[X], pos[Y], 0, 0, 0, -1); } else if (event == ERECT_BARRIER) { //item varies //Create the protective barrier: pos = get_object_position(); barrier = UI_create_new_object(SHAPE_BARRIER); //Offset the position so that the barrier is in the right place: pos[X] = pos[X] + 1; pos[Y] = pos[Y] + 1; //Move the barrier to the target position: UI_update_last_created(pos); //Make the barrier temporary: barrier->set_item_flag(TEMPORARY); } else if (event == SPRITE_EFFECTS_ZAURIEL) { //item = ZAURIEL pos = get_object_position(); UI_sprite_effect(ANIMATION_FIREWORKS, pos[X], pos[Y], 0, 0, 0, -1); } else if (event == DRAGON_SHAPESHIFT) { //item = ZAURIEL //Turn Zauriel into a dragon: pos = get_object_position(); UI_sprite_effect(ANIMATION_PURPLE_BUBBLES, pos[X], pos[Y], 0, 0, 0, -1); UI_play_sound_effect2(SOUND_BIG_BLAST, item); set_item_shape(SHAPE_DRAGON); set_item_frame(0); set_last_created(); UI_update_last_created(pos); } else if (event == PARTING_REMARKS) { //item = ZAURIEL //Unfreeze the companions: AVATAR->trueUnfreeze(); if (isNearby(IOLO)) IOLO->trueUnfreeze(); if (isNearby(DUPRE)) DUPRE->trueUnfreeze(); if (isNearby(SHAMINO)) SHAMINO->trueUnfreeze(); //Speak using Dracothraxus' face: DRACOTHRAXUS_FACE.say("@I am truly sorry, Avatar, but I cannot think of a more worthy foe to bring about my demise!"); say("@Let the world know that I fell in glorious battle for the fate of my daughter!@"); } else if (event == BEGIN_ZAURIEL_COMBAT) { //item = ZAURIEL set_attack_mode(STRONGEST); //Have Zauriel start combat: item->trueUnfreeze(); set_alignment(2); pos = get_object_position(); set_schedule_type(IN_COMBAT); } else if (event == ZAURIEL_DIED) { //item = LAURIANNA //Unshapeshift Zauriel: body = find_nearest(SHAPE_LARGE_BODIES, 50); pos = body->get_object_position(); body->set_item_shape(SHAPE_BODIES_1); body->set_item_frame(FRAME_MONK_BODY_1); //The final effects of the ritual: UI_play_sound_effect2(SOUND_BIG_BLAST, body); UI_sprite_effect(ANIMATION_CIRCLE_BARRIER, pos[X], pos[Y], 0, 0, 0, -1); UI_sprite_effect(ANIMATION_LIGHTNING, pos[X], pos[Y], 0, 0, 0, -1); UI_sprite_effect(ANIMATION_FIREWORKS, pos[X], pos[Y], 0, 0, 0, -1); //Create the journal and place it on the body: zauriel_journal = UI_create_new_object(SHAPE_JOURNAL); zauriel_journal->set_item_quality(1); body->give_last_created(); //parting comment and body disposal: script body { wait 3; say "@*gasp* T-t-thank thee *gasp* *cough* Avatar... *urgh*@"; wait 12; remove;} unfreezeParty(); script item after 16 ticks call zaurielRitualCutscene, RITUAL_END; } else if (event == RITUAL_END) { //item = LAURIANNA pos = get_object_position(); //Final effects of the ritual: UI_play_sound_effect2(SOUND_BIG_BLAST, item); UI_sprite_effect(ANIMATION_CIRCLE_BARRIER, pos[X], pos[Y], 0, 0, 0, -1); UI_sprite_effect(ANIMATION_LIGHTNING, pos[X], pos[Y], 0, 0, 0, -1); UI_sprite_effect(ANIMATION_FIREWORKS, pos[X], pos[Y], 0, 0, 0, -1); //delete all magical barriers: var dist = 20; var barriers = pos->find_nearby(SHAPE_BARRIER, dist, MASK_TRANLUCENT); var obj; var max; var index; for (obj in barriers with index to max) script obj remove; item->trueUnfreeze(); //Mark Laurianna's cure: gflags[LAURIANNA_CURED] = true; //Make Laurianna vulnerable again: pos = LAURIANNA->get_object_position(); LAURIANNA->set_item_shape(SHAPE_LAURIANNA); LAURIANNA->set_last_created(); UI_update_last_created(pos); //Start dialog: script item after 10 ticks { nohalt; finish; say "@I-I am... cured?@"; wait 30; call Laurianna;} //More feedback: randomPartyBark(["@Look!@", "@A journal!@"]); } } |