Initial commit

This commit is contained in:
2025-02-07 00:23:09 +01:00
commit 22fd76a153
2841 changed files with 107275 additions and 0 deletions

View File

@@ -0,0 +1,652 @@
//ADD TOURNA FLAGS, SFX, etc....
//determine if brawlers are still brawling
var isBrawling (var npc)
{
if (UI_get_schedule_type(npc) == KID_GAMES)
return true;
else
return false;
}
void BrawlEngineJhelom object#() ()
{
//const int BRAWL_TIMER = 0; //sets Brawl timer if it's triggered outside of normal times (saying "rat" and so on). After 1 hour, will subside.
var brawl_timer = UI_get_npc_id(ARVIN); //using npc Arvin for "brawl timer". His npc ID will be incremented each time the brawl engine is called
var hour = UI_game_hour();
var atk_frame1;
var atk_frame2;
var atk_frame3;
var bark;
var brawl_sfx = [2, 3, 4, 5];
var rand_num_sfx;
var rand_sfx;
UI_set_schedule_type(CULHAM, KID_GAMES);
UI_set_schedule_type(STELNAR, KID_GAMES);
UI_set_schedule_type(JERRIS, KID_GAMES);
UI_set_schedule_type(NOMAAN, KID_GAMES);
UI_set_schedule_type(VANKELLIAN, KID_GAMES);
var attacking_frames = [SWING_1, SWING_2, SWING_3, SWING_2H_1, SWING_2H_2, SWING_2H_3, LEAN, KNEEL, LIE]; //1H and 2H swing frames
var barks = ["Thou bastard!", "Oof!", "'twas a rat!", "'twas a mouse!", "Argh!", "Thou bloodied my lip!", "Have at thee!", "Take that!", "Thou dost hit like a girl!", "Ouch that hurt!!"];
var brawling_npcs = [STELNAR, JERRIS, VANKELLIAN, CULHAM, NOMAAN];
var brawler;
UI_error_message("Brawl engine engaged!");
//something to run the script off of
var table = UI_find_object(FIND_ON_SCREEN, 847, QUALITY_ANY, FRAME_ANY);
//check to see if at least 1 brawler is nearby
if ((isNearby(STELNAR) || isNearby(JERRIS) || isNearby(VANKELLIAN) || isNearby(CULHAM) || isNearby(NOMAAN)) && gflags[BRAWLING])
{
var rand_ticks = UI_get_random(6);
var rand2 = UI_get_random(6);
var rand_npc = UI_get_random(5);
var rand_npc2 = UI_get_random(5);
var rand_bark = UI_get_random(UI_get_array_size(barks));
// 3/10 chance stuff getting thrown around:
var something_thrown = UI_get_random(10);
if (something_thrown >= 7)
{
var rand_1 = UI_die_roll(0385, 0430);
var rand_2 = UI_die_roll(2561, 2574);
var rand_frame = UI_get_random(16);
var pos = [rand_1, rand_2];
//get current dish count:
var broken_dishes = UI_count_objects(FIND_ON_SCREEN, 546, QUALITY_ANY, FRAME_ANY);
var dish = UI_find_object(FIND_ON_SCREEN, 546, QUALITY_ANY, FRAME_ANY);
if (broken_dishes < 50)
{
var brokendish = UI_create_new_object(546);
brokendish->set_item_frame(rand_frame);
brokendish->set_item_flag(TEMPORARY);
UI_update_last_created([pos]);
UI_play_sound_effect(37);
}
else
UI_remove_item(dish);
}
//add some barks for color:
var npc_to_bark = UI_get_random(6);
switch (npc_to_bark)
{
case 1:
if (isNearby(LYSSANDRA))
{
var lyssandra_barks = ["I just cleaned this place up!", "Watch it, ye oafs!", "Hey, that almost hit me!", "Take it outside, ya louts!", "What a mess!"];
var npc_bark = UI_get_random(UI_get_array_size(barks));
//bark
UI_item_say(LYSSANDRA, lyssandra_barks[npc_bark]);
}
break;
case 2:
if (isNearby(HEFTIMUS) && UI_get_schedule_type(HEFTIMUS, EAT_AT_INN))
{
var heftimus_barks = ["Watch it, mateys!", "Don't make me cut ya!", "Who threw that bottle?!", "I'll keelhaul the lot of ye!", "Ye call this a fight?"];
var npc_bark = UI_get_random(UI_get_array_size(barks));
//bark
UI_item_say(HEFTIMUS, heftimus_barks[npc_bark]);
}
break;
case 3:
if (isNearby(CULHAM))
{
var culham_barks = ["Hey, that didst hurt!", "Don't break my lute!", "It was a rat, I saw it!", "Don't punch so hard!", "Ow, my spleen!", "Not the face!"];
var npc_bark = UI_get_random(UI_get_array_size(barks));
//bark
UI_item_say(CULHAM, culham_barks[npc_bark]);
}
break;
case 4:
if (isNearby(STELNAR))
{
var stelnar_barks = ["T'was a mouse, Jerris!", "Take that!", "I'll cut you!", "Fight like a man, ya coward!", "Thou dost hit like a girl!", "My grandmother hits harder than you!"];
var npc_bark = UI_get_random(UI_get_array_size(barks));
//bark
UI_item_say(STELNAR, stelnar_barks[npc_bark]);
}
break;
case 5:
if (isNearby(JERRIS))
{
var jerris_barks = ["@It was a rat, Stelnar!@", "@Watch the face!@", "@Ow!@", "@Eat fist!@", "@Thou dost hit like a girl!@", "You call that a punch?"];
var npc_bark = UI_get_random(UI_get_array_size(barks));
//bark
UI_item_say(JERRIS, jerris_barks[npc_bark]);
}
break;
case 6:
if (isNearby(NOMAAN))
{
var nomaan_barks = ["@It was a rat, I saw it!@", "@Watch the face!@", "@Ow!@", "@No punching below the belt!@", "@Thou dost hit like a girl!@", "You call that a punch?", "Who threw the bottle?", "Come at me, wimpy man!"];
var npc_bark = UI_get_random(UI_get_array_size(barks));
//bark
UI_item_say(NOMAAN, nomaan_barks[npc_bark]);
}
break;
}
var npc = brawling_npcs[rand_npc];
//make sure both npcs aren't same
while (rand_npc == rand_npc2)
{
rand_npc2 = UI_get_random(5);
}
var npc2 = brawling_npcs[rand_npc2];
UI_error_message("Rand1 is " + rand_ticks);
if (isNearby(npc) && isBrawling(npc))
{
var rand_ticks = UI_get_random(6);
var rand2 = UI_get_random(6);
rand_num_sfx = UI_get_random(UI_get_array_size(brawl_sfx));
rand_sfx = brawl_sfx[rand_num_sfx];
bark = barks[rand_bark];
if (rand2 == 1)
{
atk_frame1 = attacking_frames[1];
atk_frame2 = attacking_frames[2];
atk_frame3 = attacking_frames[3];
}
else if (rand2 == 2)
{
atk_frame1 = attacking_frames[4];
atk_frame2 = attacking_frames[5];
atk_frame3 = attacking_frames[6];
}
else if (rand2 == 3)
{
atk_frame1 = attacking_frames[7];
atk_frame2 = attacking_frames[8];
atk_frame3 = attacking_frames[9];
}
else if (rand2 == 4)
{
atk_frame1 = attacking_frames[2];
atk_frame2 = attacking_frames[3];
atk_frame3 = attacking_frames[8];
}
else
{
atk_frame1 = attacking_frames[7];
atk_frame2 = attacking_frames[4];
atk_frame3 = attacking_frames[5];
}
script npc after rand_ticks ticks
{
call GenericFreeze;
nohalt;
actor frame atk_frame1;
actor frame atk_frame2;
actor frame atk_frame3;
say bark;
sfx rand_sfx;
call GenericUnfreeze;
};
///npc 2
rand2 = UI_get_random(6); //reroll
rand_bark = UI_get_random(UI_get_array_size(barks));
bark = barks[rand_bark];
rand_num_sfx = UI_get_random(UI_get_array_size(brawl_sfx));
rand_sfx = brawl_sfx[rand_num_sfx];
if (rand2 == 1)
{
atk_frame1 = attacking_frames[1];
atk_frame2 = attacking_frames[2];
atk_frame3 = attacking_frames[3];
}
else if (rand2 == 2)
{
atk_frame1 = attacking_frames[4];
atk_frame2 = attacking_frames[5];
atk_frame3 = attacking_frames[6];
}
else if (rand2 == 3)
{
atk_frame1 = attacking_frames[7];
atk_frame2 = attacking_frames[8];
atk_frame3 = attacking_frames[9];
}
else if (rand2 == 4)
{
atk_frame1 = attacking_frames[2];
atk_frame2 = attacking_frames[3];
atk_frame3 = attacking_frames[8];
}
else
{
atk_frame1 = attacking_frames[7];
atk_frame2 = attacking_frames[4];
atk_frame3 = attacking_frames[5];
}
script npc2 after rand_ticks + 5 ticks
{
call GenericFreeze;
nohalt;
actor frame atk_frame1;
actor frame atk_frame2;
actor frame atk_frame3;
sfx rand_sfx;
say bark;
call GenericUnfreeze;
};
}
// increment brawl timer if time is not within the 9pm to midnight range.
// if it's during the normal brawl hours we don't want the flag to reset
if (hour < 20)
{
UI_set_npc_id(ARVIN, brawl_timer + 1); //should increment by 1
}
script table after 30 ticks
{
call BrawlEngineJhelom;
};
}
else //no brawlers nearby
{
UI_error_message("No Jhelom brawlers detected nearby, turn off brawl engine.");
gflags[BRAWLING] = false;
UI_play_music(255, 0);
//reset 'brawl timer'
UI_set_npc_id(ARVIN, 0);
}
//people stopped brawling, turn off "Brawling" flag
if (brawl_timer > 30) //brawl has been going on for past a half hour
{
gflags[BRAWLING] = false;
UI_play_music(255, 0);
UI_error_message("Timer expired, turning off Brawling flag");
//reset 'brawl timer'
UI_set_npc_id(ARVIN, 0);
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
void BrawlEngineBucsDen object#() ()
{
var hour = UI_game_hour();
var atk_frame1;
var atk_frame2;
var atk_frame3;
var bark;
var brawl_sfx = [2, 3, 4, 5];
var rand_num_sfx;
var rand_sfx;
var attacking_frames = [SWING_1, SWING_2, SWING_3, SWING_2H_1, SWING_2H_2, SWING_2H_3, LEAN, KNEEL, LIE]; //1H and 2H swing frames
var barks = ["Thou bastard!", "Oof!", "I'll keelhaul the lot of ye!", "Eat fist!", "Argh!", "Thou bloodied my lip!", "Have at thee!", "Take that!", "Thou dost hit like a girl!", "Yar, that hurt!"];
var brawling_npcs = [CAPTAIN_FOX, CAPTAIN_ELAD, ENRIK, LEONNA, LEODON];
var brawler;
UI_error_message("Brawl engine engaged!");
//something to run the script off of
//var table = UI_find_object(FIND_ON_SCREEN, 964, QUALITY_ANY, FRAME_ANY);
var table = UI_find_nearby(AVATAR, 964, 31, MASK_NONE);
//table found and time is within midnight to 3am:
if ((table) && hour >= 0 && hour <= 3)
{
//check to see if at least 1 brawler is nearby
if ((isNearby(CAPTAIN_FOX) || isNearby(CAPTAIN_ELAD) || isNearby(ENRIK) || isNearby(LEONNA) || isNearby(LEODON)))
{
var rand_ticks = UI_get_random(6);
var rand2 = UI_get_random(6);
var rand_npc = UI_get_random(UI_get_array_size([brawling_npcs]));
var rand_npc2 = UI_get_random(UI_get_array_size([brawling_npcs]));
var rand_bark = UI_get_random(UI_get_array_size(barks));
// 3/10 chance stuff getting thrown around:
var something_thrown = UI_get_random(10);
if (something_thrown >= 7)
{
var rand_1 = UI_die_roll(1729, 1763);
var rand_2 = UI_die_roll(1847, 1868);
var rand_frame = UI_get_random(16);
var pos = [rand_1, rand_2];
//get current dish count:
var broken_dishes = UI_count_objects(FIND_ON_SCREEN, 546, QUALITY_ANY, FRAME_ANY);
var dish = UI_find_object(FIND_ON_SCREEN, 546, QUALITY_ANY, FRAME_ANY);
if (broken_dishes < 50)
{
var brokendish = UI_create_new_object(546);
brokendish->set_item_frame(rand_frame);
brokendish->set_item_flag(TEMPORARY);
UI_update_last_created([pos]);
UI_play_sound_effect(37);
}
else
UI_remove_item(dish);
}
//add some barks for color:
var npc_to_bark = UI_get_random(UI_get_array_size([brawling_npcs]));
switch (npc_to_bark)
{
case 1:
if (isNearby(CAPTAIN_FOX))
{
var fox_barks = ["Thou bastard!", "Oof!", "I'll keelhaul the lot of ye!", "Eat fist!", "Argh!", "Thou bloodied my lip!", "Have at thee!", "Take that!", "Thou dost hit like a girl!", "Yar, that hurt!"];
var npc_bark = UI_get_random(UI_get_array_size(barks));
//bark
UI_item_say(CAPTAIN_FOX, fox_barks[npc_bark]);
}
break;
case 2:
case 3:
if (isNearby(LEONNA))
{
var leonna_barks = ["Hey, that didst hurt!", "Ooof!", "Eat fist!", "Don't punch so hard!", "Who threw that?!", "Not the face!"];
var npc_bark = UI_get_random(UI_get_array_size(barks));
//bark
UI_item_say(LEONNA, leonna_barks[npc_bark]);
}
break;
case 4:
case 5:
if (isNearby(CAPTAIN_ELAD))
{
var elad_barks = ["Don't spill my tea!", "Who threw that bottle?!", "I'll cut you!", "Fight like a man, ya coward!", "Thou dost hit like a girl!", "Me grandmother hits harder than you!", "Yar, that hurt!"];
var npc_bark = UI_get_random(UI_get_array_size(barks));
//bark
UI_item_say(CAPTAIN_ELAD, elad_barks[npc_bark]);
}
break;
case 6:
if (isNearby(LEODON))
{
var leodon_barks = ["@You call that a punch?@", "@Ooof!@", "@Ow!@", "@I'll keelhaul ye!@", "@Bilgerat!@", "You call that a punch?", "Who threw the bottle?", "Come at me, wimpy man!"];
var npc_bark = UI_get_random(UI_get_array_size(barks));
//bark
UI_item_say(LEODON, leodon_barks[npc_bark]);
}
break;
}
var npc = brawling_npcs[rand_npc];
//make sure both npcs aren't same
while (rand_npc == rand_npc2)
{
rand_npc2 = UI_get_random(UI_get_array_size([brawling_npcs]));
}
var npc2 = brawling_npcs[rand_npc2];
UI_error_message("Rand1 is " + rand_ticks);
if (isNearby(npc) && UI_get_schedule_type(npc, KID_GAMES))
{
var rand_ticks = UI_get_random(UI_get_array_size([brawling_npcs]));
var rand2 = UI_get_random(UI_get_array_size([brawling_npcs]));
rand_num_sfx = UI_get_random(UI_get_array_size(brawl_sfx));
rand_sfx = brawl_sfx[rand_num_sfx];
bark = barks[rand_bark];
if (rand2 == 1)
{
atk_frame1 = attacking_frames[1];
atk_frame2 = attacking_frames[2];
atk_frame3 = attacking_frames[3];
}
else if (rand2 == 2)
{
atk_frame1 = attacking_frames[4];
atk_frame2 = attacking_frames[5];
atk_frame3 = attacking_frames[6];
}
else if (rand2 == 3)
{
atk_frame1 = attacking_frames[7];
atk_frame2 = attacking_frames[8];
atk_frame3 = attacking_frames[9];
}
else if (rand2 == 4)
{
atk_frame1 = attacking_frames[2];
atk_frame2 = attacking_frames[3];
atk_frame3 = attacking_frames[8];
}
else
{
atk_frame1 = attacking_frames[7];
atk_frame2 = attacking_frames[4];
atk_frame3 = attacking_frames[5];
}
script npc after rand_ticks ticks
{
call GenericFreeze;
nohalt;
actor frame atk_frame1;
actor frame atk_frame2;
actor frame atk_frame3;
say bark;
sfx rand_sfx;
call GenericUnfreeze;
};
///npc 2
rand2 = UI_get_random(UI_get_array_size([brawling_npcs])); //reroll
rand_bark = UI_get_random(UI_get_array_size(barks));
bark = barks[rand_bark];
rand_num_sfx = UI_get_random(UI_get_array_size(brawl_sfx));
rand_sfx = brawl_sfx[rand_num_sfx];
if (rand2 == 1)
{
atk_frame1 = attacking_frames[1];
atk_frame2 = attacking_frames[2];
atk_frame3 = attacking_frames[3];
}
else if (rand2 == 2)
{
atk_frame1 = attacking_frames[4];
atk_frame2 = attacking_frames[5];
atk_frame3 = attacking_frames[6];
}
else if (rand2 == 3)
{
atk_frame1 = attacking_frames[7];
atk_frame2 = attacking_frames[8];
atk_frame3 = attacking_frames[9];
}
else if (rand2 == 4)
{
atk_frame1 = attacking_frames[2];
atk_frame2 = attacking_frames[3];
atk_frame3 = attacking_frames[8];
}
else
{
atk_frame1 = attacking_frames[7];
atk_frame2 = attacking_frames[4];
atk_frame3 = attacking_frames[5];
}
script npc2 after rand_ticks + 5 ticks
{
call GenericFreeze;
nohalt;
actor frame atk_frame1;
actor frame atk_frame2;
actor frame atk_frame3;
sfx rand_sfx;
say bark;
call GenericUnfreeze;
};
}
script table after 25 ticks
{
call BrawlEngineBucsDen;
};
}
else //no brawlers nearby
{
UI_error_message("No brawlers nearby, abort");
abort;
}
}
else //left area or time isn't right
{
UI_error_message("Table not found or time is not early morning. Stop Bucs Den brawling");
abort;
}
}

View File

@@ -0,0 +1,103 @@
//30 ticks per minute
enum moonglow_crypts
{
GOT_RUNE = 1,
WALK_OUTSIDE = 2,
GUARD_TALK = 3
};
void getRuneHonesty object#() ()
{
var party = UI_get_party_list();
if (event == GOT_RUNE)
{
AVATAR->GenericUnfreeze();
if (party > 1)
{
randomPartyBark("@We have the rune, let's go.@");
script AVATAR after 5 ticks
{
call getRuneHonesty, WALK_OUTSIDE;
};
}
else script AVATAR after 15 ticks { call getRuneHonesty, WALK_OUTSIDE;};
}
if (event == WALK_OUTSIDE)
{
THUG1->clear_item_flag(DONT_RENDER);
THUG2->clear_item_flag(DONT_RENDER);
THUG3->clear_item_flag(DONT_RENDER);
THUG4->clear_item_flag(DONT_RENDER);
THUG5->clear_item_flag(DONT_RENDER);
THUG6->clear_item_flag(DONT_RENDER);
THUG7->clear_item_flag(DONT_RENDER);
if (inParty(SHAMINO))
delayedBark(SHAMINO, "@Ambush!@" , 10);
UI_si_path_run_usecode(AVATAR, [2344, 2968]);
script THUG1 after 25 ticks
{
call getRuneHonesty, GUARD_TALK;
};
}
if (event == GUARD_TALK)
{
AVATAR->GenericUnfreeze();
var polite_title = getPoliteTitle();
//UI_show_npc_face(259, 0);
THUG1.say("Approaching from seemingly out of nowhere, an unsavoury-looking guard stands before you. His henchmen take up positions, blocking all routes of escape.");
THUG1.say("@We been waitin' to break into that vault for a while now. As luck would have it, thou didst come along with a key to open the door.@");
THUG1.say("He notices you clutching the Rune of Honesty.");
THUG1.say("@Say.. that be quite a trinket thou'rt carrying. T'would fetch us fair price on the antiquities market. Much too valuable for the likes of ye...@");
if (inParty(SHAMINO))
{
SHAMINO.say("Noticing the rogue guard's henchmen slowly closing in, Shamino leans towards you and whispers. @Careful " + polite_title + ", these grave-robbers have us surrounded...@");
SHAMINO.say("Shamino clutches his weapon, never once keeping his eyes off the bandits.");
SHAMINO.hide();
}
THUG1.say("@Well " + polite_title + ", it is thy lucky day. Hand over that artifact and we won't kill ye.@");
if (inParty(DUPRE))
{
DUPRE.say("@Knave, the Avatar will not give in to such a request from a petty criminal such as thyself!@");
DUPRE.hide();
}
THUG1.say("@What will it be?@");
if (askYesNo())
{
THUG1.say("Seeing you pull out the rune, they attack anyway!");
subtractKarma(10); //cowardly!
}
else
{
AVATAR.say("You put the rune into your pack and draw your weapon, declining the rogue's request.");
THUG1.say("The rogue guard scoffs, as if he actually expected you to hand over the Rune.");
THUG1.say("@Suits thyself. Prepare to join these unfortunate souls in the abyss...@");
}
UI_set_schedule_type(THUG1, IN_COMBAT);
UI_set_schedule_type(THUG2, IN_COMBAT);
UI_set_schedule_type(THUG3, IN_COMBAT);
UI_set_schedule_type(THUG4, IN_COMBAT);
UI_set_schedule_type(THUG5, IN_COMBAT);
UI_set_schedule_type(THUG6, IN_COMBAT);
UI_set_schedule_type(THUG7, IN_COMBAT);
delayedBark(item, "To the death!", 3);
return;
}
}

View File

@@ -0,0 +1,320 @@
void SherryGetRune object# () ()
{
var party = UI_get_party_list();
var npc;
//set flag to prevent Sher-nanigans
gflags[AVATAR_IS_SHERRY] = true;
//get Avatar and Sherry's location
var SherryPos = UI_get_object_position(SHERRY);
var AvatarPos = UI_get_object_position(AVATAR);
//find position of path egg to "store" Avatar's location
var PathEgg = UI_find_object(FIND_ON_SCREEN, 607, QUALITY_ANY, FRAME_ANY);
var PathEggPos = UI_get_object_position(PathEgg);
//get Avatar's attributes:
var AvatarName = getAvatarName();
var AvatarStr = UI_get_npc_prop(UI_get_avatar_ref(), STRENGTH);
var AvatarDex = UI_get_npc_prop(UI_get_avatar_ref(), DEXTERITY);
var AvatarInt = UI_get_npc_prop(UI_get_avatar_ref(), INTELLIGENCE);
var AvatarCombat = UI_get_npc_prop(UI_get_avatar_ref(), COMBAT);
var AvatarMagic = UI_get_npc_prop(UI_get_avatar_ref(), MAX_MANA);
var AvatarHits = UI_get_npc_prop(UI_get_avatar_ref(), HEALTH);
var AvatarMana = UI_get_npc_prop(UI_get_avatar_ref(), MANA);
var AvatarExp = UI_get_npc_prop(UI_get_avatar_ref(), EXPERIENCE);
var AvatarTraining = UI_get_npc_prop(UI_get_avatar_ref(), TRAINING);
var AvatarFood = UI_get_npc_prop(UI_get_avatar_ref(), FOODLEVEL);
var AvatarShape = UI_get_item_shape(AVATAR);
//get Sherry's attributes
var SherryStr = UI_get_npc_prop(SHERRY, STRENGTH);
var SherryDex = UI_get_npc_prop(SHERRY, DEXTERITY);
var SherryInt = UI_get_npc_prop(SHERRY, INTELLIGENCE);
var SherryCombat = UI_get_npc_prop(SHERRY, COMBAT);
var SherryMagic = UI_get_npc_prop(SHERRY, MAX_MANA);
var SherryHits = UI_get_npc_prop(SHERRY, HEALTH);
var SherryMana = UI_get_npc_prop(SHERRY, MANA);
var SherryExp = UI_get_npc_prop(SHERRY, EXPERIENCE);
var SherryTraining = UI_get_npc_prop(SHERRY, TRAINING);
var SherryFood = UI_get_npc_prop(SHERRY, FOODLEVEL);
//set GENRICSHRINE's experience to Sherry's as a place holder
GENERICSHRINE->set_npc_prop(EXPERIENCE, SherryExp*2); //npc 255 MAMA
//set "HolderGuy"'s name and stats to Avatar's
var HolderGuyName = getAvatarName();
UI_set_item_shape(HOLDERGUY, AvatarShape); //should set HolderGuy to Avatar shape.
UI_set_npc_prop(HOLDERGUY, STRENGTH, AvatarStr);
UI_set_npc_prop(HOLDERGUY, DEXTERITY, AvatarDex);
UI_set_npc_prop(HOLDERGUY, INTELLIGENCE, AvatarInt);
UI_set_npc_prop(HOLDERGUY, COMBAT, AvatarCombat);
UI_set_npc_prop(HOLDERGUY, MAX_MANA, AvatarMagic);
UI_set_npc_prop(HOLDERGUY, HEALTH, AvatarHits);
UI_set_npc_prop(HOLDERGUY, MANA, AvatarMana);
UI_set_npc_prop(HOLDERGUY, EXPERIENCE, AvatarExp*2);
UI_set_npc_name(HOLDERGUY, AvatarName);
UI_set_npc_prop(HOLDERGUY, FOODLEVEL, AvatarFood);
UI_set_npc_prop(BLORN, TRAINING, AvatarTraining); //to avoid extra training points, NPC is 208 - Blorn
//Get HolderGuys's new Avatar stats
var HolderGuyStr = UI_get_npc_prop(HOLDERGUY, STRENGTH);
var HolderGuyDex = UI_get_npc_prop(HOLDERGUY, DEXTERITY);
var HolderGuyInt = UI_get_npc_prop(HOLDERGUY, INTELLIGENCE);
var HolderGuyCombat = UI_get_npc_prop(HOLDERGUY, COMBAT);
var HolderGuyMagic = UI_get_npc_prop(HOLDERGUY, MAX_MANA);
var HolderGuyHits = UI_get_npc_prop(HOLDERGUY, HEALTH);
var HolderGuyMana = UI_get_npc_prop(HOLDERGUY, MANA);
var HolderGuyExp = UI_get_npc_prop(HOLDERGUY, EXPERIENCE);
var HolderGuyTraining = UI_get_npc_prop(HOLDERGUY, TRAINING);
var HolderGuyFood = UI_get_npc_prop(HOLDERGUY, FOODLEVEL);
var BlornTraining = UI_get_npc_prop(BLORN, TRAINING); //npc 255
//Transfer Avatar's inventory to Holder Guy npc # 250
//Transfer Sherry's inventory to Avatar
//transfer HolderGuy's inventory to Sherry
transferAllItems(AVATAR, HOLDERGUY);
transferAllItems(SHERRY, AVATAR);
transferAllItems(HOLDERGUY, SHERRY);
//swap names, shape, attributes with Sherry
// ****Commented out, paperdolls don't switch upon polymorph. Using shape change instead.
AVATAR->set_polymorph(478); //Sherry shape
// SHERRY->set_polymorph(AvatarShape); //stored by HolderGuy
// AVATAR->set_item_shape(478); //Sherry shape
SHERRY->set_item_shape(AvatarShape); //stored by HolderGuy
AVATAR->set_npc_name("Sherry");
SHERRY->set_npc_name(HolderGuyName);
AVATAR->set_npc_prop(STRENGTH, SherryStr-HolderGuyStr);
SHERRY->set_npc_prop(STRENGTH, HolderGuyStr-SherryStr);
AVATAR->set_npc_prop(DEXTERITY, SherryDex-HolderGuyDex);
SHERRY->set_npc_prop(DEXTERITY, HolderGuyDex-SherryDex);
AVATAR->set_npc_prop(INTELLIGENCE, SherryInt-HolderGuyInt);
SHERRY->set_npc_prop(INTELLIGENCE, HolderGuyInt-SherryInt);
AVATAR->set_npc_prop(COMBAT, SherryCombat-HolderGuyCombat);
SHERRY->set_npc_prop(COMBAT, HolderGuyCombat-SherryCombat); //
AVATAR->set_npc_prop(MAX_MANA, SherryMagic-HolderGuyMagic); //
SHERRY->set_npc_prop(MAX_MANA, HolderGuyMagic-SherryMagic); //
AVATAR->set_npc_prop(HEALTH, SherryHits-HolderGuyHits); //
SHERRY->set_npc_prop(HEALTH, HolderGuyHits-SherryHits); //
AVATAR->set_npc_prop(MANA, SherryMana-HolderGuyMana); //
SHERRY->set_npc_prop(MANA, HolderGuyMana-SherryMana); //
AVATAR->set_npc_prop(EXPERIENCE, (SherryExp-HolderGuyExp)*2); // Exult adds Half of number used, so multiplying by 2 gives correct XP
SHERRY->set_npc_prop(EXPERIENCE, (HolderGuyExp-SherryExp)*2); //
//get Sherry new training
var SherryNewTrain = UI_get_npc_prop(SHERRY, TRAINING);
var AvatarNewTrain = UI_get_npc_prop(AVATAR, TRAINING);
AVATAR->set_npc_prop(FOODLEVEL, SherryFood-HolderGuyFood);
SHERRY->set_npc_prop(FOODLEVEL, HolderGuyFood-SherryFood);
AVATAR->set_npc_prop(TRAINING, -SherryNewTrain); //zero out incorrect training points
SHERRY->set_npc_prop(TRAINING, -SherryNewTrain); //
AVATAR->set_npc_prop(TRAINING, SherryTraining); //add correct training points
SHERRY->set_npc_prop(TRAINING, BlornTraining); //
//swap Sherry and Avatar locations
PathEgg->move_object(AvatarPos);
AVATAR->move_object(SherryPos);
SHERRY->move_object(AvatarPos); //should be path egg pos but for testing
//Freeze party
for (npc in party with index to max)
{
npc->set_schedule_type(WAIT);
npc->set_item_flag(DEAD); //to prevent Sherry from speaking to the party
}
AVATAR->clear_item_flag(DEAD); //Don't want Avatar dead..
}
void UndoSherrySwap object# () ()
{
var party = UI_get_party_list();
var npc;
//clear flag to prevent Sher-nanigans
gflags[AVATAR_IS_SHERRY] = false;
//get Avatar and Sherry's location
var SherryPos = UI_get_object_position(SHERRY);
var AvatarPos = UI_get_object_position(AVATAR);
//find position of path egg to "store" Avatar's location
var PathEgg = UI_find_object(FIND_ON_SCREEN, 607, QUALITY_ANY, FRAME_ANY);
var PathEggPos = UI_get_object_position(PathEgg);
//get Avatar's attributes:
var AvatarName = getAvatarName();
var AvatarStr = UI_get_npc_prop(UI_get_avatar_ref(), STRENGTH);
var AvatarDex = UI_get_npc_prop(UI_get_avatar_ref(), DEXTERITY);
var AvatarInt = UI_get_npc_prop(UI_get_avatar_ref(), INTELLIGENCE);
var AvatarCombat = UI_get_npc_prop(UI_get_avatar_ref(), COMBAT);
var AvatarMagic = UI_get_npc_prop(UI_get_avatar_ref(), MAX_MANA);
var AvatarHits = UI_get_npc_prop(UI_get_avatar_ref(), HEALTH);
var AvatarMana = UI_get_npc_prop(UI_get_avatar_ref(), MANA);
var AvatarExp = UI_get_npc_prop(UI_get_avatar_ref(), EXPERIENCE);
var AvatarTraining = UI_get_npc_prop(UI_get_avatar_ref(), TRAINING);
var AvatarFood = UI_get_npc_prop(UI_get_avatar_ref(), FOODLEVEL);
//get Sherry's attributes
var SherryStr = UI_get_npc_prop(SHERRY, STRENGTH);
var SherryDex = UI_get_npc_prop(SHERRY, DEXTERITY);
var SherryInt = UI_get_npc_prop(SHERRY, INTELLIGENCE);
var SherryCombat = UI_get_npc_prop(SHERRY, COMBAT);
var SherryMagic = UI_get_npc_prop(SHERRY, MAX_MANA);
var SherryHits = UI_get_npc_prop(SHERRY, HEALTH);
var SherryMana = UI_get_npc_prop(SHERRY, MANA);
var SherryExp = UI_get_npc_prop(SHERRY, EXPERIENCE);
var SherryTraining = UI_get_npc_prop(SHERRY, TRAINING);
var SherryFood = UI_get_npc_prop(SHERRY, FOODLEVEL);
//set "HolderGuy"'s name and stats to Avatar's
var AvatarShape = UI_get_item_shape(HOLDERGUY);
var HolderGuyName = UI_get_npc_name(HOLDERGUY);
//Get HolderGuys's new Avatar stats
var HolderGuyStr = UI_get_npc_prop(HOLDERGUY, STRENGTH);
var HolderGuyDex = UI_get_npc_prop(HOLDERGUY, DEXTERITY);
var HolderGuyInt = UI_get_npc_prop(HOLDERGUY, INTELLIGENCE);
var HolderGuyCombat = UI_get_npc_prop(HOLDERGUY, COMBAT);
var HolderGuyMagic = UI_get_npc_prop(HOLDERGUY, MAX_MANA);
var HolderGuyHits = UI_get_npc_prop(HOLDERGUY, HEALTH);
var HolderGuyMana = UI_get_npc_prop(HOLDERGUY, MANA);
var HolderGuyExp = UI_get_npc_prop(HOLDERGUY, EXPERIENCE);
var HolderGuyTraining = UI_get_npc_prop(HOLDERGUY, TRAINING);
var HolderGuyFood = UI_get_npc_prop(HOLDERGUY, FOODLEVEL);
var GenericShrineExp = UI_get_npc_prop(GENERICSHRINE, EXPERIENCE); //Sherry's XP Place holder
var BlornTraining = UI_get_npc_prop(BLORN, TRAINING); //npc 255
//reset shapes
SHERRY->set_item_shape(478); //Sherry shape
//AVATAR->set_item_shape(AvatarShape); //stored by HolderGuy
UI_clear_item_flag(AVATAR, POLYMORPH); //to accurately change Avatar's shape back
UI_set_npc_name(AVATAR, HolderGuyName);
SHERRY->set_npc_name("Sherry");
SHERRY->set_npc_prop(STRENGTH, -SherryStr); //zero out first
SHERRY->set_npc_prop(STRENGTH, AvatarStr); //add Sherry's back
AVATAR->set_npc_prop(STRENGTH, -AvatarStr); //zero out
AVATAR->set_npc_prop(STRENGTH, HolderGuyStr); //add HolderGuy's str
SHERRY->set_npc_prop(DEXTERITY, -SherryDex); //zero out first
SHERRY->set_npc_prop(DEXTERITY, AvatarDex); //add Sherry's back
AVATAR->set_npc_prop(DEXTERITY, -AvatarDex); //zero out
AVATAR->set_npc_prop(DEXTERITY, HolderGuyDex); //add HolderGuy's str
SHERRY->set_npc_prop(INTELLIGENCE, -SherryInt); //zero out first
SHERRY->set_npc_prop(INTELLIGENCE, AvatarInt); //add Sherry's back
AVATAR->set_npc_prop(INTELLIGENCE, -AvatarInt); //zero out
AVATAR->set_npc_prop(INTELLIGENCE, HolderGuyInt); //add HolderGuy's Int
SHERRY->set_npc_prop(COMBAT, -SherryCombat); //zero out first
SHERRY->set_npc_prop(COMBAT, AvatarCombat); //add Sherry's back
AVATAR->set_npc_prop(COMBAT, -AvatarCombat); //zero out
AVATAR->set_npc_prop(COMBAT, HolderGuyCombat); //add HolderGuy's Combat
SHERRY->set_npc_prop(MAX_MANA, -SherryMagic); //zero out first
SHERRY->set_npc_prop(MAX_MANA, AvatarMagic); //add Sherry's back
AVATAR->set_npc_prop(MAX_MANA, -AvatarMagic); //zero out
AVATAR->set_npc_prop(MAX_MANA, HolderGuyMagic); //add HolderGuy's Magic
SHERRY->set_npc_prop(HEALTH, -SherryHits); //zero out first
SHERRY->set_npc_prop(HEALTH, AvatarHits); //add Sherry's back
AVATAR->set_npc_prop(HEALTH, -AvatarHits); //zero out
AVATAR->set_npc_prop(HEALTH, HolderGuyHits); //add HolderGuy's Hits
SHERRY->set_npc_prop(MANA, -SherryMana); //zero out first
SHERRY->set_npc_prop(MANA, AvatarMana); //add Sherry's back
AVATAR->set_npc_prop(MANA, -AvatarMana); //zero out
AVATAR->set_npc_prop(MANA, HolderGuyMana); //add HolderGuy's Mana
//Zero out EXP and re-add
SHERRY->set_npc_prop(EXPERIENCE, -SherryExp*2); //testing purpose - Sherry's STR is 5
AVATAR->set_npc_prop(EXPERIENCE, -AvatarExp*2); //testing purposes - Avatar STR is 18
SHERRY->set_npc_prop(EXPERIENCE, GenericShrineExp*2); //testing purpose - Sherry's STR is 5
AVATAR->set_npc_prop(EXPERIENCE, HolderGuyExp*2); //testing purposes - Avatar STR is 18
//get Sherry new training
var SherryNewTrain = UI_get_npc_prop(SHERRY, TRAINING);
var AvatarNewTrain = UI_get_npc_prop(AVATAR, TRAINING);
SHERRY->set_npc_prop(FOODLEVEL, SherryFood-HolderGuyFood); //testing purposes - Avatar STR is 18
AVATAR->set_npc_prop(FOODLEVEL, HolderGuyFood-SherryFood); //testing purpose - Sherry's STR is 5
SHERRY->set_npc_prop(TRAINING, -SherryNewTrain); //zero out incorrect training points
AVATAR->set_npc_prop(TRAINING, -AvatarNewTrain); //
SHERRY->set_npc_prop(TRAINING, SherryTraining); //need to make holder training points for Sherry
AVATAR->set_npc_prop(TRAINING, BlornTraining); // Using new npc 255
//swap Sherry and Avatar locations
PathEgg->move_object(SherryPos);
SHERRY->move_object(AvatarPos);
AVATAR->move_object(SherryPos); //should be path egg pos but for testing
//Transfer Avatar's inventory to Holder Guy npc # 250
//Transfer Sherry's inventory to Avatar
//transfer HolderGuy's inventory to Sherry
transferAllItems(AVATAR, HOLDERGUY);
transferAllItems(SHERRY, AVATAR);
transferAllItems(HOLDERGUY, SHERRY);
//UnFreeze party
for (npc in party with index to max)
{
npc->set_schedule_type(STANDTHERE);
npc->clear_item_flag(DEAD); //to prevent Sherry from speaking to the party
}
//Set global flag to prevent Sherry switch again.
gflags[GOT_VALOR_RUNE] = true;
}

View File

@@ -0,0 +1,387 @@
/*
* Copyright 2018 Scott Cooper
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation,
* either version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
/*
* This is a cremation function for Glen the Undertaker in U6.
*
* 2018-12-23 Knight Captain
*/
void greenCremation object#(0x9D6) ()
{
var body_400_frames;
var body_402_frames;
var body_414_frames;
var body_507_frames;
var body_762_frames;
var body_892_frames;
var total_count;
var body_count;
var each;
var body_400_shape;
var body_402_shape;
var body_414_shape;
var body_507_shape;
var body_762_shape;
var body_892_shape;
var bodies;
var index;
var max;
var frame;
var frame_index;
var frame_max;
var valid_bodies;
const int SHAPE_BODY1 = 400;
const int SHAPE_BODY2 = 414;
const int SHAPE_BODY3 = 762;
const int SHAPE_BODY4 = 892; //need to limit by frames
var body_frames4 = [1, 2, 3, 4, 5, 6, 7, 10, 11, 29];
const int SHAPE_BODY5 = 1140;
UI_error_message(""); // Blank line.
UI_error_message("greenCremation starting.");
///////////////////////////////////////////////////////////////////////////
// Since some frames of each body shape either cannot or should not be cremated,
// we have to list individual frames. These are SI-specific.
// Excludes Petra and 29 which is blank.
body_400_frames = ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28]);
UI_error_message("greenCremation body_400_frames are ", body_400_frames, ".");
// Excludes monsters, undead, and brass automaton, as well as 24 which is blank.
body_402_frames = ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 14, 15, 20,
22, 23, 26, 27, 28, 30]);
UI_error_message("greenCremation body_402_frames are ", body_402_frames, ".");
// Excludes party members, Cantra, and 26 which is blank.
body_414_frames = ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17,
22, 23, 24, 25, 27, 28, 29, 30, 31]);
UI_error_message("greenCremation body_414_frames are ", body_414_frames, ".");
// Torsos, Gwani body frames, the rest are skeletons.
body_507_frames = ([11, 12, 14, 15, 16]);
UI_error_message("greenCremation body_507_frames are ", body_507_frames, ".");
// Most frames are monsters or dead Banes.
body_762_frames = ([5, 6, 8, 9, 11, 22, 23, 24]);
UI_error_message("greenCremation body_762_frames are ", body_762_frames, ".");
// Most frames are monsters or dead Banes.
body_892_frames = ([23, 29, 30]);
UI_error_message("greenCremation body_892_frames are ", body_892_frames, ".");
///////////////////////////////////////////////////////////////////////////
// Let's check if there are any bodies at all.
total_count = (UI_count_objects(PARTY, SHAPE_BODY1, QUALITY_ANY, FRAME_ANY));
total_count = (total_count + UI_count_objects(PARTY, SHAPE_BODY1, QUALITY_ANY, FRAME_ANY));
total_count = (total_count + UI_count_objects(PARTY, SHAPE_BODY2, QUALITY_ANY, FRAME_ANY));
total_count = (total_count + UI_count_objects(PARTY, SHAPE_BODY3, QUALITY_ANY, FRAME_ANY));
total_count = (total_count + UI_count_objects(PARTY, SHAPE_BODY4, QUALITY_ANY, FRAME_ANY));
total_count = (total_count + UI_count_objects(PARTY, SHAPE_BODY5, QUALITY_ANY, FRAME_ANY));
UI_error_message("greenCremation The Party has ", total_count, " of all movable bodies of any frame.");
if (total_count == 0)
{
// Add a Party size check.
say("@You and your companions do not appear to be carrying any bodies.@");
//return;
}
///////////////////////////////////////////////////////////////////////////
// Now we check the Party for each shape.
UI_error_message("");
body_count = UI_count_objects(PARTY, SHAPE_BODY1, QUALITY_ANY, FRAME_ANY);
if (body_count >= 1)
{
UI_error_message("greenCremation The Party has ", body_count, " of SHAPE_BODY1.");
body_400_shape = getPartyItems(SHAPE_BODY1, QUALITY_ANY, FRAME_ANY);
UI_error_message("greenCremation SHAPE_BODY1 returns ", body_400_shape, ".");
for (each in body_400_shape with index to max)
{
// Check for the relevant frames, even if rotated.
frame = UI_get_item_frame(each);
UI_error_message("greenCremation Frame ", frame, " found.");
if (frame in body_400_frames)
{
// This check is necessary to prevent a non-existence "found" being counted by UI_get_array_size below.
if (bodies == 0)
bodies = each;
else
bodies = (bodies & each);
UI_error_message("greenCremation SHAPE_BODY1, frame ", frame, " added to bodies array.");
}
else
UI_error_message("greenCremation SHAPE_BODY1, frame ", frame, " was NOT added to bodies array.");
}
valid_bodies = UI_get_array_size(bodies);
UI_error_message("greenCremation The burnable humanoid body count is now ", valid_bodies, ".");
}
else
UI_error_message("greenCremation SHAPE_BODY1 was not found in the Party.");
UI_error_message("");
// Body 402
body_count = (UI_count_objects(PARTY, SHAPE_BODY_402, QUALITY_ANY, FRAME_ANY));
if (body_count >= 1)
{
UI_error_message("greenCremation The Party has ", body_count, " of SHAPE_BODY_402.");
body_402_shape = getPartyItems(SHAPE_BODY_402, QUALITY_ANY, FRAME_ANY);
for (each in body_402_shape with index to max)
{
// Check for the relevant frames, even if rotated.
frame = UI_get_item_frame(each);
UI_error_message("greenCremation Frame ", frame, " found.");
if (frame in body_402_frames)
{
// This check is necessary to prevent a non-existence "found" being counted by UI_get_array_size below.
if (bodies == 0)
bodies = each;
else
bodies = (bodies & each);
UI_error_message("greenCremation SHAPE_BODY_402, frame ", frame, " added to bodies array.");
}
else
UI_error_message("greenCremation SHAPE_BODY_402, frame ", frame, " was NOT added to bodies array.");
}
valid_bodies = UI_get_array_size(bodies);
UI_error_message("greenCremation The burnable humanoid body count is now ", valid_bodies, ".");
}
else
UI_error_message("greenCremation SHAPE_BODY_402 was not found in the Party.");
UI_error_message("");
// Body 414
body_count = (UI_count_objects(PARTY, SHAPE_BODY_414, QUALITY_ANY, FRAME_ANY));
if (body_count >= 1)
{
UI_error_message("greenCremation The Party has ", body_count, " of SHAPE_BODY_414.");
body_414_shape = getPartyItems(SHAPE_BODY_414, QUALITY_ANY, FRAME_ANY);
for (each in body_414_shape with index to max)
{
// Check for the relevant frames, even if rotated.
frame = UI_get_item_frame(each);
UI_error_message("greenCremation Frame ", frame, " found.");
if (frame in body_414_frames)
{
// This check is necessary to prevent a non-existence "found" being counted by UI_get_array_size below.
if (bodies == 0)
bodies = each;
else
bodies = (bodies & each);
UI_error_message("greenCremation SHAPE_BODY_414, frame ", frame, " added to bodies array.");
}
else
UI_error_message("greenCremation SHAPE_BODY_414, frame ", frame, " was NOT added to bodies array.");
}
valid_bodies = UI_get_array_size(bodies);
UI_error_message("greenCremation The burnable humanoid body count is now ", valid_bodies, ".");
}
else
UI_error_message("greenCremation SHAPE_BODY_414 was not found in the Party.");
UI_error_message("");
// Body 507
body_count = (UI_count_objects(PARTY, SHAPE_BODY_SKELETON, QUALITY_ANY, FRAME_ANY));
if (body_count >= 1)
{
UI_error_message("greenCremation The Party has ", body_count, " of SHAPE_BODY_SKELETON (507).");
body_507_shape = getPartyItems(SHAPE_BODY_SKELETON, QUALITY_ANY, FRAME_ANY);
for (each in body_507_shape with index to max)
{
// Check for the relevant frames, even if rotated.
frame = UI_get_item_frame(each);
UI_error_message("greenCremation Frame ", frame, " found.");
if (frame in body_507_frames)
{
// This check is necessary to prevent a non-existence "found" being counted by UI_get_array_size below.
if (bodies == 0)
bodies = each;
else
bodies = (bodies & each);
UI_error_message("greenCremation SHAPE_BODY_SKELETON (507), frame ", frame, " added to bodies array.");
}
else
UI_error_message("greenCremation SHAPE_BODY_SKELETON (507), frame ", frame, " was NOT added to bodies array.");
}
valid_bodies = UI_get_array_size(bodies);
UI_error_message("greenCremation The burnable humanoid body count is now ", valid_bodies, ".");
}
else
UI_error_message("greenCremation SHAPE_BODY_SKELETON (507) was not found in the Party.");
UI_error_message("");
// Body 762
body_count = (UI_count_objects(PARTY, SHAPE_BODY_762, QUALITY_ANY, FRAME_ANY));
if (body_count >= 1)
{
UI_error_message("greenCremation The Party has ", body_count, " of SHAPE_BODY_762.");
body_762_shape = getPartyItems(SHAPE_BODY_762, QUALITY_ANY, FRAME_ANY);
for (each in body_762_shape with index to max)
{
// Check for the relevant frames, even if rotated.
frame = UI_get_item_frame(each);
UI_error_message("greenCremation Frame ", frame, " found.");
if (frame in body_762_frames)
{
// This check is necessary to prevent a non-existence "found" being counted by UI_get_array_size below.
if (bodies == 0)
bodies = each;
else
bodies = (bodies & each);
UI_error_message("greenCremation SHAPE_BODY_762, frame ", frame, " added to bodies array.");
}
else
UI_error_message("greenCremation SHAPE_BODY_762, frame ", frame, " was NOT added to bodies array.");
}
valid_bodies = UI_get_array_size(bodies);
UI_error_message("greenCremation The burnable humanoid body count is now ", valid_bodies, ".");
}
else
UI_error_message("greenCremation SHAPE_BODY_762 was not found in the Party.");
UI_error_message("");
// Body 892
body_count = (UI_count_objects(PARTY, SHAPE_BODY_SMALL, QUALITY_ANY, FRAME_ANY));
if (body_count >= 1)
{
UI_error_message("greenCremation The Party has ", body_count, " of SHAPE_BODY_SMALL (892).");
body_892_shape = getPartyItems(SHAPE_BODY_SMALL, QUALITY_ANY, FRAME_ANY);
for (each in body_892_shape with index to max)
{
// Check for the relevant frames, even if rotated.
frame = UI_get_item_frame(each);
UI_error_message("greenCremation Frame ", frame, " found.");
if (frame in body_892_frames)
{
// This check is necessary to prevent a non-existence "found" being counted by UI_get_array_size below.
if (bodies == 0)
bodies = each;
else
bodies = (bodies & each);
UI_error_message("greenCremation SHAPE_BODY_SMALL (892), frame ", frame, " added to bodies array.");
}
else
UI_error_message("greenCremation SHAPE_BODY_SMALL (892), frame ", frame, " was NOT added to bodies array.");
}
valid_bodies = UI_get_array_size(bodies);
UI_error_message("greenCremation The burnable humanoid body count is now ", valid_bodies, ".");
}
else
UI_error_message("greenCremation SHAPE_BODY_SMALL (892) was not found in the Party.");
UI_error_message("");
say("@A total of ", total_count, " bodies were found in your party.@");
say("@Of these bodies, ", valid_bodies, " can be cremated.@");
}
/*
bodies = UI_count_objects(PARTY, SHAPE_BODY1, QUALITY_ANY, FRAME_ANY);
UI_get_array_size
// First, check the party for bodies
bodies = UI_count_objects(PARTY, SHAPE_BODY1, QUALITY_ANY, FRAME_ANY);
UI_error_message("Glen has found ", bodies, ", in the party of Shape_Body1.");
bodies = (bodies && UI_count_objects(PARTY, SHAPE_BODY1, QUALITY_ANY, FRAME_ANY));
UI_error_message("Glen has found ", bodies, ", in the party of Shape_Body1 and Shape_Body2.");
bodies = (bodies && UI_count_objects(PARTY, SHAPE_BODY3, QUALITY_ANY, FRAME_ANY));
UI_error_message("Glen has found ", bodies, ", in the party of Shape_Body1 , Shape_Body2 and Shape_Body2.");
bodies = (bodies && UI_count_objects(PARTY, SHAPE_BODY4, QUALITY_ANY, body_frames4)); //*should* select only from body frames listed above?
UI_error_message("Glen has found ", bodies, ", in the party of Shape_Body1 , Shape_Body2 and Shape_Body2.");
bodies = (bodies && UI_count_objects(PARTY, SHAPE_BODY5, QUALITY_ANY, FRAME_ANY));
UI_error_message("Glen has found ", bodies, ", in the party of Shape_Body1 , Shape_Body2, Shape_Body3.");
if (bodies > 0)
{
item.say("His eyes gleam fiendishly when he notices the body you're carrying.*");
item.say("@Ah, you've brought me a client. Tell the truth, doesn't your friend look more peaceful this way?@*");
item.say("@For such a heroic client, I have something special to offer. It's a new process I've invented called 'cremation.'@*");
item.say("@For a mere fifteen gold, the remains of the dearly departed are purified with flame. Would you like me to do this for you?@*");
if (askYesNo())
{
if (hasGold(15))
{
chargeGold(15);
if (UI_find_object(PARTY, SHAPE_BODY1, QUALITY_ANY, FRAME_ANY) > 0) { body = UI_find_object(PARTY, SHAPE_BODY1, QUALITY_ANY, FRAME_ANY); } //find body to cremate
if (UI_find_object(PARTY, SHAPE_BODY2, QUALITY_ANY, FRAME_ANY) > 0) { body = UI_find_object(PARTY, SHAPE_BODY2, QUALITY_ANY, FRAME_ANY); } //find body to cremate
if (UI_find_object(PARTY, SHAPE_BODY3, QUALITY_ANY, FRAME_ANY) > 0) { body = UI_find_object(PARTY, SHAPE_BODY3, QUALITY_ANY, FRAME_ANY); } //find body to cremate
if (UI_find_object(PARTY, SHAPE_BODY4, QUALITY_ANY, body_frames4) > 0) { body = UI_find_object(PARTY, SHAPE_BODY4, QUALITY_ANY, body_frames4); } //find body to cremate
if (UI_find_object(PARTY, SHAPE_BODY5, QUALITY_ANY, FRAME_ANY) > 0) { body = UI_find_object(PARTY, SHAPE_BODY5, QUALITY_ANY, FRAME_ANY); } //find body to cremate
//body = UI_find_object(PARTY, SHAPE_BODY2, QUALITY_ANY, FRAME_ANY); //find body to cremate, was supposd to pull from list
//cremate_body = (cremate_body + body);
//call crematorioum event
moveToLocation(body, body_pos); //for testing purposes, remove when finished!
}
else item.say("@You're a bit short on gold.@ he says, dissapointedly."); return;
}
else item.say("@Too bad.@"); return;
}
else
enum dead_body_shapes
{
SHAPE_BODY1 = 400, // 30 frames
BODY_PRIESTESS = 3, // Kylista's body
BODY_UGLY_OLD_WOMAN = 4, // Mosh's body
BODY_FEMALE_PIKEMAN = 5, // Shazzana's body
BODY_FIGHTER_GREEN_HELM = 6, // Brendann's body
BODY_GWENNO = 8, // Gwenno's body
BODY_NOBLEMAN = 13, // Marsten, Ardiniss
BODY_MALE_RANGER_400 = 18, // Used for post-Banes body outside of Frigidazzi's manor
BODY_FEMALE_RANGER = 19, // Julia's body
QUALITY_ARDINISS_BODY = 124, // Same as the brown scroll on his body
SHAPE_BODY_402 = 402, // 31 frames with SS
BODY_FIGHTER_DARK_SKIN = 4,
BODY_PIKEMAN = 11,
BODY_MALE_RANGER = 12, // Rangers that die in combat
SHAPE_BODY_414 = 414, // Dead 3 companions
BODY_MALE_GOBLIN = 4,
BODY_BATLIN = 16,
BODY_FAWN_GUARD = 17,
BODY_IOLO = 18,
BODY_SHAMINO = 19,
BODY_DUPRE = 20,
BODY_GIRL_KNIGHT = 21, // Cantra, matching below
// SHAPE_BODIES_2 = 414, // From original si_shapes.uc
SHAPE_BODY_SKELETON = 507, // Includes Gwani bodies
BODY_GWANI_FULL_FUR = 14,
BODY_GWANI_SOME_FUR = 15,
BODY_GWANI_NO_FUR = 16,
SHAPE_BODY_762 = 762, // Mostly animals and monsters
SHAPE_BODY_LARGE = 778, // Larger monsters, dragons
SHAPE_BODY_SMALL = 892, // With glowing cat
BODY_WOLF = 7
};
*/

View File

@@ -0,0 +1,444 @@
void SendCodexToVoid object# (3059) ()
{
var Codex = UI_find_object(FIND_ON_SCREEN, SHAPE_CODEX, QUALITY_ANY, FRAME_ANY);
enum codex_levels
{
MOVE_PARTY = 1,
VORTEX = 2,
REMOVE_CODEX = 3,
RED_GATE1 = 4,
LB_ARRIVES = 5,
NYSTUL_ARRIVES = 7,
AVATAR_GIVE_LENS = 8,
MOONGATE2 = 9,
DRAX_ARRIVES = 10,
DRAX_SPEAKS = 11,
AVATAR_GIVE_LENS2 = 12,
OPEN_CODEX = 13,
CLOSE_CODEX = 14,
WRAP_UP = 15,
RESTART = 16
};
if (event == VORTEX)
{
UI_error_message("Event VORTEX called");
var npc;
var REPS = 30;
var party = UI_get_party_list();
var altar = UI_find_object(FIND_ON_SCREEN, 898, QUALITY_ANY, FRAME_ANY);
UI_obj_sprite_effect(item, 8, 0, 0, 0, 0, 0, REPS); //26
UI_play_sound_effect(26);
UI_play_sound_effect(26);
for (npc in party)
UI_set_item_frame(npc, 0); // make everyone face forward
//SendCodexToVoid(item);
script AVATAR after 30 ticks {
call SendCodexToVoid, REMOVE_CODEX;
}
}
if (event == MOVE_PARTY)
{
UI_error_message("Event MoveParty called");
//move Draxinusom to position, make him invis and wait, move him to position
UI_set_item_frame(DRAXINUSOM, 16);
UI_set_item_flag(DRAXINUSOM, DONT_RENDER);
UI_move_object(DRAXINUSOM, [2814, 2587, 1, 0]);
UI_set_schedule_type(DRAXINUSOM, WAIT);
//Move party to codex and call VORTEX event
UI_path_run_usecode([2807, 2596, 1], SendCodexToVoid, Codex, VORTEX);
}
if (event == REMOVE_CODEX)
{
UI_error_message("Event REMOVE_CODEX called");
var altar = UI_find_object(FIND_ON_SCREEN, 898, QUALITY_ANY, FRAME_ANY);
UI_remove_item(Codex);
UI_obj_sprite_effect(altar, 7, 10, 1, 0, 0, 0, -1); //26
UI_play_sound_effect(11);
script altar after 30 ticks
{
call SendCodexToVoid, RED_GATE1;
}
}
if (event == RED_GATE1)
{
UI_error_message("Event RED_GATE1 called");
UI_play_music(23);
var moongate = UI_create_new_object2(SHAPE_RED_MOONGATE, [2801, 2585, 2]);
script moongate after 3 ticks
{
frame 1;
frame 2;
frame 3;
frame 4;
sfx 11;
wait 3;
call SendCodexToVoid, LB_ARRIVES;
repeat 40
{
frame 4;
repeat 7 next frame;;
frame 4;
repeat 7 next frame;;
frame 4;
repeat 7 next frame;;
};
}
}
if (event == LB_ARRIVES)
{
UI_error_message("Event LB_ARRIVES called");
// UI_set_item_frame(LORD_BRITISH, 16);
UI_move_object(LORD_BRITISH, [2800, 2587, 1]);
UI_set_schedule_type(LORD_BRITISH, WAIT);
UI_set_schedule_type(NYSTUL, WAIT);
script LORD_BRITISH after 3 ticks
{
face south;
step south;
wait 1;
step east;
call SendCodexToVoid, NYSTUL_ARRIVES;
}
}
if (event == NYSTUL_ARRIVES)
{
UI_error_message("Event NYSTUL called");
var moongate = UI_find_object(FIND_ON_SCREEN, SHAPE_RED_MOONGATE, QUALITY_ANY, FRAME_ANY);
UI_set_item_frame(NYSTUL, 16);
UI_move_object(NYSTUL, [2798, 2586, 1]);
script NYSTUL after 4 ticks
{
step south;
wait 1;
face east;
wait 1;
}
UI_move_object(moongate, [2801, 2585, 2]);
AVATAR.say("A glowing portal springs from the floor!");
AVATAR.say("From it's crimson depths Lord British emerges, trialed by the mage Nystul.");
AVATAR.say("Anguish and disbelief prevail on the royal seer's face, but Lord British directs his stony gaze at you and speaks as if to a wayward child.");
AVATAR.hide();
LORD_BRITISH.say("@Thou didst have just cause to burgle our Codex, I trust,@ His Majesty says. @But for Virtue's sake...@");
LORD_BRITISH.say("@WHAT HAST THOU DONE WITH IT?@");
LORD_BRITISH.hide();
script LORD_BRITISH after 3 ticks
{
call SendCodexToVoid, AVATAR_GIVE_LENS;
}
//delete the beams of light
var blueLightBeam = UI_find_object(FIND_ON_SCREEN, 168, QUALITY_ANY, 22);
UI_remove_item(blueLightBeam);
var blueLightBeam2 = UI_find_object(FIND_ON_SCREEN, 168, QUALITY_ANY, 24);
UI_remove_item(blueLightBeam2);
var pinkLightBeam = UI_find_object(FIND_ON_SCREEN, 168, QUALITY_ANY, 20);
UI_remove_item(pinkLightBeam);
var pinkLightBeam2 = UI_find_object(FIND_ON_SCREEN, 168, QUALITY_ANY, 21);
UI_remove_item(pinkLightBeam2);
gflags[GARG_LENS_PLACED] = false;
}
if (event == AVATAR_GIVE_LENS)
{
UI_error_message("Event AVATAR_GIVE_LENS called");
var lens = UI_find_nearby(LORD_BRITISH, SHAPE_LENS, 5, MASK_NONE);
var moongate = UI_find_object(FIND_ON_SCREEN, SHAPE_RED_MOONGATE, QUALITY_ANY, FRAME_ANY);
gotoAndGet(lens);
script NYSTUL after 15 ticks
{
call SendCodexToVoid, MOONGATE2;
}
//remove moongate
script moongate after 5 ticks
{
frame 4;
frame 3;
frame 2;
frame 1;
remove;
}
}
if (event == MOONGATE2)
{
UI_error_message("Event MOONGATE2 called");
var lens = UI_find_object(AVATAR, SHAPE_LENS, QUALITY_ANY, FRAME_ANY);
var CODEX_WALL = UI_find_object(FIND_ON_SCREEN, 1246, QUALITY_ANY, FRAME_ANY);
//find urn - will be used to call the next event
var urn = UI_find_object(FIND_ON_SCREEN, 1116, QUALITY_ANY, FRAME_ANY);
//var urn = UI_find_nearby(LORD_BRITISH, 1116, 5, MASK_NONE);
AVATAR.say("You pick up the concave lens and pass it to the King.");
AVATAR.say("@Was the book ever truly ours, Your Majesty? Was it written for Britannia alone?@");
AVATAR.say("@Thou dost no longer hold the Codex, but is its wisdom indeed lost? Look into the Vortex, and let the Codex answer for itself!@");
AVATAR.hide();
//move Avatar in place
UI_path_run_usecode([2807, 2588, 1]);
script AVATAR after 5 ticks
{
//face find_direction(CODEX_WALL);
face north;
}
//move lens into place, make it face wall
script LORD_BRITISH after 3 ticks
{
face north;
}
//turn lens north
script lens after 3 ticks
{
face north;
}
UI_move_object(lens, [2802, 2587, 1]);
codexWall();
script DRAXINUSOM after 80 ticks
{
wait 20;
call SendCodexToVoid, DRAX_ARRIVES;
}
}
if (event == DRAX_ARRIVES)
{
UI_error_message("Event DRAX_ARRIVES called");
//used to call next event
var urn2 = UI_find_object(FIND_ON_SCREEN, 1116, QUALITY_ANY, FRAME_ANY);
AVATAR.say("As Lord British holds the glass before the wall, the Codex of Ultimate Wisdom wavers against a myriad of swimming stars!*");
AVATAR.say("Yet the book remains closed.*");
AVATAR.say("And waves of heat shimmer in the air, heralding the birth of another red gate!");
//create moongate & play music
UI_play_music(103); //put garg music
var moongate = UI_create_new_object2(SHAPE_RED_MOONGATE, [2816, 2585, 1]);
//var moongate = UI_find_object(FIND_ON_SCREEN, SHAPE_RED_MOONGATE, QUALITY_ANY, FRAME_ANY);
//move moongate to make it look right
UI_move_object(moongate, [2816, 2585, 1]);
script moongate after 3 ticks
{
frame 1;
frame 2;
frame 3;
frame 4;
sfx 11;
wait 3;
repeat 40
{
repeat 7 next frame;;
frame 4;
repeat 7 next frame;;
frame 4;
repeat 7 next frame;;
};
}
script urn2 after 10 ticks
{
call SendCodexToVoid, DRAX_SPEAKS;
}
}
if (event == DRAX_SPEAKS)
{
UI_error_message("Event DRAX_SPEAKS called");
//reset moongate position to keep it from looking weird
var moongate = UI_find_object(FIND_ON_SCREEN, SHAPE_RED_MOONGATE, QUALITY_ANY, FRAME_ANY);
UI_move_object(moongate, [2816, 2585, 1]);
UI_set_schedule_type(DRAXINUSOM, WAIT);
UI_move_object(DRAXINUSOM, [2814, 2587, 1, 0]);
var garg1_pos = [2816, 2588, 01];
var garg2_pos = [2814, 2587, 01];
UI_create_new_object2(SHAPE_WINGLESS_GARGOYLE, garg1_pos);
UI_create_new_object2(SHAPE_WINGLESS_GARGOYLE, garg2_pos);
var lens = UI_find_nearby(DRAXINUSOM, SHAPE_LENS, 5, MASK_NONE);
UI_clear_item_flag(DRAXINUSOM, DONT_RENDER);
script DRAXINUSOM after 3 ticks
{
face south;
step south;
wait 1;
repeat 2
{
step west;
wait 1;
};
}
UI_play_sound_effect(11);
DRAXINUSOM.say("King Draxinusom of the Gargoyles strides forward, flanked by a small army of wingless attendants. Like Lord British, he seems to suppress his rage only htrough a heroic effort of will.*");
DRAXINUSOM.say("His scaly hand grasps your shoulder, and your Amulet of Submission grows very warm.");
DRAXINUSOM.say("@Thy time has come, Thief,@ he says.");
DRAXINUSOM.hide();
AVATAR.say("Quickly you reach down to seize the convex lens...*");
AVATAR.say("...and you press it into the hand of the towering Gargoyle king, meeting his sunken eyes.");
AVATAR.say("@Join my Lord in his search for peace, I beg thee.@");
AVATAR.hide();
//UI_path_run_usecode([2807, 2596, 1], SendCodexToVoid, lens, AVATAR_GIVE_LENS2);
script AVATAR after 10 ticks
{
face north;
call SendCodexToVoid, AVATAR_GIVE_LENS2;
}
}
if (event == AVATAR_GIVE_LENS2)
{
UI_error_message("Event AVATAR_GIVE_LENS2 called");
var moongate = UI_find_object(FIND_ON_SCREEN, SHAPE_RED_MOONGATE, QUALITY_ANY, FRAME_ANY);
//remove moongate
script moongate after 5 ticks
{
frame 4;
frame 3;
frame 2;
frame 1;
remove;
}
//find lens on Avatar then place near Drax
var lens = UI_find_nearby(DRAXINUSOM, SHAPE_LENS, 5, MASK_NONE);
UI_move_object(lens, [2811, 2587, 1]);
//move lens facing north
script lens after 3 ticks
{
face north;
}
//move Drax north
script DRAXINUSOM after 3 ticks
{
face north;
}
// gotoAndGet(lens);
script AVATAR after 30 ticks
{
call SendCodexToVoid, OPEN_CODEX;
}
}
if (event == OPEN_CODEX)
{
UI_error_message("Event OPEN_CODEX called");
openCodex();
UI_set_item_frame(NYSTUL, 48);
UI_play_music(205);
AVATAR.say("At your urging, King Draxinusom reluctantly raises his lens to catch the light. As Lord British holds up his own lens, every eye in the room, human and Gargoyle alike, fixes upon the image of the Codex which shines upon the wall.");
AVATAR.say("The ancient book opens. Both kings gaze upon its pages in spellbound silence, as the eloquence of Ultimate Wisdom is revealed in the toungues of each lord's domain. You, too, can read the answers the Codex gives...");
script AVATAR after 60 ticks
{
call SendCodexToVoid, CLOSE_CODEX;
}
}
if (event == CLOSE_CODEX)
{
AVATAR.say("...and when it's wisdom is gleaned, when Lord British and King Draxinusom turn to each other as friends, hating no longer, fearing no more, you know that your mission in Britannia has ended at last.");
UI_error_message("Event CLOSE_CODEX called");
var codex_wall = UI_find_object(FIND_ON_SCREEN, 1246, QUALITY_ANY, FRAME_ANY); //find codex wall
// UI_halt_scheduled(codex_wall);
var frame = UI_get_item_frame(1246);
script codex_wall after 10 ticks
{
frame 18; wait 2;
frame 19; wait 2;
frame 20; wait 2;
frame 5; wait 2;
frame 4; wait 2;
frame 3; wait 2;
frame 2; wait 2;
frame 1; wait 2;
frame 0; wait 2;
wait 15 minutes;
call SendCodexToVoid, WRAP_UP;
}
}
if (event == WRAP_UP)
{
AVATAR.say("@That's it, you win. Games over. Back to earth I go. Thanks for playing. See you in 200 years! Avatar, out!@");
AVATAR->GenericPaletteFade2();
script AVATAR after 30 ticks
{
call SendCodexToVoid, RESTART;
}
}
if (event == RESTART)
{
UI_restart_game();
}
}

View File

@@ -0,0 +1,150 @@
enum death_levels
{
DEATH_FADE = 1,
RESU_PARTY_1 = 2,
RESU_PARTY_2 = 3,
RESU_PARTY_3 = 4,
RESU_PARTY_4 = 5,
RESU_PARTY_5 = 6,
RESU_PARTY_6 = 7,
RESU_PARTY_7 = 8,
TELEPORT_PARTY = 9,
DEATH_UNFADE = 10
};
void deathEvents object#() () //working
{
UI_error_message("Death events called");
var party = UI_get_party_list();
var hour = UI_game_hour();
var current_minute = UI_game_minute();
var minute = (59 - current_minute);
var min_ticks = (minute * 25);
var current_hour = UI_game_hour();
var checkout = 9;
var sleephours = ((23 - current_hour) + 9);
var advance = (sleephours * 1500);
var partynum = UI_get_array_size(party);
var deadparty = UI_get_dead_party(AVATAR);
var deadnum = UI_get_array_size(deadparty);
var avatarhealth = UI_get_npc_prop(UI_get_avatar_ref(), HEALTH);
var avatarstr = UI_get_npc_prop(UI_get_avatar_ref(), STRENGTH);
var avatarfullhealth = (avatarstr - avatarhealth);
if (event == DEATH_FADE)
{
UI_error_message("Death events - DEATH_FADE called");
UI_play_music(17); //find death music
var deadparty = UI_get_dead_party(AVATAR);
// UI_advance_time(advance + min_ticks); //disabled time advance, causing issues?
// UI_game_minute(59);
if (deadnum > 0)
{
script AVATAR
{
call deathEvents, RESU_PARTY_1;
};
}
else
script AVATAR
{
call deathEvents, TELEPORT_PARTY;
};
}
if (event == RESU_PARTY_1)
{
UI_error_message("Death events - RESU_PARTY_1 called");
var deadparty = UI_get_dead_party(AVATAR);
UI_resurrect(deadparty);
if (deadnum > 0)
{
script AVATAR
{
call deathEvents, RESU_PARTY_2;
};
}
else
script AVATAR
{
call deathEvents, TELEPORT_PARTY;
};
}
if (event == RESU_PARTY_2)
{
var deadparty = UI_get_dead_party(AVATAR);
UI_resurrect(deadparty);
UI_error_message("Death events - RESU_PARTY_2 called");
if (deadnum > 0)
{
script AVATAR
{
call deathEvents, RESU_PARTY_2;
};
}
else script AVATAR { call deathEvents, TELEPORT_PARTY;
};
}
if (event == TELEPORT_PARTY)
{
UI_error_message("Death events - TELEPORT_PARTY called");
PARTY->move_object([0x3a7, 0x430, 0x0, 0]);
script AVATAR
{
call deathEvents, DEATH_UNFADE;
};
}
if (event == DEATH_UNFADE)
{
UI_error_message("Death events - DEATH_UNFADE called");
UI_fade_palette(60, 0, true); //unfadefade from black
//UI_resurrect(AVATAR);// probably needs LB dialogue to clear sleep flag
UI_clear_item_flag(AVATAR, ASLEEP);
UI_clear_item_flag(AVATAR, DEAD);
gflags[INTRO] = true; //so guards don't play trumpet
var targets = getFriendlyTargetList(item, 25); //should heal all party
for (npc in targets)
{
npc->clear_item_flag(PARALYZED);
npc->clear_item_flag(POISONED);
npc->clear_item_flag(ASLEEP);
npc->clear_item_flag(CHARMED);
npc->clear_item_flag(CURSED);
var str = npc->get_npc_prop(STRENGTH);
var hps = npc->get_npc_prop(HEALTH);
npc->set_npc_prop(HEALTH, (str - hps));
//if something weird happens and you die on the balloon:
UI_clear_item_flag(npc, DONT_RENDER);
}
//just in case you are on the balloon, go back to normal
UI_clear_item_flag(AVATAR, POLYMORPH);
}
}

View File

@@ -0,0 +1,370 @@
var populateMantras(var mantra, var flag)
{
var mantras = ["'Ahm'", "'Mu'", "'Ree'", "'Ra'", "'Arr'", "'Summ'", "'Lum'", "'Meh'", "'Mul'", "'Cah'", "'Beh'", "'Doh'", "'Err'", "'Om'", "'Uh'"];
var size = UI_get_array_size([mantras]);
// This will populate a list of mantras, but it should NOT have the Shrine's actual mantra unless
// the flag is set true (they learned the mantra). If the flag isn't true and mantra is rolled, do a re-roll.
//assign random mantras in the choice menu
var choice_one = mantras[UI_get_random(size)];
//if choice one equals the mantra, re-roll
while (choice_one == mantra)
choice_one = mantras[UI_get_random(size)];
//roll choice two. If it matches choice one OR mantra, re-roll
var choice_two = mantras[UI_get_random(size)];
while (choice_two == choice_one || choice_two == mantra)
choice_two = mantras[UI_get_random(size)];
//roll choice three. If it matches choice one, two, OR mantra, re-roll
var choice_three = mantras[UI_get_random(size)];
while (choice_three == choice_one || choice_three == choice_two || choice_three == mantra)
choice_three = mantras[UI_get_random(size)];
var mantra_choices = [choice_one, choice_two, choice_three];
//if mantra flag is set (mantra is learned), replace random choice with actual mantra:
if (flag)
{
UI_error_message("Mantra flag is true");
UI_error_message("Mantra is " + mantra);
var rand = UI_get_random(3);
if (rand == 1)
choice_one = mantra;
else if (rand == 2)
choice_two = mantra;
else
choice_three = mantra;
//reassign mantras
mantra_choices = [choice_one, choice_two, choice_three];
UI_error_message("Choices are : " + choice_one + "," + choice_two + ", " + choice_three);
}
else
UI_error_message("Flag isn't set?");
return mantra_choices;
}
void breakForceField(var rune, var virtue_name)
{
var shrine = UI_find_object(FIND_ON_SCREEN, SHAPE_FORCEFIELD, QUALITY_ANY, FRAME_ANY);
var moonstone = UI_find_nearest(shrine, SHAPE_MOONSTONE, 3);
var forcefield = UI_find_nearest(shrine, SHAPE_FORCEFIELD, 3);
//If forcefield not found, abort
if (!forcefield)
{
randomPartyBark("We are not close enough.@");
abort;
}
else
{
UI_obj_sprite_effect(moonstone, 21, 0, 0, 0, 0, 0, -1);
UI_play_sound_effect(37);
UI_obj_sprite_effect(moonstone, 9, 0, 0, 0, 0, 0, -1);
UI_play_music(9);
UI_remove_item(forcefield); //deletes force field
UI_remove_item(rune); //deletes rune
deleteEggs();
randomPartyBark("@The Shrine of " + virtue_name + " is free!@");
giveExperience(100);
UI_play_music(9);
}
}
void breakForceFieldFailed()
{
var moonstone = find_nearest(SHAPE_MOONSTONE, 10);
UI_obj_sprite_effect(moonstone, 9, 0, 0, 0, 0, 0, -1);
UI_play_sound_effect(69);
randomPartyBark("@I don't think that was the correct mantra...@");
}
void freeShrines (var shrine, var rune)
{
var virtue_name = shrine;
var choice_one;
var choice_two;
var choice_three;
/* for reference:
const int QUALITY_SACRIFICE = 0;
const int QUALITY_JUSTICE = 1;
const int QUALITY_HUMILITY = 2;
const int QUALITY_SPIRITUALITY = 3;
const int QUALITY_VALOR = 4;
const int QUALITY_COMPASSION = 5;
const int QUALITY_HONOR = 6;
const int QUALITY_HONESTY = 7;
The mantra of Honesty: Ahm
The mantra of Compassion: Mu
The mantra of Valor: Ra
The mantra of Justice: Beh
The mantra of Sacrifice: Cah
The mantra of Honor: Summ
The mantra of Humility: Lum
The mantra of Spirituality: Om
*/
var MANTRA_SACRIFICE = "'Cah'";
var MANTRA_JUSTICE = "'Beh'";
var MANTRA_HUMILITY = "'Lum'";
var MANTRA_SPIRITUALITY = "'Om'";
var MANTRA_VALOR = "'Ra'";
var MANTRA_HONESTY = "'Ahm'";
var MANTRA_COMPASSION = "'Mu'";
var MANTRA_HONOR = "'Summ'";
var face;
if (shrine == "Sacrifice")
face = 250;
else if (shrine == "Justice")
face = 251;
else if (shrine == "Humility")
face = 252;
else if (shrine == "Spirituality")
face = 249;
else if (shrine == "Valor")
face = 248;
else if (shrine == "Honesty")
face = 254;
else if (shrine == "Compassion")
face = 255;
else if (shrine == "Honor")
face = 253;
else
face = 256;
var npc;
if (shrine == "Sacrifice")
npc = NPC_SACRIFICE;
else if (shrine == "Justice")
npc = NPC_JUSTICE;
else if (shrine == "Humility")
npc = NPC_HUMILITY;
else if (shrine == "Spirituality")
npc = NPC_SPIRITUALITY;
else if (shrine == "Valor")
npc = NPC_VALOR;
else if (shrine == "Honesty")
npc = NPC_HONESTY;
else if (shrine == "Compassion")
npc = NPC_COMPASSION;
else if (shrine == "Honor")
npc = NPC_HONOR;
else
npc = AVATAR;
UI_error_message("NPC is : " + npc);
var npc_face = UI_get_npc_object(npc);
UI_error_message("Face is : " + npc_face);
//show correct shrine face
UI_show_npc_face(face, 0);
//stop any music from playing. TODO: Add shrine music?
UI_play_music(255);
face.say("You hear a voice ringing inside your head.");
face.say("@Speak the mantra of " + virtue_name + ".@");
//Shrine of Sacrifice
if (shrine == "Sacrifice")
{
var mantra_choices = populateMantras(MANTRA_SACRIFICE, LEARNED_MANTRA_SACRIFICE);
var mantra_choice = chooseFromMenu(mantra_choices);
if (mantra_choice == MANTRA_SACRIFICE)
{
UI_close_gumps();
breakForceField(rune, virtue_name);
gflags[SACRIFICE_FREED] = true;
}
else
{
breakForceFieldFailed();
}
}
//Shrine of Justice
else if (shrine == "Justice")
{
var mantra_choices = populateMantras(MANTRA_JUSTICE, LEARNED_MANTRA_JUSTICE);
var mantra_choice = chooseFromMenu(mantra_choices);
if (mantra_choice == MANTRA_JUSTICE)
{
UI_close_gumps();
breakForceField(rune, virtue_name);
gflags[JUSTICE_FREED] = true;
}
else
{
breakForceFieldFailed();
}
}
//Shrine of Humility
else if (shrine == "Humility")
{
var mantra_choices = populateMantras(MANTRA_HUMILITY, LEARNED_MANTRA_HUMILITY);
var mantra_choice = chooseFromMenu(mantra_choices);
if (mantra_choice == MANTRA_HUMILITY)
{
UI_close_gumps();
breakForceField(rune, virtue_name);
gflags[HUMILITY_FREED] = true;
}
else
{
breakForceFieldFailed();
}
}
//Shrine of Spirituality
else if (shrine == "Spirituality")
{
var mantra_choices = populateMantras(MANTRA_SPIRITUALITY, LEARNED_MANTRA_SPIRITUALITY);
var mantra_choice = chooseFromMenu(mantra_choices);
if (mantra_choice == MANTRA_SPIRITUALITY)
{
UI_close_gumps();
breakForceField(rune, virtue_name);
gflags[SPIRITUALITY_FREED] = true;
}
else
{
breakForceFieldFailed();
}
}
//Shrine of Valor
else if (shrine == "Valor")
{
var mantra_choices = populateMantras(MANTRA_VALOR, LEARNED_MANTRA_VALOR);
var mantra_choice = chooseFromMenu(mantra_choices);
if (mantra_choice == MANTRA_VALOR)
{
UI_close_gumps();
breakForceField(rune, virtue_name);
gflags[VALOR_FREED] = true;
}
else
{
breakForceFieldFailed();
}
}
//Shrine of Compassion
else if (shrine == "Compassion")
{
var mantra_choices = populateMantras(MANTRA_COMPASSION, LEARNED_MANTRA_COMPASSION);
var mantra_choice = chooseFromMenu(mantra_choices);
if (mantra_choice == MANTRA_COMPASSION)
{
UI_close_gumps();
breakForceField(rune, virtue_name);
gflags[COMPASSION_FREED] = true;
}
else
{
breakForceFieldFailed();
}
}
//Shrine of Honor
else if (shrine == "Honor")
{
var mantra_choices = populateMantras(MANTRA_HONOR, LEARNED_MANTRA_HONOR);
var mantra_choice = chooseFromMenu(mantra_choices);
if (mantra_choice == MANTRA_HONOR)
{
UI_close_gumps();
breakForceField(rune, virtue_name);
gflags[HONOR_FREED] = true;
}
else
{
breakForceFieldFailed();
}
}
//Shrine of Honesty
else if (shrine == "Honesty")
{
var mantra_choices = populateMantras(MANTRA_HONESTY, LEARNED_MANTRA_HONESTY);
var mantra_choice = chooseFromMenu(mantra_choices);
if (mantra_choice == MANTRA_HONESTY)
{
UI_close_gumps();
breakForceField(rune, virtue_name);
gflags[HONESTY_FREED] = true;
}
else
{
breakForceFieldFailed();
}
}
}

View File

@@ -0,0 +1,457 @@
//30 ticks per minute
enum gypsy_cutscene_levels
{
BEGIN_WANDA_CUTSCENE = 1,
WANDA_WAITS = 2,
BEGIN_ANDREAS_CUTSCENE = 3,
ANDREAS_WAITS = 4,
WANDA_UNDRESSES = 5,
ANDREAS_UNDRESSES = 6,
AVATAR_CHIDED = 7,
AVATAR_STD =8
};
void GenericPaletteUnfade2 object#() ()
{
// Do stuff
// Unfade the palette
UI_fade_palette(12, 1, 1);
//call new event
// Do more stuff
}
void GenericPaletteFade2 object#() ()
{
// Fade to black:
UI_fade_palette(12, 1, 0);
script AVATAR after 60 ticks {nohalt; call GenericPaletteUnfade;};
}
void AvatarUndress object#() ()
{
var AVATARCLOTHESPOS = [1201, 2123, 03];
const int SHAPE_AVATAR_COSTUME = 838;
UI_set_item_flag(AVATAR, NAKED);
var AvatarClothes = find_nearest(SHAPE_AVATAR_COSTUME, QUALITY_ANY, FRAME_ANY, 10);
AvatarClothes->move_object(AVATARCLOTHESPOS);
}
void AvatarDress object#() ()
{
const int SHAPE_AVATAR_COSTUME = 838;
var UPPER_LEFT = [1189, 2117];
var LOWER_RIGHT = [1209, 2132];
var AvatarClothes = find_nearest(SHAPE_AVATAR_COSTUME, QUALITY_ANY, FRAME_ANY, 10);
var AvatarClothesPosition = [1199, 2121, 00];
AvatarClothes->move_object(AvatarClothesPosition);
UI_clear_item_flag(AVATAR, NAKED);
}
void gypsyUndress object#()()
{
var gypsy;
var gypsy_name;
AVATAR->set_item_flag(BG_DONT_MOVE);
if (gflags[DURING_WANDA_CUTSCENE])
{
gypsy = WANDA;
gypsy_name = UI_get_npc_name(gypsy);
UI_error_message("Gypsy is " + gypsy_name);
//gypsy->set_polymorph(1043);
UI_set_polymorph(WANDA, 1043);
var dress = find_nearest(SHAPE_TOP, QUALITY_ANY, FRAME_BROWN_DRESS, 10);
var gypsypos2 = [1203, 2124, 03];
dress->move_object(gypsypos2);
}
else
{
gypsy = ANDREAS;
UI_set_polymorph(ANDREAS, 1042);
}
}
void gypsyDressed object#()()
{
var gypsy;
if (gflags[DURING_WANDA_CUTSCENE])
{
gypsy = WANDA;
gypsy->clear_item_flag(POLYMORPH);
gypsy->set_polymorph(459);
var dressposition2 = [1198, 2121, 00]; //moves dress behind wagon
var dress = find_nearest(SHAPE_TOP, QUALITY_ANY, FRAME_BROWN_DRESS, 10);
dress->move_object(dressposition2);
}
else
{
gypsy = ANDREAS;
gypsy->clear_item_flag(POLYMORPH);
gypsy->set_polymorph(457);
}
gypsy->clear_item_flag(BG_DONT_MOVE);
}
void gypsyWalksAway object#()()
{
var gypsypos1 = [1212, 2126, 0];
var gypsypos2 = [1199, 2139, 0];
var gypsy;
if (gflags[DURING_WANDA_CUTSCENE])
{
gypsy = WANDA;
}
else
gypsy = ANDREAS;
gypsy->si_path_run_usecode([gypsypos1]);
}
void AvatarWalksAway object#() ()
{
var avatarpos = [1215, 2125, 0];
AVATAR->si_path_run_usecode([avatarpos]);
UI_play_music(31, AVATAR);
}
void AvatarChided object#() ()
{
var party = UI_get_party_list();
var partynum = UI_get_array_size(party);
AVATAR->clear_item_flag(BG_DONT_MOVE);
if (gflags[DURING_WANDA_CUTSCENE])
{
if (partynum > 1)
{
AVATAR.say("After a time, you return to your comrades.");
AVATAR.hide();
if (isNearby(DUPRE))
{
DUPRE.say("@That's a fine way to be carrying on when all of Britannia is in danger!@*");
DUPRE.say("@When our quest is complete, then there will be time enough for wenching!@");
DUPRE.hide();
if (isNearby(WANDA))
{
WANDA.say("@Nothing's wrong with a little fun. There's plenty of time... as long as there's plenty of gold!@");
WANDA.hide();
}
}
}
else
{
AVATAR.say("You try to ignore the nagging voice in the back of your mind that keeps saying, @You shouldn't have wasted time like that.@");
AVATAR.hide();
}
}
else
{
AVATAR.say("After a while, you and he wander back to the rest of the caravan, weary but satisfied.");
if (partynum > 1)
{
if (isNearby(DUPRE))
{
DUPRE.say("@Dupre scowls. @Well, you've certainly picked a fine one to be carrying on with.@");
DUPRE.say("@I would remind you that Britannia is under invasion by hordes of gargoyles, but I'd hate to spoil your fun...@");
DUPRE.hide();
if (isNearby(ANDREAS))
{
ANDREAS.say("Andreas laughs. @'Tis not a crime to give yourself over to pleasure...@");
ANDREAS.hide();
}
}
else
{
randomPartySay("@Well, you've certainly picked a fine one to be carrying on with.@");
randomPartySay("@I would remind you that Britannia is under invasion by hordes of gargoyles, but I'd hate to spoil your fun...@");
randomPartySay.hide();
if (isNearby(ANDREAS))
{
ANDREAS.say("Andreas laughs. @'Tis not a crime to give yourself over to pleasure...@");
ANDREAS.hide();
}
}
}
else
AVATAR.say("You try to ignore the nagging voice in the back of your head that says you shouldn't have wasted time like that.");
}
}
void AvatarSTD object# () ()
{
var rand = UI_die_roll(0, 5);
var player_name = getAvatarName();
UI_error_message("Avatar rolls a " + rand);
if (rand == 3)
{
UI_error_message("Avatar caught the herpy herps!");
AVATAR->set_item_flag(POISONED);
if (isNearby(IOLO))
{
IOLO.say("@Perhaps thou shouldst see a healer for thine 'affliction', " + player_name + "...@");
IOLO.hide();
}
if (isNearby(DUPRE))
{
DUPRE.say("@I told thee delaying our quest for wenching was a bad idea, " + player_name + ".@");
DUPRE.hide();
if (isNearby(SHAMINO))
{
DUPRE.say("@A cure potion cures all maladies caught from wenches, right Shamino?@");
DUPRE.hide();
SHAMINO.say("@Thou art scum, Dupre!@ Shamino says after laughing nervously.@");
SHAMINO.hide();
}
}
}
else
return;
}
//MAIN CUTSCENE//
void GypsyCutscene object#() ()
{
var player_name = getAvatarName();
if (event == BEGIN_WANDA_CUTSCENE)
{
UI_error_message("BEGIN_WANDA_CUTSCENE starting");
gflags[DURING_WANDA_CUTSCENE] = true;
var wandapos1 = [1210, 2124];
var wandapos2 = [1201, 2124, 03];
AVATAR->set_item_flag(BG_DONT_MOVE);
WANDA->set_item_flag(BG_DONT_MOVE);
UI_play_music(38);
UI_si_path_run_usecode(WANDA, [wandapos1]);
// WANDA->si_path_run_usecode([wandapos1]);
var wagondoor = find_nearest(975, 100);
script wagondoor after 30 ticks
{
call GypsyCutscene, WANDA_WAITS;
};
//UI_si_path_run_usecode(WANDA, [wandapos2], WANDA_WAITS, WANDA, GypsyCutscene, false); //doesn't work?
}
if (event == BEGIN_ANDREAS_CUTSCENE)
{
UI_error_message("BEGIN_ANDREAS_CUTSCENE starting");
var gypsypos1 = [1210, 2124];
var gypsypos2 = [1201, 2124, 03];
AVATAR->set_item_flag(BG_DONT_MOVE);
ANDREAS->set_item_flag(BG_DONT_MOVE);
UI_play_music(38);
UI_si_path_run_usecode(ANDREAS, [gypsypos1]);
var wagondoor = find_nearest(975, 100);
script wagondoor after 30 ticks
{
call GypsyCutscene, ANDREAS_WAITS;
};
}
if (event == WANDA_WAITS)
{
UI_error_message("WANDA_WAITS starting");
var wandapos1 = [1210, 2124]; //path 0
//var wandapos2 = [1201, 2124, 03]; //path 1
var wandapos2 = [1200, 2126, 03]; //path 1
var avatarpos2 = [1204, 2125, 03];
UI_si_path_run_usecode(AVATAR, [avatarpos2]);
//UI_si_path_run_usecode(WANDA, [wandapos2]);
UI_si_path_run_usecode(WANDA, [wandapos2], WANDA_UNDRESSES, WANDA, GypsyCutscene, false);
//AVATAR->clear_item_flag(BG_DONT_MOVE);
}
if (event == ANDREAS_WAITS)
{
UI_error_message("ANDREAS_WAITS starting");
var gypsypos1 = [1210, 2124]; //path 0
var gypsypos2 = [1201, 2124, 03]; //path 1
var avatarpos2 = [1204, 2125, 03];
UI_si_path_run_usecode(AVATAR, [avatarpos2]);
UI_si_path_run_usecode(ANDREAS, [gypsypos2], ANDREAS_UNDRESSES, ANDREAS, GypsyCutscene, false);
//AVATAR->clear_item_flag(BG_DONT_MOVE);
}
if (event == WANDA_UNDRESSES)
{
UI_error_message("WANDA_UNDRESSES starting");
script WANDA //after 5 ticks
{
nohalt;
actor frame standing; wait 5; face west;
actor frame bowing; wait 2;
call gypsyUndress;
step west; wait 2;
actor frame sleeping; wait 2; face west;
wait 2;
say "@Come and get me..@"; wait 2;
wait 140; //from 160
actor frame standing; wait 1; face east;
actor frame bowing; wait 1;
call gypsyDressed;
wait 1;
actor frame standing; wait 1; face east;
wait 2;
say "@Come again, handsome...@";
call gypsyWalksAway;
};
script AVATAR after 28 ticks
{
nohalt;
actor frame standing; wait 1; face west;
actor frame bowing; wait 1;
call AvatarUndress; wait 3;
repeat 3 {step west; wait 1;}; //changed from 2 steps
repeat 2 {actor frame sleeping; wait 1; face west;}; //from repeat 3
call GenericPaletteFade; wait 90; //from 160
call GenericPaletteUnfade; wait 5; //from 2
actor frame standing; wait 1; face east;
actor frame bowing; wait 1;
call AvatarDress; wait 60;
call AvatarWalksAway; wait 3;
say "@Whew!@"; wait 55;
call AvatarChided; wait 375; //from 400
call AvatarSTD;
};
}
if (event == ANDREAS_UNDRESSES)
{
UI_error_message("ANDREAS_UNDRESSES starting");
var player_is_female = UI_is_pc_female();
var bark1;
var bark2;
if (player_is_female)
{
bark1 = "Let's go..";
bark2 = "Come again, foxy!";
}
else
{
bark1 = "Money is money..";
bark2 = "Gotta earn a living somehow!";
}
script ANDREAS //after 5 ticks
{
nohalt;
actor frame standing; wait 5; face west;
actor frame bowing; wait 2;
call gypsyUndress;
step west; wait 2;
actor frame sleeping; wait 2; face west;
wait 2;
say bark1; wait 2;
wait 160; //from 180
actor frame standing; wait 1; face east;
actor frame bowing; wait 1;
call gypsyDressed;
wait 1;
actor frame standing; wait 1; face east;
wait 2;
say bark2;
call gypsyWalksAway;
};
script AVATAR after 28 ticks
{
nohalt;
actor frame standing; wait 1; face west;
actor frame bowing; wait 1;
call AvatarUndress; wait 3;
repeat 2 {step west; wait 1;};
repeat 2 {actor frame sleeping; wait 1; face west;}; //from repeat 3
call GenericPaletteFade; wait 90; //from 160
call GenericPaletteUnfade; wait 5; //from 2
actor frame standing; wait 1; face east;
actor frame bowing; wait 1;
call AvatarDress; wait 60;
call AvatarWalksAway; wait 3;
say "@Whew!@"; wait 55;
call AvatarChided; wait 350; //from 400
call AvatarSTD;
};
}
}

View File

@@ -0,0 +1,284 @@
//30 ticks per minute
enum innkeeper_Doris_levels
{
DORIS_FADE_SCREEN = 1,
DORIS_UNFADE_SCREEN = 2,
CHECKOUT = 3,
LATE = 4
};
enum innkeeper_Timothy_levels
{
TIMOTHY_FADE_SCREEN = 1,
TIMOTHY_UNFADE_SCREEN = 2,
TIMOTHY_CHECKOUT = 3,
TIMOTHY_LATE = 4
};
void innkeeper_Doris object#() () //this totally works!
{
var party = UI_get_party_list();
//var hour = UI_game_hour();
var minute = UI_game_minute();
var current_hour = UI_game_hour();
var checkout = 9;
var sleephours = ((24 - current_hour) + 8);
var hour_ticks = (sleephours * 1500);
var partynum = UI_get_array_size(party);
if (event == DORIS_FADE_SCREEN)
{
var current_hour = UI_game_hour();
var current_minute = UI_game_minute();
var checkout = 9;
var sleephours = ((24 - current_hour) + 8);
var minutes_needed = (59 - current_minute);
var minute_ticks = (minutes_needed * 25);
var advance = (hour_ticks + minute_ticks);
UI_fade_palette(3, 0, false); //fade to black
UI_advance_time(advance); //hours to advance time to 9am checkout time (actually 8:59)
script AVATAR after 30 ticks
{
call innkeeper_Doris, DORIS_UNFADE_SCREEN;};
}
if (event == DORIS_UNFADE_SCREEN)
{
UI_fade_palette(0, 0, true); //unfadefade from black
DORIS.say("The next morning, Doris sullenly serves you breakfast and then returns to her studies."); // Narrator says this. Party Sleeps and eats.
var targets = getFriendlyTargetList(item, 25);
for (npc in targets)
{
npc->clear_item_flag(PARALYZED);
npc->clear_item_flag(POISONED);
var str = npc->get_npc_prop(STRENGTH);
var hps = npc->get_npc_prop(HEALTH);
var food = npc->get_npc_prop(FOODLEVEL);
npc->set_npc_prop(HEALTH, (str - hps));
npc->set_npc_prop(FOODLEVEL, (31 - food));
}
//UI_add_party_items(partynum, SHAPE_FOOD, QUALITY_ANY, FRAME_EGG); //move to return later
return;
}
}
////TIMOTHY//////////////////
void innkeeper_Timothy object#() () //this totally works!
{
var party = UI_get_party_list();
//var hour = UI_game_hour();
var minute = UI_game_minute();
var current_hour = UI_game_hour();
var checkout = 9;
var sleephours = ((24 - current_hour) + 8);
var hour_ticks = (sleephours * 1500);
var partynum = UI_get_array_size(party);
if (event == TIMOTHY_FADE_SCREEN)
{
var current_hour = UI_game_hour();
var current_minute = UI_game_minute();
var checkout = 9;
var sleephours = ((24 - current_hour) + 8);
var minutes_needed = (59 - current_minute);
var minute_ticks = (minutes_needed * 25);
var advance = (hour_ticks + minute_ticks);
UI_fade_palette(3, 0, false); //fade to black
UI_advance_time(advance); //hours to advance time to 9am checkout time (actually 8:59)
script AVATAR after 30 ticks
{
call innkeeper_Timothy, TIMOTHY_UNFADE_SCREEN;};
}
if (event == TIMOTHY_UNFADE_SCREEN)
{
UI_fade_palette(0, 0, true); //unfadefade from black
AVATAR.say("You sleep in a comfortable bed...You wake rested and eat a large breakfast."); // narrated
TIMOTHY.say("@Good morning, have a good day.@"); // says Timothy
var targets = getFriendlyTargetList(item, 25);
for (npc in targets)
{
npc->clear_item_flag(PARALYZED);
npc->clear_item_flag(POISONED);
var str = npc->get_npc_prop(STRENGTH);
var hps = npc->get_npc_prop(HEALTH);
var food = npc->get_npc_prop(FOODLEVEL);
npc->set_npc_prop(HEALTH, (str - hps));
npc->set_npc_prop(FOODLEVEL, (31 - food));
}
return;
}
}
////PETROPH//////////////////
//30 ticks per minute
enum innkeeper_Petroph_levels
{
PETROPH_FADE_SCREEN = 1,
PETROPH_UNFADE_SCREEN = 2,
CHECKOUT_PETROPH = 3,
LATE_PETROPH = 4
};
void innkeeper_Petroph object#() () //this totally works!
{
var party = UI_get_party_list();
//var hour = UI_game_hour();
var minute = UI_game_minute();
var current_hour = UI_game_hour();
var checkout = 9;
var sleephours = ((24 - current_hour) + 9);
var advance = (sleephours * 1500);
var partynum = UI_get_array_size(party);
if (event == PETROPH_FADE_SCREEN)
{
var sleephours = ((24 - current_hour) + 9);
UI_fade_palette(3, 0, false); //fade to black
UI_advance_time(advance); //hours to advance time to 9am checkout time
script AVATAR after 30 ticks
{
call innkeeper_Petroph, PETROPH_UNFADE_SCREEN;};
}
if (event == PETROPH_UNFADE_SCREEN)
{
UI_fade_palette(0, 0, true); //unfadefade from black
AVATAR.say("You sleep in a comfortable bed...You wake rested and eat a large breakfast.");
PETROPH.say("@Good morning to you.@"); // Narrator says this. Party Sleeps and eats.
UI_add_party_items(partynum, SHAPE_FOOD, QUALITY_ANY, FRAME_EGG); //eggs based on how many party members
return;
}
}
///PEYTON////
//30 ticks per minute
enum innkeeper_Peyton_levels
{
PEYTON_FADE_SCREEN = 1,
PEYTON_UNFADE_SCREEN = 2,
PEYTON_CHECKOUT = 3,
PEYTON_LATE = 4
};
void innkeeper_Peyton object#() () //this totally works!
{
var party = UI_get_party_list();
//var hour = UI_game_hour();
var minute = UI_game_minute();
var current_hour = UI_game_hour();
var checkout = 9;
var sleephours = ((24 - current_hour) + 8);
var hour_ticks = (sleephours * 1500);
var partynum = UI_get_array_size(party);
if (event == PEYTON_FADE_SCREEN)
{
var current_hour = UI_game_hour();
var current_minute = UI_game_minute();
var checkout = 9;
var sleephours = ((24 - current_hour) + 8);
var minutes_needed = (59 - current_minute);
var minute_ticks = (minutes_needed * 25);
var advance = (hour_ticks + minute_ticks);
UI_fade_palette(3, 0, false); //fade to black
UI_advance_time(advance); //hours to advance time to 9am checkout time (actually 8:59)
script AVATAR after 30 ticks
{
call innkeeper_Peyton, PEYTON_UNFADE_SCREEN;};
}
if (event == PEYTON_UNFADE_SCREEN)
{
UI_fade_palette(0, 0, true); //unfadefade from black
PEYTON.say("The next morning, Peyton serves you breakfast."); // Narrator says this. Party Sleeps and eats.
UI_add_party_items(partynum, SHAPE_FOOD, QUALITY_ANY, FRAME_EGG); //eggs based on how many party members
//HEAL PARTY
var targets = getFriendlyTargetList(item, 25);
for (npc in targets)
{
npc->clear_item_flag(PARALYZED);
npc->clear_item_flag(POISONED);
var str = npc->get_npc_prop(STRENGTH);
var hps = npc->get_npc_prop(HEALTH);
npc->set_npc_prop(HEALTH, (str - hps));
}
////////////////////////
return;
}
}
void innkeeper_Martin object#() () //
{
UI_set_item_flag(MARTIN, READ); //set so you can checkout without going too early.
}

View File

@@ -0,0 +1,332 @@
//30 ticks per minute
enum Intro_levels
{
BEGIN_CUTSCENE = 1,
CIRCLE_OF_STONES = 2,
LIGHTNING_BOLT = 3,
AVATAR_RUNS = 4,
PATH_2 = 5,
PATH_3 = 6,
PATH_4 = 7,
PATH_5 = 8,
FIND_ORB = 9,
MOONGATE = 10,
MOONGATE_RISES = 11,
MOONGATE_WANES = 12,
CLEAR_RAIN = 13
};
void GenericPaletteUnfade object#() ()
{
// Do stuff
// Unfade the palette
UI_fade_palette(12, 1, 1);
//call new event
// Do more stuff
}
void GenericPaletteFade object#() ()
{
// Do stuff
// Fade to black:
UI_fade_palette(12, 1, 0);
// Do more stuff
script AVATAR after 60 ticks {nohalt; call GenericPaletteUnfade;};
// Do even more stuff
}
void beginCutsceneIntro object#() ()
{
if (event == BEGIN_CUTSCENE) //avatar moves to window
{
gflags[INTRO] = true;
AVATAR->set_item_flag(BG_DONT_MOVE);
UI_play_music(100);
AVATAR.say("Upon your world, five seasons have passed since your triumphant homecoming from Britannia.*");
AVATAR.say("You have traded the Avatar's life of peril and adventure for the lonely serenity of a world at peace.*");
AVATAR.say("But television supermen cannot take the place of friends who died at your side!*");
AVATAR.say("Outside, a chill wind rises...*");
UI_set_weather(RAIN);
AVATAR.say("...and within moments, the storm is upon you.");
AVATAR.hide();
script AVATAR
{
actor frame standing;
wait 1;
face north;
repeat 2
{
step north; wait 1;
};
repeat 7
{
step east;
wait 1;
};
wait 1;
actor frame standing;
wait 1;
face north;
repeat 3
{
step north;
wait 2;
};
wait 2;
call beginCutsceneIntro, CIRCLE_OF_STONES;
};
}
if (event == CIRCLE_OF_STONES) //avatar sees lightning
{
var pos = [0377, 0058];
var lever = find_nearest(SHAPE_LEVER, 100);
UI_center_view(lever);
lever->center_view();
script lever
{
wait 5;
call beginCutsceneIntro, LIGHTNING_BOLT;
};
}
if (event == LIGHTNING_BOLT)
{
var BUBBLES = 21;
var LIGHTNING_BOLT_SPRITE = 17;
var pos = [0888, 0088, 00];
var avatar_bookshelf = UI_find_object(FIND_ON_SCREEN, 1180, QUALITY_ANY, FRAME_ANY);
script AVATAR
{
wait 10;
};
UI_sprite_effect(LIGHTNING_BOLT_SPRITE, 0888, 0088, 0, 0, 0, -1);
UI_lightning();
UI_sprite_effect(BUBBLES, 0888, 0088, 0, 0, 0, -1);
var orbofmoons = find_nearest(SHAPE_ORB_OF_MOONS, 100);
orbofmoons->move_object(pos);
//using this to avoid running too many scripts off the Avatar
// script avatar_bookshelf after 10 ticks
script orbofmoons after 10 ticks
{
wait 10;
call beginCutsceneIntro, AVATAR_RUNS;
};
}
if (event == AVATAR_RUNS) //goes outside to circle
{
//var avatarpos1 = [0904, 0139, 00]; //walks to path 1
var avatarpos1 = [0887, 0100, 00]; //walks to path 5
var avatarpos2 = [0903, 0122, 00]; //walks to path 2
var avatarpos3 = [0889, 0117, 00]; //walks to path 3
var avatarpos4 = [0887, 0106, 00]; //walks to path 4
var avatarpos5 = [0887, 0100, 00]; //walks to path 5
var orbofmoons = find_nearest(SHAPE_ORB_OF_MOONS, 100);
UI_center_view(AVATAR);
AVATAR->center_view();
AVATAR.say ("Lightning among the stones! Is this a sign from distant Britannia?");
AVATAR.say ("You bolt from your house, stumbling, running blind in the storm. Into the forest, down the path, through the rain... to the stones.");
// UI_si_path_run_usecode(AVATAR, [avatarpos1]); //walk outside
// UI_si_path_run_usecode(AVATAR, [avatarpos2]); //walk to path 2
// UI_si_path_run_usecode(AVATAR, [avatarpos3]); //walk to path 3
// UI_si_path_run_usecode(AVATAR, [avatarpos4]); //walk to path 4
//run to path 1
UI_si_path_run_usecode(AVATAR, [avatarpos1], FIND_ORB, AVATAR, beginCutsceneIntro, true);
UI_error_message("LIGHTNING_BOLT event called from CIRCLE_OF_STONES");
}
if (event == PATH_2)
{
//var avatarpos2 = [0903, 0122, 00]; //walks to path 3
var tree = find_nearest(306, 100); //evergreen
var avatarpos2 = [0889, 0117, 00];
// UI_si_path_run_usecode(AVATAR, [avatarpos2], PATH_3, AVATAR, beginCutsceneIntro, true);
//if (AVATAR->path_run_usecode([avatarpos2], beginCutsceneIntro, AVATAR, PATH_3))
//if (AVATAR->si_path_run_usecode([avatarpos2], PATH_3, AVATAR, beginCutsceneIntro, true))
if (UI_si_path_run_usecode(AVATAR, [avatarpos2], PATH_3, tree, beginCutsceneIntro, true))
UI_error_message("PATH_3 event called from PATH_2");
else
UI_error_message("Failed to reach Path 2");
}
if (event == PATH_3)
{
var avatarpos3 = [0889, 0117, 00];
UI_si_path_run_usecode(AVATAR, [avatarpos3], PATH_4, AVATAR, beginCutsceneIntro, true);
if (AVATAR->path_run_usecode([avatarpos3], beginCutsceneIntro, AVATAR, PATH_4))
UI_error_message("PATH_4 event called from PATH_2");
else
UI_error_message("Failed to reach Path 3");
}
if (event == PATH_4)
{
var avatarpos2 = [0903, 0122, 00]; //walks to path 5
UI_si_path_run_usecode(AVATAR, [avatarpos2], PATH_5, AVATAR, beginCutsceneIntro, true);
}
if (event == PATH_5)
{
var avatarpos2 = [0903, 0122, 00]; //walks to path 2
UI_si_path_run_usecode(AVATAR, [avatarpos2], PATH_3, AVATAR, beginCutsceneIntro, true);
}
if (event == FIND_ORB)
{
var orbofmoons = find_nearest(SHAPE_ORB_OF_MOONS, 100);
var pos = [0888, 0096];
AVATAR.say("Near the stones, the smell of damp, blasted earth hangs in the air. In a frozen moment of lightning struck daylight, you glimpse a tiny obsidian stone in the midst of the circle!");
AVATAR.say("Wondering, you pick it up...");
AVATAR.hide();
//Func0828(orbofmoons);
gotoAndGet(orbofmoons);
//AVATAR->clear_item_flag(BG_DONT_MOVE);
// UI_si_path_run_usecode(AVATAR, [pos], MOONGATE, AVATAR, beginCutsceneIntro, true);
script orbofmoons after 25 ticks
{
call beginCutsceneIntro, MOONGATE;
};
}
if (event == MOONGATE) //moongate
{
var moongate;
var pos = [0888, 0088, 00];
AVATAR->set_item_flag(BG_DONT_MOVE);
moongate = find_nearest(SHAPE_RED_MOONGATE_WANE, 100);
UI_error_message("Event Moongate called");
script AVATAR
{
//actor frame standing; wait 1; face south;
//repeat 5 {step south; wait 1;};
actor frame standing; wait 1; face north;
say "@Could it be..?@";
wait 5;
call beginCutsceneIntro, MOONGATE_RISES;
};
moongate->move_object(pos);
}
if (event == MOONGATE_RISES)
{
var moongate;
var pos = [0888, 0088, 00];
moongate = find_nearest(SHAPE_RED_MOONGATE_WANE, 100);
//moongate->move_object(pos);
script moongate
{
frame 1;
frame 2;
frame 3;
frame 4;
repeat 3 next frame;
;};
script AVATAR after 5 ticks
{
call beginCutsceneIntro, MOONGATE_WANES;
};
}
if (event == MOONGATE_WANES)
{
var moongate = find_nearest(SHAPE_RED_MOONGATE_WANE, 100);
AVATAR.say("Exultant memories wash over you as you clutch the stone. When you last saw an orb such as this, it was cast down by Lord British to banish the tyrant Blackthorn!*");
AVATAR.say("But your joy soon gives way to apprehension. The gate to Britannia has always been blue... as blue as the morning sky.");
AVATAR.say("Abruptly, the portal quivers and begins to sink into the ground. Its crimson light wanes! Desperation makes the decision an easy one.");
script moongate after 5 ticks
{
repeat 6 next frame;;
repeat 5 previous frame;;
repeat 6 next frame;;
};
script AVATAR
{
actor frame standing; wait 1; face north;
repeat 5{step north; wait 1; };
};
script moongate after 5 ticks
{
frame 4;
repeat 3 next frame;;
repeat 6 previous frame;;
remove;
};
script AVATAR after 2 ticks
{
actor frame standing; wait 1; face north;
repeat 5{step north; wait 1; };
call beginCutsceneIntro, CLEAR_RAIN;
};
}
if (event == CLEAR_RAIN)
{
UI_set_weather(0); //clears storm
var pos = [1040, 0179, 01];
AVATAR->move_object(pos);
UI_set_weather(5);
AVATAR->clear_item_flag(BG_DONT_MOVE);
}
}

View File

@@ -0,0 +1,978 @@
//generic function to toggle an npc's BG_DONT_RENDER Flag. If BG_DONT_RENDER is set, clear it. Otherwise set it true.
void toggleRendering object# () ()
{
var rendered = UI_get_item_flag(item, DONT_RENDER);
if (rendered)
UI_clear_item_flag(item, DONT_RENDER);
else
UI_set_item_flag(item, DONT_RENDER);
}
void moveAvatarToIntro object# () ()
{
//move Avatar to his house
AVATAR->move_object([0891, 0153,0]);
//make him sit
UI_set_item_frame(AVATAR, 10);
//set current game hour to 5p
var hours_to_skip = (10);
var advance = (hours_to_skip * 1500);
UI_advance_time(advance);
}
//script to open moongate, give it sound and rotate frames, and ambient light:
void openMoongate object#()()
{
UI_error_message("Open Moongate called from Earth");
UI_set_light(AVATAR, true);
script item
{
frame 1;
frame 2;
frame 3;
frame 4;
repeat 7 next frame;;
frame 4;
repeat 7 next frame;;
frame 4;
repeat 7 next frame;;
frame 4; //recently added
repeat 7 next frame;; //recently added
};
}
void closeMoongate object#()()
{
script item
{
frame 4; wait 3;
frame 3; wait 3;
frame 2; wait 3;
frame 1; wait 3;
frame 0; wait 3;
remove;
wait 25;
}
}
void TeleportBritannia object#() ()
{
var pos = [0935, 1071, 0, 0];
var pos1 = [0936, 1072, 0, 0];
var pos2 = [0934, 1074, 0, 0];
var pos3 = [0932, 1072, 0, 0];
//advance game time to 9am-ish
UI_advance_time(HOUR * 6);
AVATAR->move_object(pos);
SHAMINO->move_object(pos1);
IOLO->move_object(pos2);
DUPRE->move_object(pos3);
UI_add_to_party(SHAMINO);
UI_add_to_party(IOLO);
UI_add_to_party(DUPRE);
AVATAR->clear_item_flag(BG_DONT_MOVE);
AVATAR->clear_item_flag(DONT_RENDER);
//frees LB and company from the WAIT schedule
UI_run_schedule(LORD_BRITISH);
UI_run_schedule(NYSTUL);
UI_run_schedule(GEOFFREY);
IOLO->clear_item_flag(DONT_RENDER);
SHAMINO->clear_item_flag(DONT_RENDER);
DUPRE->clear_item_flag(DONT_RENDER);
UI_add_cont_items(IOLO, 1, SHAPE_BOOKOFPROPHESIES, QUALITY_ANY, FRAME_ANY);
//UI_add_cont_items(AVATAR, 1, SHAPE_SWORD, QUALITY_ANY, FRAME_ANY);
//failsafe - Michael seems to revert to "Wait" schedule for some reason - clear it.
UI_set_schedule_type(MICHAEL, LOITER);
UI_run_schedule(MICHAEL);
}
void garg1Gate object#() ()
{
GARGTHUG1->set_item_flag(DONT_RENDER); //waits til they get thru gate
UI_play_sound_effect(11); //gate sound
}
void garg4Gate object#() ()
{
GARGTHUG4->set_item_flag(DONT_RENDER); //waits til they get thru gate
UI_play_sound_effect(11); //gate sound
}
void garg3Gate object#() ()
{
GARGTHUG3->set_item_flag(DONT_RENDER); //waits til they get thru gate
UI_play_sound_effect(11); //gate sound
AVATAR.say("The gate wanes rapidly as you and Dupre charge through...*");
AVATAR.say("...but not rapidly enough.");
AVATAR.say("From the mob's vanguard, three of the abominations scramble towards the gate. Driven by fury, the creatures hurl their bodies into the portal's last handspan of light!");
}
void gargGate object#() () //sets up gargoyles to leap towards gate
{
const int SHAPE_OBELISK = 894;
var moongate = find_nearest(SHAPE_RED_MOONGATE_WANE, 100);
var obelisk = find_nearest(SHAPE_OBELISK, 100);
script obelisk after 65 ticks
{
call TeleportBritannia; //Moved from script moongate
}
script moongate after 30 ticks
{
frame 4; wait 3;
frame 3; wait 3;
frame 2; wait 3;
frame 1; wait 3;
frame 0; wait 3;
remove;
wait 25;
};
script GARGTHUG1 after 10 ticks
{
repeat 4 {step north; wait 1; };
repeat 8 {step NORTHEAST; wait 1; };
call garg1Gate;
}
script GARGTHUG4 after 13 ticks
{
actor frame kneeling; wait 1;
actor frame standing; wait 1;
repeat 4 {step north; wait 1; };
repeat 4 {step NORTHEAST; wait 1; };
call garg4Gate;
}
script GARGTHUG3 after 14 ticks
{
actor frame kneeling; wait 1;
actor frame standing; wait 1;
repeat 4 {step west; wait 1; };
repeat 5 {step NORTHWEST; wait 1; };
call garg3Gate;
}
}
void AvatarGate object#() ()
{
AVATAR->set_item_flag(DONT_RENDER); //waits til they get thru gate
UI_play_sound_effect(11); //gate sound
//gate wanes function
//then dialogue
script AVATAR after 20 ticks
{
call gargGate;
};
}
void ShaminoGate object#() ()
{
SHAMINO->set_item_flag(DONT_RENDER); //waits til they get thru gate
UI_play_sound_effect(11); //gate sound
}
void DupreGate object#() ()
{
DUPRE->set_item_flag(DONT_RENDER); //waits til they get thru gate
UI_play_sound_effect(11); //gate sound
}
void IoloGate object#() ()
{
IOLO->set_item_flag(DONT_RENDER); //waits til they get thru gate
UI_play_sound_effect(11); //gate sound
}
void IoloPicksUpBook object#() ()
{
AVATAR.say("Snatching the fallen priest's book, Iolo dives into the redness with Shamino at his heels. The howling throng surges forward, all of one terrible mind.");
var bookofprophesies = find_nearest(SHAPE_BOOKOFPROPHESIES, 100);
UI_remove_item(bookofprophesies);
}
void killDeadGarg1 object#() ()
{
var bookofprophesies = find_nearest(SHAPE_BOOKOFPROPHESIES, 100);
var bookpos = [1043, 163, 00];
DEADGARG1->clear_item_flag(SI_TOURNAMENT);
DEADGARG1->reduce_health(50, NORMAL_DAMAGE);
}
void deadPriest object#() ()
{
var bookofprophesies = find_nearest(SHAPE_BOOKOFPROPHESIES, 100);
//var bookpos = [1043, 163, 00];
GARGPRIEST->clear_item_flag(SI_TOURNAMENT);
GARGPRIEST->reduce_health(50, NORMAL_DAMAGE);
var book = UI_create_new_object2(SHAPE_BOOKOFPROPHESIES, [1045, 0166, 0]);
//bookofprophesies->move_object(bookpos);
}
void deadGarg3 object# () () //changed from gargthug 4
{
DUPRE->clear_item_flag(DONT_RENDER);
SHAMINO->clear_item_flag(DONT_RENDER);
var bookofprophesies = find_nearest(SHAPE_BOOKOFPROPHESIES, 100);
var bookpos = [1036, 163, 00];
script SHAMINO after 8 ticks
{
repeat 3 {step south; wait 1; };
repeat 1 {step SOUTHWEST; wait 1; };
face west; wait 1;
actor frame SWING_1; wait 3;
actor frame SWING_2; wait 3;
actor frame SWING_3; wait 3;
sfx 2; wait 5;
actor frame SWING_2; wait 1;
actor frame SWING_1; wait 3;
actor frame SWING_2; wait 3;
actor frame SWING_3; wait 3;
sfx 2; wait 5;
sfx 5; wait 5;
actor frame standing; wait 15;
say "@Let's go!@"; wait 7; //from 2
repeat 1 {step NORTHEAST; wait 1; };
repeat 3 { step north; wait 1;};
call ShaminoGate;
};
script DEADGARG1 after 9 ticks
{
repeat 2 {step NORTHEAST; wait 1; };
repeat 7 {step east; wait 1; };
actor frame SWING_1; wait 2;
actor frame SWING_2; wait 2;
actor frame SWING_1; wait 5;
actor frame kneeling; wait 2;
actor frame LIE; wait 2;
call killDeadGarg1;
};
//give Avatar sword
UI_add_cont_items(AVATAR, 1, SHAPE_SWORD, QUALITY_ANY, FRAME_ANY, false);
script DUPRE after 10 ticks
{
//repeat 1 {step SOUTHWEST; wait 1; };
repeat 9 {step south; wait 2;};
actor frame standing; face south; wait 1;
actor frame SWING_1; wait 2;
actor frame SWING_2; wait 2;
actor frame SWING_3; wait 2;
actor frame SWING_2; wait 2;
actor frame standing; wait 1;
say"@Quickly, old friend!@";
wait 4;
say"@To the gate!@"; wait 5;
repeat 5{ step NORTHEAST; wait 1;};
face south; wait 50; //changed from 30
repeat 3{ step NORTHWEST; wait 1;};
call DupreGate;
};
script GARGTHUG1 after 5 ticks
{
actor frame standing; face north; wait 1;
};//make him do more
script GARGTHUG2 after 15 ticks
{
repeat 3 {step north; wait 1;};
repeat 2 {step NORTHWEST; wait 1;};
sfx 1;
step SOUTHWEST; wait 2;
actor frame sleeping; wait 1;
};
script GARGTHUG3 after 20 ticks //maybe change
{
repeat 5 {step NORTHWEST; wait 1;};
sfx 1;
wait 3;
actor frame kneeling; wait 1;
actor frame LIE; wait 1;
};
script AVATAR after 50 ticks //after dupre frees
{
actor frame standing; face north;
wait 60; //adjust as necessary
repeat 13 {step north; wait 1;};
call AvatarGate;
}
}// end gargthug3
void IoloEmerges object#() ()
{
AVATAR.say("Silent red light fills the darkness. There is the wooden clack of a crossbow, and a violet fletched rose blooms in the priest's barren forehead.*");
AVATAR.say("Friendly faces vault from a newborn moongate, while a rain of quarrels holds the furious mob at bay. The knight Dupre's sword flashes twice in the darkness, slicing away your bonds!*");
script IOLO after 2 ticks //from 4 ticks
{
actor frame standing; wait 1; face south;
repeat 2{step south; wait 1; };
actor frame 19; wait 1; face south;
sfx 0; wait 3;
sfx 1;
actor frame 25; wait 1; face south;
actor frame 19; wait 1; face south;
sfx 0; wait 3;
sfx 1;
actor frame standing; wait 1; face east;
actor frame 19; wait 1; face east;
actor frame 25; wait 1; face east;
sfx 0;
actor frame 25; wait 1; face south;
actor frame 19; wait 2; face south;
say "@Hurry!@"; wait 2;
face south; wait 2;
face west; wait 1;
actor frame 25; wait 1; face south;
actor frame 19; wait 1; face south;
sfx 0; wait 3;
sfx 1;
face south; wait 1;
repeat 3{step SOUTHEAST; wait 1; };
repeat 2{ step south; wait 1;};
actor frame bowing; wait 5;
call IoloPicksUpBook; wait 5;
repeat 1{step NORTHWEST; wait 1; };
repeat 5{step north; wait 1; };
call IoloGate;
};
script GARGTHUG4 after 15 ticks
{
repeat 4 {step NORTHWEST; wait 1; };
call deadGarg3;
call deadPriest;//move this?
repeat 3 {step north; wait 1;};
wait 5;
actor frame SWING_1; wait 2;
actor frame SWING_2; wait 3;
actor frame kneeling; wait 1;
actor frame LIE; wait 1;
};
}
void CompanionsOut object#() ()
{
IOLO->clear_item_flag(DONT_RENDER);
//UI_add_to_party(SHAMINO);
//UI_add_to_party(DUPRE);
//UI_add_to_party(IOLO);
script IOLO after 15 ticks
{
call IoloEmerges;
};
}
void openEyes object#() ()
{
UI_fade_palette(0, 0, true); //unfadefade from black
var pos = [1041, 0153, 00];
var moongate = find_nearest(SHAPE_RED_MOONGATE_WANE, 100);
moongate->move_object(pos);
script moongate
{
frame 1;
frame 2;
frame 3;
frame 4;
repeat 40
{
frame 5;
frame 6;
frame 7;
frame 8;
frame 9;
frame 10;
frame 11;
};
};
AVATAR.say("Catcalls, the dagger, a scream, Death....");
AVATAR.say("Pandemonium. Shrieks of rage, of terror.");
AVATAR.say("From the inevitable, an impossibility emerges.*");
AVATAR.say("You are still alive.");
script AVATAR
{
call CompanionsOut;
};
}
void closeEyes object#() ()
{
/*
var pos = [1041, 0153, 00];
var moongate = find_nearest(SHAPE_RED_MOONGATE_WANE, 100);
moongate->move_object(pos);
*/
AVATAR.say("Shouts and jeers explode from the masses as the priest slams shut the book. In his hand a malignant dagger drips with moonlight.*");
AVATAR.say("You close your eyes. A dying scream, certainly your own, curdles the air.**");
UI_fade_palette(3, 0, false); // fade to black var moongatepos = [1041, 0153, 00];
script AVATAR after 10 ticks
{
sfx 0;
wait 3;
sfx 0;
wait 2;
sfx 1;
wait 1;
sfx 3;
wait 2;
sfx 5;
}
/*
script moongate after 5 ticks
{
frame 1;
frame 2;
frame 3;
frame 4;
repeat 45
{ //from 30
frame 5;
frame 6;
frame 7;
frame 8;
frame 9;
frame 10;
frame 11;
};
};
*/
script AVATAR after 60 ticks
{
call openEyes;
}
}
void gargPriestChant object#() ()
{
AVATAR.say("...but you have no place to go.");
AVATAR.say("Before you can offer a protest to the creatures who surround you, scaly claws grasp your body.");
AVATAR.say("With unearthly strength, the monsters bind you to the altar stone!");
AVATAR.say("Kneeling, the hordes sway and chant as a stately winged nightmare steps forward.*");
AVATAR.say("The leader unwraps a velvet covered, brass-bound book and recites from it in a formal, stilted tounge.*");
script GARGPRIEST
{
actor frame 20; face south; wait 10;
actor frame 21; face south; wait 10;
actor frame 22; face south; wait 5;
actor frame USE; wait 3;
actor frame CAST_2; wait 3;
actor frame 21; face south; wait 1;
actor frame 23; face south; wait 9;
actor frame 24; face south; wait 10;
say "@An-bal-sil-fer!@"; wait 5;
call closeEyes;
}
}
void gargoylesApproach object# () ()
{
AVATAR.say("Dazed, you emerge from the portal to find yourself standing on a desolate plain. Nearby, rests a massive rune-struck altar, shrouded in moonlit fog.");
AVATAR.say("At first the plain is still. Then a hundred voices raise a slow, deathlike song, drawing closer and closer with each passing moment. You are seized by an urge to run...");
script GARGTHUG1 //comes from south then west to grab Avatar
{
actor frame standing; wait 1;
repeat 10{step north; wait 1;};
repeat 7 {step east; wait 1;};
actor frame strike_1h; wait 15;
actor frame standing; wait 1;
face north;
step north; wait 1;
step north; wait 1;
actor frame strike_2h; wait 3;
actor frame USE; wait 3;
repeat 7 {step west; wait 1;};
repeat 2 {step north; wait 1;};
face east;
actor frame kneeling;
};
script GARGTHUG2 //comes from south then west to grab Avatar
{
actor frame standing; wait 1;
repeat 10{step north; wait 1;};
repeat 5 {step west; wait 1;};
actor frame strike_1h; wait 15;
actor frame standing; wait 1;
actor frame strike_1h; wait 3;
actor frame strike_2h; wait 3;
repeat 6 {step east; wait 1;};
repeat 3 {step north; wait 1;};
face west;
actor frame kneeling;
};
script GARGTHUG4 after 10 ticks //strikes the avatar from behind
{
actor frame standing; wait 1;
repeat 8{step north; wait 1;};
wait 9; //recently added //moved from 8
actor frame strike_1h; wait 1;
actor frame standing; wait 13; //may have to adjust
step north;
step north;
actor frame kneeling;
};
script AVATAR after 30 ticks //changed from 40 - 4/17
{
nohalt;
wait 2;
say "@Argh!@";
actor frame standing; wait 1; face north;
repeat 3{step north; wait 1; };
actor frame bowing; wait 1; face east;
actor frame kneeling; wait 1;
actor frame sleeping; wait 1; face east;
actor frame sleeping; wait 1; face east;
actor frame sleeping; wait 1; face east;
};
script GARGPRIEST after 53 ticks
{
nohalt;
repeat 6{step south; wait 1;};
repeat 13 {step west; wait 1;};
face south; wait 1;
call gargPriestChant;
};
script GARGTHUG3 after 55 ticks
{
nohalt;
face east;
repeat 3
{
actor frame SWING_1; wait 1;
actor frame standing; wait 15;
frame SWING_2; wait 10;
frame SWING_1; wait 5;
actor frame standing;
};
};
script DEADGARG1 after 55 ticks
{
face east;
repeat 4
{
actor frame SWING_3; wait 15;
actor frame SWING_1; wait 10;
actor frame SWING_2; wait 5;
};
};
script GARGBYSTANDER1 after 50 ticks //winged
{
face east;
repeat 4
{
actor frame 53; wait 15;
actor frame 54; wait 8;
actor frame 53; wait 10;
actor frame standing; wait 19;
};
};
script GARGBYSTANDER3 after 50 ticks //wingless
{
face east;
repeat 4
{
actor frame 55; wait 15;
actor frame 56; wait 8;
actor frame 55; wait 10;
actor frame standing; wait 10;
};
};
script GARGBYSTANDER4 after 40 ticks //winged
{
face south;
repeat 4
{
actor frame 53; wait 15;
actor frame 54; wait 8;
actor frame 53; wait 10;
actor frame standing; wait 19;
};
};
script GARGBYSTANDER2 after 40 ticks //winged
{
face east;
repeat 30
{
actor frame 23; wait 5;
actor frame 24; wait 5;
actor frame 23; wait 5;
actor frame 22; wait 5;
actor frame standing; wait 19;
};
};
}
void strangeLand object# () ()
{
//create exiting moongate:
var moongate = UI_create_new_object2(SHAPE_RED_MOONGATE_WANE, [1040, 0177]);
moongate->set_item_frame(6); //open moongate
script moongate
{
call closeMoongate;
}
script AVATAR
{
call toggleRendering; //clear DO NOT RENDER flag
actor frame standing; wait 1; face north;
repeat 3{step north; wait 1; };
actor frame standing; wait 1; face west;
actor frame standing; wait 1; face east;
say "@Where am I??@";
actor frame standing; wait 1; face north;
repeat 3{step north; wait 1; };
//wait 1;////
call gargoylesApproach;
};
}
////////////////////////////// 1st half////////////////////////////////////////////////
void clearRain object# () ()
{
UI_set_weather(0); //clears storm
var pos = [1040, 0179, 01];
AVATAR->move_object(pos); //moves to gargoyle land
UI_set_weather(5); //fog
UI_play_music(102);
script AVATAR { call strangeLand;};
}
void moongateWanes object#() ()
{
var moongate = find_nearest(SHAPE_RED_MOONGATE_WANE, 100);
AVATAR.say("Exultant memories wash over you as you clutch the stone. When you last saw an orb such as this, it was cast down by Lord British to banish the tyrant Blackthorn!*");
AVATAR.say("But your joy soon gives way to apprehension. The gate to Britannia has always been blue... as blue as the morning sky.");
AVATAR.say("Abruptly, the portal quivers and begins to sink into the ground. Its crimson light wanes! Desperation makes the decision an easy one.");
script moongate after 2 ticks
{
frame 6; wait 1;
frame 5; wait 1;
frame 4; wait 1;
frame 3; wait 1;
frame 2; wait 1;
frame 0; wait 1;
remove;
};
script AVATAR
{
actor frame standing;
wait 1; face north;
repeat 5{step north; wait 1; };
call toggleRendering; //set DO NOT RENDER flag to true (hide him)
sfx 11;
wait 2; //from 4
call clearRain;
};
}
void moongateRises object#() () //makes moongate appear
{
var moongate;
var pos = [0889, 0088, 00];
moongate = find_nearest(SHAPE_RED_MOONGATE_WANE, 100);
moongate->move_object(pos);
script moongate
{
call openMoongate;
};
script AVATAR after 35 ticks
{
call moongateWanes;
};
}
void standBack object#() ()
{
script AVATAR
{
actor frame standing; wait 1; face south;
repeat 5 {step south; wait 1;};
actor frame standing; wait 1; face north;
say "@Could it be...?@";
wait 4;
call moongateRises;
};
}
void findOrb object#() ()
{
var orbofmoons = find_nearest(SHAPE_ORB_OF_MOONS, 100);
AVATAR.say("Near the stones, the smell of damp, blasted earth hangs in the air. In a frozen moment of lightning struck daylight, you glimpse a tiny obsidian stone in the midst of the circle!");
AVATAR.say("Wondering, you pick it up...");
AVATAR.hide();
gotoAndGet(orbofmoons);
script orbofmoons after 25 ticks
{
call standBack;
};
}
void path5 object#() ()
{
var avatarpos1 = [0904, 0139, 00]; //walks to path 1
var avatarpos2 = [0903, 0122, 00]; //walks to path 2
var avatarpos3 = [0889, 0117, 00]; //walks to path 3
var avatarpos4 = [0887, 0106, 00]; //walks to path 4
var avatarpos5 = [0887, 0100, 00]; //walks to path 5
script AVATAR after 20 ticks
{
call findOrb;
}
}
void avatarRuns object#() () //takes center view back to Avatar, runs to circle of stones. PATH 1
{
var avatarpos1 = [0904, 0139, 00]; //walks to path 1
var avatarpos2 = [0904, 0120, 00]; //walks to path 2
var avatarpos3 = [0891, 0120, 00]; //walks to path 3
var avatarpos4 = [0887, 0106, 00]; //walks to path 4
var avatarpos5 = [0887, 0100, 00]; //walks to path 5
UI_center_view(AVATAR);
AVATAR.say ("Lightning among the stones! Is this a sign from distant Britannia?");
AVATAR.say ("You bolt from your house, stumbling, running blind in the storm. Into the forest, down the path, through the rain... to the stones.");
//call event 2
UI_si_path_run_usecode(AVATAR, [avatarpos5], SCRIPTED, AVATAR, path5, true);//walk outside
}
void lightningOrb object# () ()
{
var BUBBLES = 21;
var LIGHTNING_BOLT_SPRITE = 17;
var pos = [0888, 0088, 00];
UI_sprite_effect(LIGHTNING_BOLT_SPRITE, 0888, 0088, 0, 0, 0, -1);
UI_lightning();
UI_play_sound_effect(62); //lightning bolt sound
UI_sprite_effect(BUBBLES, 0888, 0088, 0, 0, 0, -1);
var orbofmoons = find_nearest(SHAPE_ORB_OF_MOONS, 100);
orbofmoons->move_object(pos);
script AVATAR after 30 ticks
{
call avatarRuns;
};
}
void intro3 object# () () //shows circle of stones, puts orb of moons there
{
var circleofstones = [0887, 0088, 00];
UI_view_tile(circleofstones);
script AVATAR after 10 ticks {call lightningOrb;};
}
void intro2 object#() ()
{
var avatarpos0 = [0899, 0148, 00]; //walks to path 0
var avatarpos1 = [0899, 0145, 00]; //walks to path 0
AVATAR.say("Upon your world, five seasons have passed since your triumphant homecoming from Britannia.*");
AVATAR.say("You have traded the Avatar's life of peril and adventure for the lonely serenity of a world at peace.*");
AVATAR.say("But television supermen cannot take the place of friends who died at your side!*");
AVATAR.say("Outside, a chill wind rises...*");
UI_set_weather(RAIN);
AVATAR.say("...and within moments, the storm is upon you.");
AVATAR.hide();
script AVATAR after 10 ticks
{
actor frame standing; wait 1;
repeat 7 {step NORTHEAST; wait 1;};
actor frame standing;
wait 20;
call intro3;
};
}
void intro1 object#() () //should be triggered by egg
{
gflags[INTRO] = true;
AVATAR->set_item_flag(BG_DONT_MOVE);
UI_play_music(100);
script AVATAR after 10 ticks
{
face north;
actor frame sitting; wait 20;
actor frame USE; wait 5;
sfx 18; //click
actor frame standing; wait 1;
actor frame sitting; wait 30;
actor frame USE; wait 5;
sfx 18; //click
actor frame standing; wait 10;
actor frame USE; wait 5;
sfx 18; //click
actor frame sitting; wait 15;
call intro2;
};
}

View File

@@ -0,0 +1,79 @@
enum test_levels
{
EVENT_ONE = 1,
EVENT_TWO = 2,
EVENT_THREE = 3,
EVENT_FOUR = 4
};
void introScript object#() () //
{
if (event == INTRO_1)
{
var avatarpos0 = [0899, 0148, 00]; //walks to path 0
var avatarpos1 = [0899, 0145, 00]; //walks to path 0
AVATAR.say("Upon your world, five seasons have passed since your triumphant homecoming from Britannia.*");
AVATAR.say("You have traded the Avatar's life of peril and adventure for the lonely serenity of a world at peace.*");
AVATAR.say("But television supermen cannot take the place of friends who died at your side!*");
AVATAR.say("Outside, a chill wind rises...*");
UI_set_weather(RAIN);
AVATAR.say("...and within moments, the storm is upon you.");
AVATAR.hide();
script AVATAR after 10 ticks
{
actor frame standing;
wait 1;
repeat 7 {step NORTHEAST; wait 1;};
actor frame standing;
wait 20;
call introScript, INTRO_2;
};
}
if (event == EVENT_TWO)
{
randomPartyBark("@Intro 2 is playing@");
script AVATAR after 30 ticks
{
call testScript, EVENT_THREE;
}
}
if (event == EVENT_THREE)
{
randomPartyBark("@Event THREE is playing@");
script AVATAR after 30 ticks
{
call testScript, EVENT_FOUR;
}
}
if (event == EVENT_FOUR)
{
randomPartyBark("@Event FOUR is playing@");
}
}

View File

@@ -0,0 +1,351 @@
void QuentonSidequest object# () ()
{
if (event == EGG)
{
var egg_loc = UI_get_object_position(item);
UI_error_message("QuentonSidequest called from egg, is not supposed to happen.");
UI_error_message("Egg is at " + egg_loc[X] + ", " + egg_loc[Y] + ". Deleting and resetting Michael's schedule.");
UI_run_schedule(MICHAEL);
UI_remove_item(item);
}
enum sidequest_levels
{
PREP_SHIP = 1,
MOVE_BOAT = 2,
REMOVE_BOAT = 3,
FAILURE = 4
};
if (event == PREP_SHIP)
{
//hopefully prevent any rogue duplicate creation of Michael's ship when it shouldn't be..
if (gflags[MARNEY_SAVED]||gflags[MARNEY_GONE])
{
UI_error_message("ERROR! Michael's boat cannot be made again.");
abort;
}
else
{
UI_error_message(["QuentonSidequest PREP SHIP event called"]);
gflags[MICHAEL_AT_DOCKS] = true; //this will enable a 3 hour time window from 9 to midnight in order to catch him
//Search for raft or other Avatar Ship in the immediate area,
//Delete it
UI_remove_from_area(791, FRAME_ANY, [0015, 1434], [0159, 1475]); //Ship
UI_remove_from_area(1017, FRAME_ANY, [0015, 1434], [0159, 1475]); //Ship
UI_remove_from_area(775, FRAME_ANY, [0015, 1434], [0159, 1475]); //Ship rails
UI_remove_from_area(405, FRAME_ANY, [0015, 1434], [0159, 1475]); //Ship's hold
UI_remove_from_area(150, FRAME_ANY, [0015, 1434], [0159, 1475]); //Gangplank
UI_remove_from_area(199, FRAME_ANY, [0015, 1434], [0159, 1475]); //Mast
UI_remove_from_area(680, FRAME_ANY, [0015, 1434], [0159, 1475]); //Deck
UI_remove_from_area(700, FRAME_ANY, [0015, 1434], [0159, 1475]); //Deck
UI_remove_from_area(251, FRAME_ANY, [0015, 1434], [0159, 1475]); //sails
UI_remove_from_area(292, FRAME_ANY, [0015, 1434], [0159, 1475]); //Seats
UI_remove_from_area(961, FRAME_ANY, [0015, 1434], [0159, 1475]); //Barge
UI_remove_from_area(1241, FRAME_ANY, [0015, 1434], [0159, 1475]); //Raft
//create the ship
AVATAR->createShip();
//Move Michael onto the ship
UI_move_object(MICHAEL, [0134, 1459, 1]);
UI_set_schedule_type(MICHAEL, WAIT);
UI_set_item_frame(MICHAEL, 16);
UI_error_message("Setting MICHAEL to WAIT schedule via quenton sidequest egg event PREP_SHIP");
//Move Marney into place on the docks
UI_move_object(MARNEY, [0132, 1468, 2]);
UI_set_schedule_type(MARNEY, WAIT);
UI_set_item_frame(MARNEY, 0);
//place scrolls near fireplace
var scroll = UI_create_new_object2(SHAPE_SCROLL, [0626, 1379, 0]);
scroll->set_item_quality(55);
var scroll2 = UI_create_new_object2(SHAPE_SCROLL, [0626, 1379, 1]);
scroll2->set_item_quality(62);
//letter from Marney to Michael
var scroll3 = UI_create_new_object2(SHAPE_SCROLL, [0627, 1379, 0]);
scroll3->set_item_quality(63);
}
}
if (event == MOVE_BOAT)
{
UI_error_message(["QuentonSidequest MOVE_BOAT event called"]);
var barge = UI_find_nearby(MICHAEL, 961, 30, MASK_EGG);
var sailframe;
//find sails, open them
var sail;
var sails = UI_find_nearby([0133, 1461, 5], 251, 30, MASK_EGG);
for (sail in sails)
{
sailframe = UI_get_item_frame_rot(sail);
if (sailframe == 37)
sail->set_item_frame(33);
else
sail->set_item_frame(34);
}
var open_gangplank = UI_find_object(FIND_ON_SCREEN, 150, QUALITY_ANY, FRAME_ANY);
var gangplank;
gangplank->get_item_shape(open_gangplank);
open_gangplank->set_item_shape(781);
open_gangplank->set_item_frame(33);
UI_move_object(open_gangplank, [0134, 1461, 1]);
script barge
{
call freezeAvatar;
repeat 20{
step west;
wait 2;
};
call centerOnAvatar;
call unfreezeAvatar;
wait 2;
call QuentonSidequest, REMOVE_BOAT;
}
gflags[MICHAEL_AT_DOCKS] = false;
}
if (event == REMOVE_BOAT)
{
var boat_pieces;
var piece;
var barge;
boat_pieces = UI_find_nearby([0048, 1459, 0], 680 , FRAME_ANY, MASK_NONE); //rails
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([0048, 1459, 0], 700 , 30, MASK_NONE); //deck
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([0048, 1459, 0], 150 , 30, MASK_NONE); //deck
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([0048, 1459, 0], 791 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([0048, 1459, 0], 775 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([0048, 1459, 0], 665 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([0048, 1459, 0], 1017 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([0048, 1459, 0], 251 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([0048, 1459, 0], 405 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([0048, 1459, 0], 781 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
//barge = UI_find_object([0048, 1459, 0], 791, QUALITY_ANY, FRAME_ANY)
barge = UI_find_nearby([0048, 1459, 0], 791 , 30, MASK_EGG); //
UI_remove_item(barge);
boat_pieces = UI_find_nearby([0048, 1459, 0], 961 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([0048, 1459, 0], 199 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
//Move Michael
UI_move_object(MICHAEL, [0678, 2070, 0]); //moves him to cell
UI_set_schedule_type(MICHAEL, WAIT);
UI_set_item_frame(MICHAEL, 16);
//set tournament flag, so when you "kill" him, he will be captured IF Renthar is in the party.
UI_set_item_flag(MICHAEL, SI_TOURNAMENT);
if (gflags[MARNEY_GONE])
{
//Move Marney into holding place
UI_move_object(MARNEY, [0823, 1878, 0]);
UI_set_schedule_type(MARNEY, WAIT);
//if you let her go, she will be dead or at least not able to be found
if (gflags[FAILED_QUENTON_QUEST])
UI_set_item_flag(MARNEY, DEAD);
// gflags[FAILED_QUENTON_QUEST] = true;
}
}
if (event == FAILURE)
{
UI_error_message(["QuentonSidequest FAILURE event called"]);
if (!gflags[FAILED_QUENTON_QUEST])
{
gflags[FAILED_QUENTON_QUEST] = true;
UI_error_message(["gflag FAILED_QUENTON_QUEST is true"]);
gflags[MICHAEL_AT_DOCKS] = false;
}
if (gflags[MARNEY_SAVED]||gflags[MARNEY_GONE]) //Marney was saved or gone, this shouldn't do anything now
abort;
else //called when you waited too long
{
subtractKarma(20);
// Find and delete the pieces of the boat.
var boat_pieces;
var piece;
var x = 0133;
var y = 1459;
var z = 0;
boat_pieces = UI_find_nearby([x, y, z], 680 , FRAME_ANY, MASK_NONE); //rails
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 700 , 30, MASK_NONE); //deck
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 150 , 30, MASK_NONE); //deck
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 791 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 775 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 665 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 1017 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 251 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 405 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 781 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 791 , 30, MASK_EGG); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 961 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
boat_pieces = UI_find_nearby([x, y, z], 199 , 30, MASK_NONE); //
for (piece in boat_pieces)
UI_remove_item(piece);
//Move Michael
UI_move_object(MICHAEL, [0678, 2070, 0]);
UI_set_schedule_type(MICHAEL, WAIT);
UI_set_item_frame(MICHAEL, 16);
UI_error_message("Setting MICHAEL to WAIT schedule via quenton sidequest egg event FAILURE");
gflags[MICHAEL_AT_DOCKS] = false;
//Move Marney into holding place
UI_move_object(MARNEY, [0823, 1878, 0]);
UI_set_schedule_type(MARNEY, WAIT);
UI_set_item_flag(MARNEY, DEAD);
//Rinaldo and Renthar are both killed by pirates
// UI_set_item_flag(RINALDO, DEAD);
UI_move_object(RINALDO, [0759, 0424, 0]);
UI_set_schedule_type(RINALDO, WAIT);
UI_apply_damage(127, 127, NORMAL_DAMAGE, RINALDO);
UI_move_object(RENTHAR, [0823, 1877, 0]);
UI_set_schedule_type(RENTHAR, WAIT);
UI_set_item_flag(RENTHAR, DEAD);
gflags[MARNEY_GONE] = true;
}
}
}

View File

@@ -0,0 +1,400 @@
//Quenton sidequest eggs
const int MARNEY_TIMER = 16; // used for quest
const int INVESTIGATION_TIMER = 16; // used for quest
void MichaelWaits 3012()
{
var hour = UI_game_hour();
var minute = UI_game_minute();
var hour_to_pass = 20 - hour;
var minute_to_pass = 59 - minute;
var n = ((hour_to_pass * 1500) + (minute_to_pass * 15));
var player_is_female;
var hours_to_midnight = UI_get_npc_id(RINALDO);
var timer_start = UI_get_npc_id(MICHAEL);
var pronoun;
var quality = UI_get_item_quality(item);
if (player_is_female) //
pronoun = "She";
else
pronoun = "He";
if (event == EGG)
{
if (quality == 0)
{
if (gflags[MICHAEL_AT_DOCKS])
UI_remove_item(item);
//FAILSAFE: If you sleep, script doesn't advance right? This should keep it moving along
if (!gflags[MICHAEL_AT_DOCKS] && (hour >= 21) && (hour < 24)) //UI_part_of_day(NIGHT)
{
gflags[MICHAEL_TO_SKARA] = true;
// UI_halt_scheduled(item); //should cancel other script
script item
{
call QuentonSidequest, 1;
remove;
}
UI_remove_item(item);
}
else if ((gflags[STARTED_INVESTIGATION]) && (hour < 21))
{
//will start timer. Once 9pm hits, Michael moves to Skara to convince Marney to leave with him.
if (isNearby(MICHAEL))
{
MICHAEL.say("@What are you doing here? Get out of my house at once!@");
MICHAEL.say("He shoves you out of the house and slams the door in your face.");
MICHAEL.hide();
//This flag is set to ensure that after the day is over, time will be up. Used in failsafe egg
gflags[MICHAEL_TO_SKARA] = true;
UI_error_message(["Ticks in var n needed to wait is " + n]);
if (isNearby(IOLO))
{
IOLO.say("As you leave, Iolo whispers to you. @Avatar, normally I wouldn't condone this.. but let's try coming back later tonight to search when he's sleeping...@");
IOLO.say("@Maybe we'll find something then.@");
IOLO.hide();
}
else
{
randomPartySay("@He's clearly hiding something, perhaps we could come back and search when he's asleep..@");
randomPartySay.hide();
}
//pushed out the door
UI_move_object(PARTY, [0632, 1393]);
//look for open doors / unlocked doors of quality 24
var door;
var open_doors = UI_find_nearby([0631, 1391, 0], 376, 20, MASK_NONE);
//change open door to closed, correct quality
for (door in open_doors)
{
UI_set_item_shape(door, 270);
UI_set_item_quality(door, 199); //should prevent breaking?
}
//make sure script only runs once
if (!UI_get_item_flag(MICHAEL, PETRA))
{
UI_set_item_flag(MICHAEL, PETRA);
script item after n ticks
{
// nohalt;
call QuentonSidequest, 1; //should create the boat
}
}
return;
}
else //Michael not nearby, either cheating detected or you failed
UI_remove_item(item);
}
else
abort;
}
}
}
void triggerMarneyConvo 3013()
{
var hour = UI_game_hour();
var player_is_female;
var minute = UI_game_minute();
const int MarneyUpset = 10; //timer
var polite_title = getPoliteTitle();
var pronoun;
if (player_is_female) //
pronoun = "She";
else
pronoun = "He";
if (event == EGG)
{
if ((hour >= 21) && (isNearby(MARNEY)) && (isNearby(MICHAEL)) && gflags[MICHAEL_AT_DOCKS])
{
var options = ["goodbye", "wait!"];
//failsafe - ship is buggy sometimes and doesn't show. this will ensure a boat is made:
if (!gflags[MICHAEL_SHIP_BUILT])
AVATAR->createShip();
//another failsafe - if reloading game elsewhere, sometimes ship "disappears". Fix that
//var boat = UI_find_nearby([0133, 1461], 700, 5, MASK_NONE);
var boat = UI_find_nearby(MICHAEL, 700, 5, MASK_EGG); //find new barge created
if (boat == 0)
{
AVATAR->createShip();
UI_error_message("ERROR! Boat not found at docks. Creating one.");
// barge = UI_find_nearby(MICHAEL, 961, 30, MASK_EGG); //find new barge created
}
var barge = UI_find_nearby(MICHAEL, 961, 30, MASK_EGG);
UI_set_item_flag(AVATAR, BG_DONT_MOVE);
MARNEY.say("@Oh! Avatar, what brings you here tonight?@ she says, nervously. I was just out for a walk...");
randomPartySay("@At this late hour?@");
randomPartySay.hide();
MARNEY.say("She sighs. @I guess I can't fool the Avatar... The truth is..., I'm going with Michael on a trip to get away from it all.@");
MARNEY.say("@With my father's murder, the gargoyles, my health.. I need some time away from here. We had talked about this for some time now, but tonight Michael put it all together!@");
MARNEY.say("@Just...please, don't tell Yorl. I... need to get away from the sadness here for a while...@");
MARNEY.hide();
MICHAEL.say("Michael looks at you and appears to hold in his rage as best he can. @This doesn't concern you, Avatar. Marney has agreed to come with me.@");
MICHAEL.say("@She wants to see the world with me, to ease her heart and mind.@ He turns to Marney. @Let us depart my dear, before Yorl awakes.@");
MICHAEL.hide();
MARNEY.say("Marney closes her eyes, trying to hold back tears, then takes a breath. @Yes, let us see the world together. This is for the better.@");
MARNEY.say("She turns to you. @Farewell Avatar, when I return perhaps thou can stop by sometime and I'll tell you all about our adventures.@");
converse(options)
{
case "goodbye":
if (inParty(DUPRE))
{
DUPRE.say("Dupre looks at you incredulosly. @Avatar... you can't possibly be allowing her to leave with him?@");
DUPRE.hide();
}
if (inParty(IOLO))
{
IOLO.say("@Michael has obviously filled her head with lies, Avatar. We're just going to stand here and let them leave?!@");
IOLO.hide();
}
if (inParty(SHAMINO))
{
SHAMINO.say("@Avatar, why didst thou not stop her from making this mistake? Clearly this is not in her best interests...@");
SHAMINO.hide();
}
subtractKarma(30);
//moves Marney to the docks, calls MOVE_BOAT
UI_si_path_run_usecode(MARNEY, [0135, 1458, 1], 2, barge, QuentonSidequest, true);
gflags[MARNEY_GONE] = true;
gflags[FAILED_QUENTON_QUEST] = true; //can't save her now...
break;
case "wait!"(remove):
MICHAEL.say("Looking impatient and agitated, Michael speaks up, @Make it quick, " + polite_title + ", we're in a hurry..@");
MICHAEL.hide();
MARNEY.say("@Yes, Avatar? What is it?@");
add("Michael killed Quenton");
case "Michael killed Quenton"(remove):
MARNEY.say("Wh..what?@");
AVATAR.say("@I found evidence linking Michael to the murder of your father. It was not the gargoyles.@");
AVATAR.hide();
if (inParty(DUPRE))
{
DUPRE.say("@Milady, Michael killed your father when he didn't repay a debt he owed to him. He's decieving you, you mustn't trust him.@");
DUPRE.hide();
}
MARNEY.hide();
MICHAEL.say("Michael growls, @" + pronoun + "'s a liar! Everyone in town agrees it was those bloody gargoyles who killed thy father.@");
MICHAEL.hide();
MARNEY.say("@How do you know this? Where is thy proof? Michael has been nothing but kind to me...@");
if (UI_count_objects(PARTY, SHAPE_SCROLL, 62, FRAME_ANY)) //bloodstained Michael letter
{
MARNEY.say("You show Marney the bloody letter that was found in Michael's home.");
MARNEY.say("Tears start streaming down her face, and she chokes out: @This.. is father's handwriting..@");
MARNEY.say("@...Michael? Is this...@ she can barely talk now.");
MARNEY.say("@...how could you...@");
MARNEY.say("Marney collapses into your arms and starts sobbing.");
MARNEY.hide();
UI_set_item_flag(MARNEY, ASLEEP); //make her fall
UI_set_schedule_type(MARNEY, SLEEP);
MICHAEL.say("Seeing the charade was up, Michael speaks: @It was nothing personal my dear, but after all, he did owe a debt.@");
MICHAEL.say("He turns to you with murder in his eyes. @You'll pay for this, swine!@");
MICHAEL.say("Michael raises the anchor, and sails away!");
delayedBark(AVATAR, "He's gone..", 3);
UI_set_item_flag(MARNEY, SI_ZOMBIE); //used to add more convo flags for her
UI_set_timer(MARNEY_TIMER); //timer for Marney to take some time before she'll talk again
UI_error_message("Current game hour is " + hour + ", Marney timer is set to " + UI_get_timer(MARNEY_TIMER));
//Move Renthar to High Court in Yew
RENTHAR->move_object([0675, 0521, 0]);
//Move Rinaldo in front of him:
RINALDO->move_object([0672, 0520, 0]);
UI_set_schedule_type(RINALDO, WAIT);
UI_set_item_frame(RINALDO, 0);
//make face each other:
makeNPCFaceNPC(RINALDO, RENTHAR);
makeNPCFaceNPC(RENTHAR, RINALDO);
giveExperience(100);
gflags[MARNEY_SAVED] = true;
script item
{
call QuentonSidequest, 2; //move boat
}
UI_remove_item(item);
break;
}
else //semi bad ending!
{
MARNEY.say("You realize you don't have the scroll with you!");
MARNEY.say("She waits a moment, then shakes her head. @What an awful thing to accuse Michael of, with no proof. Please, go away. I musn't keep Michael waiting.@");
MARNEY.hide();
MICHAEL.say("@Come milady, thy ship awaits. This will be an journey you'll never forget...@");
MICHAEL.say("From behind her, he looks at you with an evil grin as he raises the anchor.");
subtractKarma(10);
gflags[MARNEY_GONE] = true; //She can be saved, but scarred for life.
//Move Renthar to High Court in Yew
RENTHAR->move_object([0675, 0521, 0]);
//Move Rinaldo in front of him:
RINALDO->move_object([0672, 0520, 0]);
UI_set_schedule_type(RINALDO, WAIT);
UI_set_item_frame(RINALDO, 0);
//make face each other:
makeNPCFaceNPC(RINALDO, RENTHAR);
makeNPCFaceNPC(RENTHAR, RINALDO);
UI_si_path_run_usecode(MARNEY, [0135, 1458, 1], 2, barge, QuentonSidequest, true);
break;
}
}
UI_remove_item(item); //delete egg
}
}
}
void timeEgg 3016()
{
if (event == EGG)
{
var hour = UI_game_hour();
var minute = UI_game_minute();
var hour_to_pass = 20 - hour;
var minute_to_pass = 59 - minute;
var n = ((hour_to_pass * 1500) + (minute_to_pass * 15));
var time_lapsed = UI_get_npc_id(RINALDO);
//determines how much time has passed since the Investigation started. If hour is past 9pm but before midnight, call
//function to create ship at docks, move Michael and Marney.
//Cleanup - if you already solved the quest good or bad, delete this egg.
if (gflags[FAILED_QUENTON_QUEST] || gflags[MARNEY_SAVED])
UI_remove_item(item);
//first, determine if it is past time, if so, delete the eggs
if (gflags[STARTED_INVESTIGATION])
{
var timer = UI_get_timer(INVESTIGATION_TIMER);
/* TODO: Fix the timer. Disabling for now since it wrecks the whole sidequest.
if ((timer > time_lapsed) || (hour < 9) && (!gflags[MARNEY_GONE] && !gflags[MARNEY_SAVED]))
{
UI_error_message("Timer ran out, called failure event. Missed the boat!");
script item
{
call QuentonSidequest, 4; //failure event
}
UI_remove_item(item);
return;
}
*/
//time is right, but hasn't triggered yet
if ((hour > 20) && (!gflags[MICHAEL_AT_DOCKS]))
{
UI_error_message("gflags MICHAEL_AT_DOCKS set. Event PREP_SHIP called.");
script item
{
call QuentonSidequest, 1; //create shipcc
}
UI_remove_item(item);
return;
}
}
}
else
return;
}
void fightMichael 3022()
{
var polite_title = getPoliteTitle();
if (event == EGG)
{
if (inParty(RENTHAR) && (gflags[MARNEY_SAVED] || gflags[MARNEY_GONE]))
{
MICHAEL.say("@You again?! You're going to pay for interfering in my business! And Renthar.. the coward who deserted the Captain's crew and lived. Let's finish what I started then..to the death!@");
RENTHAR.say("@It will be finished, but not here. You'll await the guillotine for your crimes, Michael. The Captain will meet his fate soon enough as well...@");
UI_set_alignment(MICHAEL, EVIL);
UI_set_schedule_type(MICHAEL, IN_COMBAT);
UI_remove_item(item);
return;
}
else if (gflags[FAILED_QUENTON_QUEST])
{
item.say("Michael looks up as you approach, and sneers at you.");
item.say("@Avatar, thou dost look like you've lost something. Pray tell, what is it?@");
UI_set_alignment(MICHAEL, EVIL);
UI_clear_item_flag(MICHAEL, SI_TOURNAMENT); //you can now kill him if you want.
UI_remove_item(item);
var convo = chooseFromMenu(["Marney", "nothing"]);
if (convo == "Marney")
{
say("@Don't worry about her, " + polite_title + ". She's in good hands now and fetched a fair price for my captain.@");
say("Michael pulls out a trinket and lets it dangle between his fingers... you then realize it's Marney's locket!");
say("@Renthar will be dealt with in good time as well, I can assure you that!!@");
say("Michael grins and turns away from you. @Run along Avatar, I'd like to enjoy some solitude...@");
return;
}
if (convo == "nothing")
{
say("@Well then, run along Avatar...@");
say("Michael pulls out a trinket and lets it dangle between his fingers... you then realize it's Marney's locket!");
say("He grins at you through clenched teeth.");
return;
}
UI_set_alignment(MICHAEL, EVIL);
UI_clear_item_flag(MICHAEL, SI_TOURNAMENT); //you can now kill him if you want.
UI_remove_item(item);
}
}
}

View File

@@ -0,0 +1,22 @@
void startEndgame()
{
UI_error_message("startEndgame initiated");
// freezeParty();
var party = UI_get_party_list();
for (member in party)
{
UI_set_schedule_type(member, WAIT);
}
//SendCodexToVoid(item);
script AVATAR after 3 ticks {
call SendCodexToVoid, 1;
}
//UI_path_run_usecode([2807, 2596, 1], SendCodexToVoid, AVATAR, VORTEX);
}