Initial commit
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
103
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/cutscenes/Crypts.uc
Executable file
103
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/cutscenes/Crypts.uc
Executable 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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
*/
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
}
|
||||
332
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/cutscenes/intro.uc
Executable file
332
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/cutscenes/intro.uc
Executable 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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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@");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
129
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/Eruption.uc
Executable file
129
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/Eruption.uc
Executable file
@@ -0,0 +1,129 @@
|
||||
void Eruption (var volcano)
|
||||
{
|
||||
const int SPRITE_EXPLOSION = 1;
|
||||
const int SFX_ERUPT = 60;
|
||||
const int SFX_SMOKE = 59;
|
||||
|
||||
const int SPRITE_SMOKE = 3; //from smokebomb
|
||||
var avatar_distance = UI_get_distance(egg, AVATAR);
|
||||
var volcano_location = UI_get_item_location(volcano);
|
||||
UI_error_message("Item location is" + volcano_location);
|
||||
|
||||
//determine if it explodes
|
||||
var rand = UI_get_random(100);
|
||||
UI_error_message("Volcano egg hatched: rand number is " + rand);
|
||||
|
||||
//volcano erupts
|
||||
if (rand < 35)
|
||||
{
|
||||
UI_error_message("Volcano egg: random number was " + rand + ", erupt.");
|
||||
UI_error_message("Rand num was " + rand + ", volcano erupts");
|
||||
var target;
|
||||
|
||||
rand = UI_get_random(100);
|
||||
if (rand < 50)
|
||||
{
|
||||
//determine how many npcs are neaby
|
||||
var targets = UI_find_nearby(volcano, SHAPE_ANY, 6, MASK_NPC2);
|
||||
|
||||
//exp effect
|
||||
UI_obj_sprite_effect(volcano, SPRITE_EXPLOSION, 0, 0, 0 ,0, 0, -1);
|
||||
|
||||
//play sound
|
||||
UI_play_sound_effect(SFX_ERUPT, volcano);
|
||||
UI_earthquake(1);
|
||||
|
||||
var count = 0;
|
||||
|
||||
//apply damage to targets based on how far away they were from the blast
|
||||
for (target in targets)
|
||||
{
|
||||
var target_shape = UI_get_item_shape(target);
|
||||
count += 1;
|
||||
UI_error_message("Target " + count + ", is damaged! Shape: " + target_shape);
|
||||
var target_distance = UI_get_distance(volcano, target);
|
||||
var damage_base = (50 / target_distance);
|
||||
UI_apply_damage(damage_base, 15, FIRE_DAMAGE, target);
|
||||
}
|
||||
}
|
||||
|
||||
else //volcano erupts with smoke
|
||||
{
|
||||
UI_obj_sprite_effect(volcano, SPRITE_SMOKE, 0, 0, 0 ,0, 0, -1);
|
||||
UI_play_sound_effect(SFX_SMOKE, volcano);
|
||||
UI_error_message("Volcano egg: random number was " + rand + ", just smoke.");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
UI_error_message("Volcano egg: random number was " + rand + ", do nothing.");
|
||||
}
|
||||
|
||||
|
||||
/* WORKING , but skips other random numbers (greater than 25)
|
||||
|
||||
void Eruption (var volcano)
|
||||
{
|
||||
const int SPRITE_EXPLOSION = 1;
|
||||
const int SFX_ERUPT = 60;
|
||||
const int SFX_SMOKE = 59;
|
||||
|
||||
const int SPRITE_SMOKE = 3; //from smokebomb
|
||||
var avatar_distance = UI_get_distance(egg, AVATAR);
|
||||
var volcano_location = UI_get_item_location(volcano);
|
||||
UI_error_message("Item location is" + volcano_location);
|
||||
|
||||
//determine if it explodes
|
||||
var rand = UI_get_random(100);
|
||||
UI_error_message("Volcano egg hatched: rand number is " + rand);
|
||||
|
||||
//volcano erupts
|
||||
if (rand < 25)
|
||||
{
|
||||
UI_error_message("Volcano egg: random number was " + rand + ", erupt.");
|
||||
UI_error_message("Rand num was " + rand + ", volcano erupts");
|
||||
var target;
|
||||
|
||||
|
||||
//determine how many npcs are neaby
|
||||
var targets = UI_find_nearby(volcano, SHAPE_ANY, 6, MASK_NPC2);
|
||||
|
||||
//exp effect
|
||||
UI_obj_sprite_effect(volcano, SPRITE_EXPLOSION, 0, 0, 0 ,0, 0, -1);
|
||||
|
||||
//play sound
|
||||
UI_play_sound_effect(SFX_ERUPT, volcano);
|
||||
UI_earthquake(1);
|
||||
|
||||
var count = 0;
|
||||
|
||||
//apply damage to targets based on how far away they were from the blast
|
||||
for (target in targets)
|
||||
{
|
||||
var target_shape = UI_get_item_shape(target);
|
||||
count += 1;
|
||||
UI_error_message("Target " + count + ", is damaged! Shape: " + target_shape);
|
||||
var target_distance = UI_get_distance(volcano, target);
|
||||
var damage_base = (50 / target_distance);
|
||||
UI_apply_damage(damage_base, 15, FIRE_DAMAGE, target);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if (rand >= 25 && rand <= 70) //volcano erupts with smoke
|
||||
{
|
||||
UI_obj_sprite_effect(volcano, SPRITE_SMOKE, 0, 0, 0 ,0, 0, -1);
|
||||
UI_play_sound_effect(SFX_SMOKE, volcano);
|
||||
UI_error_message("Volcano egg: random number was " + rand + ", just smoke.");
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
UI_error_message("Volcano egg: random number was " + rand + ", do nothing.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,273 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This source file contains miscellaneous array functions.
|
||||
*
|
||||
* Author: Marzo Junior
|
||||
* Last Modified: 2006-02-27
|
||||
*/
|
||||
|
||||
|
||||
//Added by DB
|
||||
//compare element with elements in array to get index of that element
|
||||
var getIndexOfMatchingElement(var array, var element_to_check)
|
||||
{
|
||||
var index = 1;
|
||||
var element;
|
||||
for (element in array)
|
||||
{
|
||||
if (element == element_to_check)
|
||||
return index;
|
||||
index += 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Returns a list of targets for friendly spells
|
||||
var getFriendlyTargetList (var caster, var dist)
|
||||
{
|
||||
if ((caster->get_npc_object()) in UI_get_party_list())
|
||||
//Caster is in the party; return party:
|
||||
return UI_get_party_list();
|
||||
else
|
||||
{
|
||||
//Caster not in party
|
||||
//Get all nearby NPCs:
|
||||
var npclist = getNearbyNonPartyNPCs(dist);
|
||||
var retlist = [];
|
||||
//Get caster's alignment:
|
||||
var align = caster->get_alignment();
|
||||
for (npc in npclist)
|
||||
//For each NPC in the list,
|
||||
if (align == npc->get_alignment())
|
||||
//Add NPC to list if align matches caster's:
|
||||
retlist = [retlist, npc];
|
||||
if (align == 0)
|
||||
//Add party to list if caster is friendly:
|
||||
retlist << UI_get_party_list();
|
||||
return retlist;
|
||||
}
|
||||
}
|
||||
|
||||
//Returns a list of targets for offensive spells
|
||||
var getEnemyTargetList (var caster, var dist)
|
||||
{
|
||||
if ((caster->get_npc_object()) in UI_get_party_list())
|
||||
//If caster in party, return all non-party NPCs:
|
||||
return getNearbyNonPartyNPCs(dist);
|
||||
else
|
||||
{
|
||||
//Caster not in party
|
||||
//Get all nearby NPCs:
|
||||
var npclist = getNearbyNonPartyNPCs(dist);
|
||||
var retlist = [];
|
||||
//Get caster's alignment:
|
||||
var align = caster->get_alignment();
|
||||
for (npc in npclist)
|
||||
//For each NPC in the list,
|
||||
if (align != npc->get_alignment())
|
||||
//Add NPC to list if align doesn't match caster's:
|
||||
retlist = [retlist, npc];
|
||||
if (align != 0)
|
||||
//Add party to list if caster is not friendly:
|
||||
retlist << UI_get_party_list();
|
||||
return retlist;
|
||||
}
|
||||
}
|
||||
|
||||
//Removes element # elemindex from the array and returns resulting array
|
||||
var removeFromArrayByIndex (var array, var elemindex)
|
||||
{
|
||||
//var count = 1;
|
||||
var retarray = [];
|
||||
|
||||
for (elem in array with index)
|
||||
if (index != elemindex)
|
||||
retarray << elem;
|
||||
return retarray;
|
||||
}
|
||||
|
||||
|
||||
//Added by DB
|
||||
var randomizeArray(var array)
|
||||
{
|
||||
var randomized_array = [];
|
||||
var array_size = UI_get_array_size([array]);
|
||||
var element;
|
||||
|
||||
var count = 1; //debug - make sure it doesn't go indefinitely
|
||||
|
||||
var rand_element = UI_get_random(array_size);
|
||||
while (array_size > 0 && count < 9)
|
||||
{
|
||||
|
||||
//put random element from array into randomized array
|
||||
randomized_array << array[rand_element];
|
||||
|
||||
//remove element from array to avoid using it twice:
|
||||
array = removeFromArrayByIndex(array, rand_element);
|
||||
|
||||
//get new array size:
|
||||
array_size = UI_get_array_size([array]);
|
||||
|
||||
//re-roll random number
|
||||
rand_element = UI_get_random(array_size);
|
||||
|
||||
//DEBUG - count is failsafe
|
||||
count += 1;
|
||||
|
||||
}
|
||||
array_size = UI_get_array_size([randomized_array]);
|
||||
UI_error_message("Array is randomized. contains " + array_size + " elements.");
|
||||
for (element in randomized_array)
|
||||
{
|
||||
UI_error_message("Virtue " + element + " is in new randomized array ");
|
||||
}
|
||||
|
||||
|
||||
return randomized_array;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Given an NPC list, returns only those with a given flag set
|
||||
var filterListByFlag(var list, var flag, var state)
|
||||
{
|
||||
var ret_list = [];
|
||||
|
||||
for (npc in list)
|
||||
if (npc->get_item_flag(flag) == state)
|
||||
ret_list << npc;
|
||||
return ret_list;
|
||||
}
|
||||
|
||||
//Given an NPC list, returns only those equiped with a given set of objects
|
||||
//in a given spot
|
||||
var filterListByEquipedObject(var list, var shapes, var spot)
|
||||
{
|
||||
var ret_list = [];
|
||||
if (UI_get_array_size(shapes) == 1)
|
||||
shapes = [shapes];
|
||||
|
||||
for (npc in list)
|
||||
if ((npc->get_readied(spot))->get_item_shape() in shapes)
|
||||
ret_list << npc;
|
||||
return ret_list;
|
||||
}
|
||||
|
||||
//Given an NPC list, returns only those hit points less than (max hps)*frac/4
|
||||
var filterListByRelHits(var list, var frac)
|
||||
{
|
||||
var ret_list = [];
|
||||
for (npc in list)
|
||||
{
|
||||
var hps = 4*npc->get_npc_prop(HEALTH);
|
||||
var str = npc->get_npc_prop(STRENGTH);
|
||||
if (hps<str*frac)
|
||||
ret_list << npc;
|
||||
}
|
||||
return ret_list;
|
||||
}
|
||||
|
||||
//Set-theoretical subtraction of sets; returns all the elements in list
|
||||
//which are not in removes
|
||||
var removeItemsFromList(var list, var removes)
|
||||
{
|
||||
var newarray = [];
|
||||
|
||||
if (UI_get_array_size(removes) > 0)
|
||||
{
|
||||
if (UI_get_array_size(removes) == 1)
|
||||
removes = [removes];
|
||||
|
||||
for (spell in list)
|
||||
if (!(spell in removes))
|
||||
newarray << spell;
|
||||
}
|
||||
else
|
||||
newarray = list;
|
||||
|
||||
return newarray;
|
||||
}
|
||||
|
||||
//Set-theoretical intersection of sets; returns all the elements in list1
|
||||
//which are also in list2
|
||||
var intersectLists(var list1, var list2)
|
||||
{
|
||||
var newarray = [];
|
||||
|
||||
if (UI_get_array_size(list2) > 0)
|
||||
{
|
||||
if (UI_get_array_size(list2) == 1)
|
||||
list2 = [list2];
|
||||
|
||||
for (spell in list1)
|
||||
if (spell in list2)
|
||||
newarray << spell;
|
||||
}
|
||||
else
|
||||
newarray = [];
|
||||
|
||||
return newarray;
|
||||
}
|
||||
|
||||
var filterBodyList(var list, var body)
|
||||
{
|
||||
var newarray = [];
|
||||
|
||||
if (UI_get_array_size(list) > 0)
|
||||
{
|
||||
for (currbody in list)
|
||||
if (currbody->get_body_npc() != body->get_body_npc())
|
||||
newarray << currbody;
|
||||
}
|
||||
else
|
||||
newarray = [];
|
||||
|
||||
return newarray;
|
||||
}
|
||||
|
||||
|
||||
//Returns a version of <array> that has <obj> stripped from it.
|
||||
var removeFromArray(var array, var obj)
|
||||
{
|
||||
var newarray = [];
|
||||
|
||||
if (UI_get_array_size(array) > 0)
|
||||
{
|
||||
for (curr in array)
|
||||
if (curr != obj)
|
||||
newarray << curr;
|
||||
}
|
||||
else
|
||||
newarray = [];
|
||||
|
||||
return newarray;
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 Alun Bestor
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This header file defines constants for shapes and frames in Black Gate's
|
||||
* SHAPES.VGA. Fill them in as you go along! It is best to use enums to group
|
||||
* shapes thematically by type and frames by shape, rather than attempting to
|
||||
* order them numerically.
|
||||
*
|
||||
* Author: Alun Bestor (exult@washboardabs.net)
|
||||
* Last Modified: 2006-03-19
|
||||
*/
|
||||
|
||||
//Item-related functions
|
||||
//----------------------
|
||||
|
||||
extern var stealItem 0x8FA(var object); //If <object> belongs to someone (i.e., does not have the OKAY_TO_TAKE flag and the party is not in a dungeon), this executes stolen-item behaviour: guards showing up, party members leaving etc.
|
||||
|
||||
extern var subtractQuantity 0x925(var object); //Remove 1 from <object>'s quantity stack. If it's quantity is at 1, or it has no quantity, this will remove the object.
|
||||
|
||||
//This will try to pathfind the avatar to <target>, which can be an object, NPC or X,Y,Z location(?).
|
||||
//<rangex> and <rangey> are arrays that define a grid of points around the object, and the Avatar will pathfind to the first unoccupied point in that grid (in the order the coordinates were defined). <rangez> I think declares an acceptable z range to pathfind to, and is usually -3.
|
||||
//if the player can get there, then they will walk there at regular speed. When they arrive in the region, <func> will be called with <context> as the item and <eventid> as the event.
|
||||
//if the player cannot get to any point in the grid it flashes the X cursor and no movement occurs.
|
||||
extern var gotoObject 0x828(var target, var rangex, var rangey, var rangez, var func, var context, var eventid);
|
||||
|
||||
//returns true if <obj> is carried by the avatar, false otherwise. Supports nested containers.
|
||||
extern var containedByAvatar 0x944(var obj);
|
||||
|
||||
//returns an item reference to the outermost container of <obj>. Used for when an object is contained several levels deep.
|
||||
extern var getOuterContainer 0x945(var obj);
|
||||
|
||||
//returns the cardinal direction <obj> lies to, relative to the Avatar.
|
||||
extern var directionFromAvatar 0x92D(var obj);
|
||||
|
||||
//Places <obj> on or near <target>, at the specified x y and z offsets from <target>'s 0 point.
|
||||
//Note: This is probably FV-only.
|
||||
extern var placeOnTarget 0x837(var obj, var target, var offset_x, var offset_y, var offset_z);
|
||||
|
||||
|
||||
// Conversation/bark-related functions
|
||||
//------------------------------------
|
||||
|
||||
//<npc> barks <line> after <delay> ticks.
|
||||
extern var delayedBark 0x933(var npc, var line, var delay);
|
||||
|
||||
extern var randomPartyBark 0x08FE(var line); //Get a random nearby party member to say <line> as a bark
|
||||
extern var randomPartySay 0x08FF(var line); //Get a random nearby party member to say <line> in conversation form
|
||||
|
||||
//returns a random party member who is nearby, or the Avatar if none can be found.
|
||||
extern var randomPartyMember 0x900();
|
||||
|
||||
extern var getAvatarName 0x0908(); //returns the name of the Avatar
|
||||
extern var getPoliteTitle 0x909(); //returns "milord" or "milady", depending on the gender of the Avatar
|
||||
|
||||
//asks a Yes/No question in a conversation; returns true/false respectively
|
||||
extern var askYesNo 0x90A();
|
||||
//takes an array of possible response options, and returns the text of the chosen option
|
||||
extern var askForResponse 0x90B(var options);
|
||||
|
||||
//Returns false if <npc> is asleep, paralysed, a moron (intelligence < 12) or unconscious (health < 0), or true otherwise.
|
||||
//This can take either an NPC constant or an object reference.
|
||||
extern var canTalk 0x937(var npc);
|
||||
|
||||
//Returns true if <npc> is nearby (according to UI_npc_nearby()) and is not invisible.
|
||||
//This can take either an NPC constant or an object reference.
|
||||
extern var isNearby 0x8F7(var npc);
|
||||
|
||||
//Returns true if <npc1> is within 20 units of <npc2>.
|
||||
//This can take either NPC constants or object references.
|
||||
extern var nearEachOther 0x8FC(var npc1, var npc2);
|
||||
|
||||
//Spouts the generic Fellowship spiel ("An organisation of spiritual seekers...") in the conversation.
|
||||
extern var askAboutFellowship 0x919();
|
||||
|
||||
//responsible for common schedule-related barks: e.g. snoring, uttering Fellowship epithets, commenting on the weather, etc. Accepts either an NPC constant or an object reference.
|
||||
extern var scheduleBarks 0x92E(var npc);
|
||||
|
||||
|
||||
//Magic-related functions
|
||||
//-----------------------
|
||||
|
||||
//returns true if there is a magic storm going on, false otherwise
|
||||
//this is used by spells to prevent magic from being cast in these zones (AFAIK, only Ambrosia)
|
||||
extern var inMagicStorm 0x906();
|
||||
|
||||
|
||||
//Script-related functions (used in script{} blocks or with UI_execute_usecode_array())
|
||||
//------------------------
|
||||
|
||||
//Puts <item> in the player's inventory, from world or container.
|
||||
//if this is not possible, it will flash the X cursor and restore the item to its original position/container.
|
||||
extern void giveToAvatar object#(0x692) ();
|
||||
|
||||
|
||||
// Miscellaneous functions
|
||||
//------------------------
|
||||
|
||||
//Gives the specified amount of experience points to every party member.
|
||||
extern var giveExperience 0x911(var exp);
|
||||
|
||||
//Shows a blocked cursor and plays the "errn" sound. All this really does is supplement UI_flash_mouse() with the sound. (Some originals use this function, some just call UI_flash_mouse directly.)
|
||||
//See constant.uc for the constants for cursor graphics.
|
||||
extern var flashBlocked 0x8FD(var cursor);
|
||||
|
||||
//stuff added by me (DB)
|
||||
//------------------------
|
||||
|
||||
extern void chantuHeal 0x860 (var price_cure, var price_heal, var price_resurrect);
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
**
|
||||
* This header file contains several more external functinos. It is mostly unsorted...
|
||||
*
|
||||
* Author: Marzo Junior
|
||||
* Last Modified: 2006-02-27
|
||||
*/
|
||||
|
||||
extern var makeSellPriceString 0x91B (var article, var itemname, var isplural, var price, var quantity_text);
|
||||
|
||||
//Prompts player for quantity of objects to sell (in units of base_quant), charges appropriate gold
|
||||
//and tries to distribute bought items to party.
|
||||
//Returns zero if the player chose that number, 2 if the party can't carry what was bought, 3 if the
|
||||
//party does not have enough gold or 1 if successful.
|
||||
//If max_quant is zero, it skips the numeric input.
|
||||
extern var sellAmountToParty 0x8F8(var shapenum, var framenum, var base_quant, var price, var max_quant, var min_quant, var unknownflag);
|
||||
|
||||
//Returns the index (1-n) of a choice the player made from the items in itemnames
|
||||
extern var chooseFromMenu2 0x90C(var itemnames);
|
||||
|
||||
//Generates a poof of smoke and associated sound:
|
||||
extern void spellFails object#(0x606) ();
|
||||
//Returns the level of npc:
|
||||
extern var getNPCLevel 0x8F6 (var npc);
|
||||
extern var absoluteValueOf 0x932 (var number);
|
||||
//Returns all non-party NPCs within dist tiles from Avatar:
|
||||
extern var getNearbyNonPartyNPCs 0x934 (var dist);
|
||||
extern var hurtNPC 0x936 (var npc, var damage);
|
||||
extern var setNonpartySchedule 0x93F (var npc, var sched);
|
||||
|
||||
//Makes an NPC stop dancing (from Dance spell):
|
||||
extern void stopDancing object#(0x688) ();
|
||||
//Stops magic storm, clears magic storm flag:
|
||||
extern void stopMagicStorm object#(0x68A) ();
|
||||
//Used by magic storm; lightning bolt falls on enemy and causes damage:
|
||||
extern void callLightning object#(0x60F) ();
|
||||
|
||||
//Sees if container has a minimum amount of a given item:
|
||||
extern var contHasItemCount 0x931 (var container, var min_count, var shapenum, var quality, var framenum);
|
||||
|
||||
//Uses a key on a door:
|
||||
extern void UseKeyOnDoor 0x815 (var Door);
|
||||
//The usecode for the door shapes:
|
||||
extern void doorHorizontal shape#(0x10E) ();
|
||||
extern void doorVertical shape#(0x178) ();
|
||||
extern void door2Horizontal shape#(0x1B0) ();
|
||||
extern void door2Vertical shape#(0x1B1) ();
|
||||
|
||||
//Moongate-related externs:
|
||||
//Plays animation where the avatar leaves a moongate:
|
||||
extern void exitMoongate object#(0x636) ();
|
||||
|
||||
//Closes a moongate created by the orb of the moons:
|
||||
extern void closeOrbMoongate 0x821 (var moongate);
|
||||
|
||||
//Returns the position where the player clicked as a respose of UI_click_on_item:
|
||||
extern var getClickPosition 0x822 (var itemref);
|
||||
//The falling-down-kneeling-over-in-pain animation when the
|
||||
//avatar gets hurt trying to cross a moongate:
|
||||
extern var badMoongateAnim 0x825 (var avatarpos, var mongatepos, var coord);
|
||||
//Returns true if the player is inside a paralelepiped which
|
||||
//contains all of Trinsic:
|
||||
extern var inGreaterTrinsicArea 0x93E ();
|
||||
|
||||
//Blacksword-related externs:
|
||||
//Fire power:
|
||||
extern void createFire object#(0x6FC) ();
|
||||
extern void teleportIsleOfFire object#(0x6F9) ();
|
||||
//Death power:
|
||||
extern void killTarget object#(0x70F) ();
|
||||
//The animation (and sound) of the daemon mirror after you
|
||||
//say "Bye" to Arcadion:
|
||||
extern void arcadionMirrorHide 0x843 ();
|
||||
extern var arcadionGemInList 0x844 (var gemlist);
|
||||
//The Power power:
|
||||
extern var replenishMana 0x845 (var isblacksword);
|
||||
extern var swordBlankAndGemInHands 0x846 ();
|
||||
//The blacksword doesn't kill corpses:
|
||||
extern var isCorpseShape 0x847 (var target_shape);
|
||||
//Forces the blacksword into the avatar's inventory:
|
||||
extern void forceGiveBlackSword object#(0x70B) ();
|
||||
extern var inIsleOfFire 0x8E7 ();
|
||||
|
||||
//Deletes container and all objects inside it:
|
||||
extern void deleteObjectAndContents 0x8E6 (var container);
|
||||
//Does... *something*... to bodies (used mainly for FoV NPCs)
|
||||
extern void makeStuffToBodies object#(0x6F7) ();
|
||||
|
||||
//Reimplemented:
|
||||
//Used by Death power to see if the blacksword deems the target to be
|
||||
//a worthy foe:
|
||||
extern var isWorthyToKill 0x848 (var target_shape);
|
||||
//The blacksword is affraid of walking corpses, and won't kill them:
|
||||
extern var isUndead 0x849 (var target_shape);
|
||||
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 Alun Bestor
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This header file defines constants for shapes and frames in Black Gate's
|
||||
* SHAPES.VGA. Fill them in as you go along! It is best to use enums to group
|
||||
* shapes thematically by type and frames by shape, rather than attempting to
|
||||
* order them numerically.
|
||||
*
|
||||
* Author: Alun Bestor (exult@washboardabs.net)
|
||||
* Last Modified: 2006-03-19
|
||||
*/
|
||||
|
||||
//Who the player has met. BG used global flags for this because the MET item flag didn't originally exist.
|
||||
enum met_flags
|
||||
{
|
||||
MET_LORD_BRITISH = 0x98,
|
||||
MET_FINNIGAN = 0x4C,
|
||||
MET_NYSTUL = 0x99,
|
||||
MET_CHUCKLES = 0x9A,
|
||||
MET_CANDICE = 0xAA,
|
||||
MET_WILLY = 0xB5,
|
||||
MET_GORDON = 0xBB,
|
||||
MET_CSIL = 0xA4,
|
||||
|
||||
MET_JULIA = 0x1B,
|
||||
MET_GLADSTONE = 0x110,
|
||||
|
||||
MET_CAMILLE = 0x22A,
|
||||
|
||||
MET_MENION = 0x269,
|
||||
MET_HORFFE = 0x26E,
|
||||
MET_TORY = 0x271,
|
||||
|
||||
MET_ELAD = 0x204,
|
||||
|
||||
MET_LEIGH = 0x272,
|
||||
|
||||
MET_INMANILEM = 0x247,
|
||||
|
||||
MET_CHANTU = 0x52
|
||||
};
|
||||
|
||||
//Flags used by the starting murder investigation quest
|
||||
enum trinsic_murder_flags
|
||||
{
|
||||
GOT_CHRISTOPHERS_KEY = 0x3C,
|
||||
GOT_TRINSIC_PASSWORD = 0x3D,
|
||||
NEEDS_TRINSIC_PASSWORD = 0x42,
|
||||
UNLOCKED_CHRISTOPHERS_CHEST = 0x3E,
|
||||
|
||||
KNOWS_ABOUT_CHRISTOPERS_ARGUMENT = 0x3F,
|
||||
REFUSED_MURDER_INVESTIGATION = 0x59,
|
||||
EXPECTED_TO_LOOK_IN_STABLES = 0x5A,
|
||||
REPORTED_CHRISTOPHERS_KEY = 0x48,
|
||||
CAN_GIVE_MURDER_REPORT = 0x5B,
|
||||
STARTED_MURDER_REPORT = 0x5D,
|
||||
LEARNED_ABOUT_CROWN_JEWEL = 0x40,
|
||||
LEARNED_ABOUT_HOOK = 0x43,
|
||||
FINISHED_MURDER_INVESTIGATION = 0x44,
|
||||
WAITING_FOR_INVESTIGATION_PAYMENT = 0x45
|
||||
};
|
||||
|
||||
//Broken the tetrahedron generator that screws up magic. This affects most conversations with wizards.
|
||||
const int BROKE_TETRAHEDRON = 0x03;
|
||||
const int BROKE_CUBE = 0x04;
|
||||
const int ORB_FIXED_TIMELORD = 0x134;
|
||||
|
||||
//Used the armageddon spell
|
||||
const int CAST_ARMAGEDDON = 0x1E;
|
||||
|
||||
|
||||
//Flags used in conversation with Lord British
|
||||
enum lb_conversation_flags
|
||||
{
|
||||
WESTON_FREED = 0xCC,
|
||||
AGREED_TO_FREE_WESTON = 0xCD,
|
||||
GOT_ORB = 0xDD,
|
||||
ASKED_LB_ABOUT_MAGIC = 0x66,
|
||||
LEARNED_ABOUT_BRITAIN_MURDER = 0xD1, //allows you to ask Patterson about it
|
||||
ASKED_LB_ABOUT_HEAL = 0xD3,
|
||||
LEARNED_ABOUT_BLACKROCK = 0x65, //allows you to ask Rudyom about it?
|
||||
ASKED_LB_ABOUT_GUARDIAN = 0xD4, //stops you ever asking him again (yes, plaster over those plot-holes)
|
||||
LB_REWARDED_FOR_FV = 0x30D //Received Lord British's reward for completing the Forge of Virtue
|
||||
};
|
||||
|
||||
//Flags used in conversation with Julia
|
||||
enum julia_conversation_flags
|
||||
{
|
||||
ASKED_JULIA_TO_LEAVE = 0x101,
|
||||
JULIA_IN_PARTY = 0x108,
|
||||
ASKED_JULIA_ABOUT_SPARK = 0x121
|
||||
};
|
||||
|
||||
//Flags used in Minoc conversations to do with the sawmill murder
|
||||
enum minoc_murder_flags
|
||||
{
|
||||
LEARNED_ABOUT_MINOC_MURDER = 0x11F
|
||||
};
|
||||
|
||||
//Flags used by the Owen's Monument quest
|
||||
enum owen_monument_flags
|
||||
{
|
||||
COMPLETED_OWENS_QUEST = 0xF7,
|
||||
LEARNED_ABOUT_PLANS = 0x10B,
|
||||
OWENS_PLANS_ARE_UNSAFE = 0xFD
|
||||
};
|
||||
|
||||
//Batlin has buggered off (after you talk to him with the cube in your possession)
|
||||
const int BATLIN_MISSING = 0xDA;
|
||||
|
||||
//Heard that Patterson is having an affair with Candice
|
||||
const int HEARD_ABOUT_PATTERSONS_AFFAIR = 0x80;
|
||||
|
||||
//Heard about the Inner Voice
|
||||
const int HEARD_ABOUT_VOICE = 0x8C;
|
||||
|
||||
const int JEANETTE_LOVES_WILLY = 0x85; //heard about Jeanette's crush on Willy the Baker
|
||||
const int HIRED_BY_WILLY = 0xCB; //hired by Willy to bake bread
|
||||
|
||||
//Miscellaneous flags for NPCs in Paws
|
||||
enum paws_flags
|
||||
{
|
||||
HEARD_ABOUT_PAWS_THEFT = 0x212, //Heard from an NPC about the theft
|
||||
TOBIAS_ACCUSED = 0x213, //Feridwyn accused Tobias of the theft
|
||||
SOLVED_PAWS_THEFT = 0x218, //Found Garritt was the thief
|
||||
HEARD_CAMILLES_DEFENSE = 0x234, //Camille has run out to say that her son is innocent of the theft (prevents conversation recurring)
|
||||
GOT_CAMILLES_WHEAT = 0x21A, //Given the wheat by Camille (prevents her offering it again)
|
||||
DELIVERED_CAMILLES_WHEAT = 0x21D //Delivered the wheat to Thurston (so you don't get paid for it twice)
|
||||
};
|
||||
|
||||
enum serpents_hold_flags
|
||||
{
|
||||
STARTED_HOLD_INVESTIGATION = 0x25E, //Got the mission from John-Paul to find who defaced the statue
|
||||
FINISHED_HOLD_INVESTIGATION = 0x261, //Finished the statue investigation properly, pinning Sir Pendaran as the culprit
|
||||
HEARD_ABOUT_RIKY = 0x277, //Heard that Tory's baby son was kidnapped by harpies
|
||||
RESCUED_RIKY = 0x278 //Player has rescued Riky (prevents conversation from coming up again)
|
||||
};
|
||||
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This header file contains several more flags from Black Gate.
|
||||
* It is mostly unsorted... although generally grouped by similarity.
|
||||
*
|
||||
* Author: Marzo Junior
|
||||
* Last Modified: 2006-02-27
|
||||
*/
|
||||
|
||||
//FoV flags:
|
||||
enum fov_flags
|
||||
{
|
||||
TALKED_ABOUT_RUMBLE = 0x02FE,
|
||||
BANISHED_EXODUS = 0x030C,
|
||||
SCROLL_OF_INFINITY = 0x030E,
|
||||
MET_ERETHIAN = 0x0310,
|
||||
MET_ARCADION = 0x0313,
|
||||
BROKE_MIRROR = 0x032F,
|
||||
COMMANDED_BOND = 0x0330,
|
||||
REFUSED_HELP_ARCADION = 0x0331,
|
||||
HELPING_ARCADION = 0x0332,
|
||||
TALKED_ARCADION_WITH_GEM = 0x0333,
|
||||
ACCEPTED_GEM_POWER = 0x0333,
|
||||
ARCADION_SLAVE = 0x0334,
|
||||
REFUSED_GEM_POWER = 0x0335,
|
||||
FINISHED_BLADE_FORGING = 0x0337,
|
||||
TALKED_ABOUT_BINDING_GEM = 0x0338
|
||||
// Flags from the original which are unused in the mod:
|
||||
//BEGIN_BOND = 0x0343,
|
||||
//FINISHED_BOND = 0x0344
|
||||
};
|
||||
|
||||
//Some Cove flags:
|
||||
enum cove_flags
|
||||
{
|
||||
MET_JAANA = 0x0018,
|
||||
ASKED_JAANA_NAME = 0x00EF,
|
||||
KNOWS_COVE_GOSSIP = 0x00E4,
|
||||
KNOWS_JAANA_IS_HEALER = 0x0028,
|
||||
HEARD_ABOUT_NATASSIA = 0x00E0,
|
||||
HAS_MIRANDAS_BILL = 0x006A,
|
||||
MET_LORD_HEATHER = 0x00EA,
|
||||
KNOWS_DEMARIA_KNOWS = 0x00E3,
|
||||
LOCK_LAKE_BILL_SIGNED = 0x00DE
|
||||
};
|
||||
|
||||
enum serpent_hold_flags
|
||||
{
|
||||
KNOWS_LEIGH_IS_HEALER = 0x027A,
|
||||
CAN_EXAMINE_STONE_CHIPS = 0x0259,
|
||||
DOING_STATUE_QUEST = 0x025E,
|
||||
EXAMINED_CHIPS = 0x025F
|
||||
};
|
||||
|
||||
enum terfin_flags
|
||||
{
|
||||
KNOWNS_ABOUT_CONFLICTS = 0x0244,
|
||||
KNOWS_SILAMO_UNHAPPY = 0x023D
|
||||
};
|
||||
|
||||
//Some metaplot-related flags:
|
||||
enum metaplot_flags
|
||||
{
|
||||
DID_FIRST_SCENE = 59, //0x03b;
|
||||
TALKED_TO_GYPSY = 256, //0x100;
|
||||
HAD_FIRST_WISP_TALK = 336, //0x150;
|
||||
WISP_OFFERED_TRADE = 307, //0x133;
|
||||
DELIVERED_NOTEBOOK_TO_WISPS = 343, //0x157;
|
||||
LEARNED_ABOUT_ALIGNMENT = 295 //0x127
|
||||
};
|
||||
|
||||
//Flags used in the Improved Orb of the Moons:
|
||||
enum orb_flags
|
||||
{
|
||||
BROKE_SPHERE = 4, //0x0004
|
||||
LEFT_TRINSIC = 87 //0x0057
|
||||
};
|
||||
|
||||
//Some Yew flags, used in reimplementation of Perrin and Reyna
|
||||
//for the end of the Keyring Quest:
|
||||
enum yew_flags
|
||||
{
|
||||
MET_PERRIN = 0x0145,
|
||||
KNOWS_REYNA_LOVES_ANIMALS = 0x013B,
|
||||
MET_REYNA = 0x0146,
|
||||
ASKED_REYNA_ABOUT_MOTHER = 0x0128,
|
||||
KNOWS_REYNA_JOB = 0x0163,
|
||||
REYNA_EMERGENCY = 0x013A,
|
||||
GAVE_REYNA_FLOWERS = 0x0139
|
||||
};
|
||||
|
||||
const int MET_MARIAH = 0x01FB;
|
||||
|
||||
//Set when the Magic Storm spell is cast:
|
||||
const int MAGIC_STORM_SPELL = 0x02ED;
|
||||
|
||||
//Prevents casting of spells because the Avatar is inside
|
||||
//one of the generators:
|
||||
const int INSIDE_GENERATOR = 0x39;
|
||||
|
||||
//Seance flags; I have NO idea why they didn't go with just
|
||||
//ONE flag instead...
|
||||
enum seance_flags
|
||||
{
|
||||
SEANCE_CAINE = 0x01B2,
|
||||
SEANCE_FERRYMAN = 0x01B3,
|
||||
SEANCE_MARKHAM = 0x01B4,
|
||||
SEANCE_HORANCE = 0x01B5,
|
||||
SEANCE_TRENT = 0x01B6,
|
||||
SEANCE_MORDRA = 0x01B7,
|
||||
SEANCE_ROWENA = 0x01B8,
|
||||
SEANCE_PAULETTE = 0x01B9,
|
||||
SEANCE_QUENTON = 0x01BA,
|
||||
SEANCE_FORSYTHE = 0x01BB
|
||||
};
|
||||
446
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/bg_npcs.uc
Executable file
446
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/bg_npcs.uc
Executable file
@@ -0,0 +1,446 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 Alun Bestor
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This header file defines constants for shapes and frames in Black Gate's
|
||||
* SHAPES.VGA. Fill them in as you go along! It is best to use enums to group
|
||||
* shapes thematically by type and frames by shape, rather than attempting to
|
||||
* order them numerically.
|
||||
*
|
||||
* Author: Alun Bestor (exult@washboardabs.net)
|
||||
* Last Modified: 2006-03-19
|
||||
*/
|
||||
|
||||
//Party members (you know em, you love em)
|
||||
enum party_members
|
||||
{
|
||||
PARTY = -357, //Used by several intrinsics (e.g. UI_count_objects) that would otherwise take a single NPC
|
||||
//Not supported by several other intrinsics that you'd really like it to (e.g. UI_get_cont_items)
|
||||
AVATAR = -356,
|
||||
IOLO = -1,
|
||||
SPARK = -2,
|
||||
SHAMINO = -3,
|
||||
DUPRE = -4,
|
||||
JAANA = -5,
|
||||
SENTRI = -7,
|
||||
JULIA = -8,
|
||||
KATRINA = -9,
|
||||
TSERAMED = -10
|
||||
};
|
||||
|
||||
//Trinsic residents
|
||||
enum trinsic_npcs
|
||||
{
|
||||
PETRE = -11, //stablekeeper
|
||||
|
||||
|
||||
FINNIGAN = -12, //mayor
|
||||
|
||||
MOLE = -13,
|
||||
|
||||
GLEN = -14,
|
||||
|
||||
|
||||
CHANTU = -17, //healer
|
||||
LENORA = -18,
|
||||
APOLLONIA = -19, //barmaid
|
||||
UTOMO = -20, //
|
||||
GARGAN = -21, //shipwright
|
||||
CAROLINE = -22, //fellowship recruiter
|
||||
|
||||
PAUL = -233, //Passion Play actor
|
||||
MERYL = -234, //Passion Play actress
|
||||
DUSTIN = -235, //Passion Play actor
|
||||
|
||||
ELLEN = -236 //wife of Klog
|
||||
};
|
||||
|
||||
//Britain residents
|
||||
enum britain_npcs
|
||||
{
|
||||
LORD_BRITISH = -148, //Castle British, ineffectual monarch
|
||||
NYSTUL = -139, //Castle British, royal sage
|
||||
CHUCKLES = -262, //Castle British, royal jester
|
||||
BATLIN = -26, //arch-villain
|
||||
BLAINE = -27, //
|
||||
PEYTON = -25, // Britain Innkeeper
|
||||
JESSE = -28, //actor
|
||||
STUART = -29, //actor
|
||||
AMBER = -30, //actress and Shamino's main squeeze
|
||||
DAVER = -31, //
|
||||
MAX = -32, //Castle British, creche child
|
||||
NICHOLAS = -33, //Castle British, creche child
|
||||
NANNA = -34, //Castle British, childcare professional and champion of the working class
|
||||
GEOFFREY = -35, //healer and molecular biologist
|
||||
ZELLA = -36, //trainer
|
||||
LUCY = -37, //barmaid and owner of the Blue Boar
|
||||
GREG = -38, //provisioner
|
||||
NENO = -39, //musician
|
||||
JUDITH = -40, //musician and wife of Patterson
|
||||
CANDICE = -41, //museum curator and mistress of Patterson
|
||||
CYNTHIA = -42, //treasurer and wife of James
|
||||
PATTERSON = -43, //mayor and philanderer
|
||||
ZOLTAN = -44, //
|
||||
KARINA = -45, //orchard owner
|
||||
JAMES = -46, //innkeeper
|
||||
JEANETTE = -47, //barmaid at the Blue Boar and courter of Charles and Willy (make up your mind you silly woman)
|
||||
WANDA = -49, //gypsy slut
|
||||
RINALDO = -50,
|
||||
|
||||
WILLY = -52, //baker and total knob
|
||||
ARTUROS = -53, //seamstress
|
||||
ANDREAS = -54, //arms dealer at Iolo's Bows
|
||||
GRAYSON = -55, //arms dealer
|
||||
DIANE = -56, //stablekeeper
|
||||
CLINT = -57, //shipwright
|
||||
GORDON = -58, //fish and chipper
|
||||
JERRIS = -59, //jeweller
|
||||
BROWNIE = -60, //farmer and mayoral incumbent
|
||||
MACK = -61, //farmer and Kilrathi witness
|
||||
SNAZ = -62, //beggar and irritant
|
||||
CULHAM = -63, //fellowship recruiter and sister of Thad
|
||||
|
||||
blank = -64, //Castle British, captain of the guard and useless ex-follower
|
||||
LYSSANDRA = -65, //Castle British, council member and gargoyle representative
|
||||
SHERRY = -6,
|
||||
STELNAR = -67,
|
||||
VANKELLIAN = -66,
|
||||
NOMAAN = -68, //Castle British, head servant and husband of Boots
|
||||
WESTON = -69, //Castle British, prisoner and husband of Alina
|
||||
MIRANDA = -70, //Castle British, council leader
|
||||
INWISLOKLEM = -71, //Castle British, council member and gargoyle representative
|
||||
NELL = -72, //Castle British, servant, sister of Charles, and secret lover of at least Carrocio and Lord British (slut)
|
||||
CHARLES = -73, //Castle British, servant, brother of Nell and courter of Jeanette
|
||||
|
||||
KESSLER = -237 //apothecary
|
||||
};
|
||||
|
||||
//Cove residents
|
||||
enum cove_npcs
|
||||
{
|
||||
RUDYOM = -74, //mad mage
|
||||
LORD_HEATHER = -77, //mayor and Jaana's main squeeze
|
||||
PAMELA = -78, //inkeeper and Rayburt's main squeeze
|
||||
ZINAIDA = -79, //tavernkeeper and de Maria's main squeeze
|
||||
SANDY = -80,
|
||||
REGAL = -271 //Rayburt's dog (not sure why he gets an NPC number, it's not like he does anything - maybe for schedules?)
|
||||
};
|
||||
|
||||
//Minoc residents
|
||||
enum minoc_npcs
|
||||
{
|
||||
WHITSABER = -81, //fellowship leader and secret lover of Gregor
|
||||
LAWRENCE = -82, //mine owner and secret lover of Elynor
|
||||
BRANDON = -83, //smith
|
||||
IMMANUELLE = -84, //horse woman
|
||||
HAROLD = -85, //smith
|
||||
TOBATHA = -86, //cranky woman
|
||||
GWENNO = -87, //party
|
||||
SEARA = -88, //artisan
|
||||
TARA = -89, //Minoc healer
|
||||
OWEN = -90, //shipwright and tosser
|
||||
BURNSIDE = -91, //mayor
|
||||
RUTHERFORD = -92, //barkeep
|
||||
BLANK = -93, //sawmill operator
|
||||
KARENNA = -94, //trainer
|
||||
JAKHER = -95, //trainer
|
||||
DORIS = -96, //innkeeper
|
||||
|
||||
MIKOS = -97, //mine foreman
|
||||
FODUS = -99, //miner and drug addict
|
||||
OWINGS = -239, //miner and moron
|
||||
MALLOY = -243 //miner and moron
|
||||
};
|
||||
|
||||
//Yew/great forest residents
|
||||
enum yew_npcs
|
||||
{
|
||||
|
||||
KADOR = -98, //emp
|
||||
TAVENOR = -100, //emp
|
||||
SALAMON = -101, //emp
|
||||
NICODEMUS = -102, //mad mage
|
||||
THAD = -103, //highwayman and brother of Millie
|
||||
MANDRAKE = -104, //trainer
|
||||
SIR_JEFF = -105, //judge
|
||||
TIERY = -106, //gravedigger and creep
|
||||
REYNA = -108, //healer
|
||||
GHARL = -111, //troll prisoner
|
||||
D_REL = -112, //pirate and prisoner
|
||||
SMITH = -113, //horse and hintbook
|
||||
AIMI = -114, //monk, gardener and crap painter
|
||||
PENNI = -115, //trainer and wife of Addom
|
||||
BEN = -116, //woodcutter
|
||||
GOTH = -117, //prison warden
|
||||
PERRIN = -238, //scholar and trainer
|
||||
TAYLOR = -242, //monk
|
||||
KREG = -245, //fugitive and false monk
|
||||
|
||||
PAPA = -241, //Bee Caves, nudist
|
||||
GENERICSHRINE = -255, //Bee Caves, nudist
|
||||
|
||||
XORINIA = -256 //will-o-wisp
|
||||
};
|
||||
|
||||
//Jhelom residents
|
||||
enum jhelom_npcs
|
||||
{
|
||||
DE_SNEL = -119, //trainer
|
||||
JOSEPH = -120, //mayor
|
||||
KLIFTIN = -121, //armourer
|
||||
OPHELIA = -122, //barmaid
|
||||
DAPHNE = -123, //barmaid
|
||||
SPRELLIC = -124, //tavern owner and wimp
|
||||
VOKES = -125, //big dumb fighter
|
||||
SYRIA = -126, //fighter
|
||||
TIMMONS = -127 //fighter
|
||||
};
|
||||
|
||||
//New Magincia residents
|
||||
enum new_magincia_npcs
|
||||
{
|
||||
RUSSELL = -129, //shipwright
|
||||
DUNBAR = -130, //tavernkeeper
|
||||
MAGENTA = -131, //mayor and wife of Boris
|
||||
HENRY = -132, //courter of Constance and pathetic sap
|
||||
CHARLOTTE = -133, //
|
||||
ANTONIO = -134, //mayor
|
||||
AURENDIR = -135, //
|
||||
CONOR = -136, //most humble
|
||||
WILLIAM = -137, //
|
||||
ALAGNER = -146 //scholar and plot device
|
||||
};
|
||||
|
||||
//Skara Brae residents
|
||||
enum skara_brae_npcs
|
||||
{
|
||||
GIDEON = -140, //
|
||||
HORANCE = -141, //
|
||||
TRENTON = -142, //
|
||||
DEZANA = -143, //
|
||||
MARTA = -144, //
|
||||
YORL = -145, //
|
||||
QUENTON = -146, //
|
||||
STIVIUS = -147, //
|
||||
MARNEY = -75, //
|
||||
MICHAEL = -76
|
||||
|
||||
};
|
||||
|
||||
//U6 PAWS
|
||||
enum Paws_npcs
|
||||
{
|
||||
|
||||
THINDLE = -117, //
|
||||
MORTUDE = -118, //
|
||||
MARISSA = -119, //
|
||||
ARBETH = -120, //
|
||||
GRISON = -121, //
|
||||
DORIN = -122, //
|
||||
MERIDETH = -123, //
|
||||
HENDLE = -124, //
|
||||
UBERMON = -125, //
|
||||
TIMOTHY = -126, //
|
||||
DR_CAT = -127, //
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PENUMBRA = -150, //sleeping seeress
|
||||
ZELDA = -152, //Lycaeum, advisor and courter of Brion
|
||||
MARIAH = -153, //Lycaeum, mad mage and former companion
|
||||
CUBOLT = -155, //farmer
|
||||
AGANAR = -156, //
|
||||
MANREL = -157, //
|
||||
MORZ = -158, //f-f-f-farmer
|
||||
JILLIAN = -159, //Lycaeum, scholar, trainer and husband of Effrem
|
||||
EFFREM = -160, //househusband of Jillian
|
||||
CHAD = -161, //trainer
|
||||
ELAD = -162, //healer
|
||||
PHEARCY = -163, //tavernkeeper
|
||||
DERYDLUS = -154, //
|
||||
ADDOM = -164, //explorer and husband of Penni
|
||||
FRANK = -165, //Lycaeum, smartarse fox
|
||||
BRION = -248, //Lycaeum, astronomer
|
||||
NELSON = -249, //Lycaeum, curator
|
||||
HOLDERGUY = -250 // Holder guy
|
||||
};
|
||||
|
||||
//Paws residents
|
||||
enum paws_npcs
|
||||
{
|
||||
THURSTON = -166, //miller and courter of Polly
|
||||
FERIDWYN = -167, //fellowship shelter manager, father of Garritt and husband of Brita
|
||||
BRITA = -168, //snotty narrowminded bitch, mother of Garritt and wife of Feridwyn
|
||||
ALINA = -169, //useless poor person and wife of Weston
|
||||
MERRICK = -170, //sycophant and Fellowship shill
|
||||
GARRITT = -171, //drug abuser and insufferable offspring of Feridwyn and Brita
|
||||
MORFIN = -172, //slaughterhouse owner and drug dealer
|
||||
BEVERLEA = -173, //curio shop owner and blind old bat
|
||||
KOMOR = -174, //embittered beggar with one leg
|
||||
FENN = -175, //embittered cart-bound beggar with no legs
|
||||
ANDREW = -176, //dairy owner
|
||||
CAMILLE = -177, //farmer, widow and mother of Tobias
|
||||
TOBIAS = -178, //obnoxious son of Camille
|
||||
POLLY = -179 //tavernkeeper and courter of Thurston
|
||||
};
|
||||
|
||||
//Terfin residents
|
||||
enum terfin_npcs
|
||||
{
|
||||
DRAXINUSOM = -180, //king of the Gargoyles
|
||||
|
||||
SIN_VRAAL = -181, //
|
||||
|
||||
NAXATILOR = -182, //Seer
|
||||
INMANILEM = -182, //healer
|
||||
TEREGUS = -183, //keeper of altars
|
||||
RUNEB = -184, //fellowship thug
|
||||
QUAN = -185, //fellowship leader
|
||||
QUAEVEN = -186, //Rec Center master and fellowship follower
|
||||
SILAMO = -187, //gardener
|
||||
SARPLING = -188, //jeweller and magic provisioner
|
||||
FORBRAK = -189, //tavernkeeper
|
||||
BETRA = -190 //provisioner
|
||||
};
|
||||
|
||||
//residents of the U.S.S. Serpent's Hold
|
||||
enum serpents_hold_npcs
|
||||
{
|
||||
MENION = -192, //trainer and weaponsmith
|
||||
PENDARAN = -193, //knight, saboteur and husband of Jehanne
|
||||
JEHANNE = -194, //provisioner and wife of Pendaran
|
||||
JOHNE_PAUL = -195, //lord and leader
|
||||
RICHTER = -196, //armourer and fellowship member
|
||||
VALKADESH = -197, //Beh Lem's father
|
||||
JORDAN = -198, //blind arms dealer for Iolo's South who can't even recognise his own boss
|
||||
DENTON = -199, //bartender, logician, and particularly lame Star Trek reference
|
||||
TORY = -200, //empath and unconvincingly distraught mother of baby Riky, stolen by dingos (er, harpies)
|
||||
LEIGH = -201 //healer
|
||||
};
|
||||
|
||||
//Vesper residents
|
||||
enum vesper_npcs
|
||||
{
|
||||
CADOR = -203, //mine overseer
|
||||
MARA = -204, //miner
|
||||
ZAKSAM = -205, //trainer
|
||||
ELDROTH = -206, //provisioner
|
||||
YONGI = -207, //tavernkeeper
|
||||
BLORN = -208, //criminal
|
||||
AUSTON = -209, //mayor
|
||||
LIANA = -210, //mayor's clerk and total bigot
|
||||
LAP_LEM = -211, //gargoyle miner
|
||||
YVELLA = -212, //mother of Catherine and wife of Cador
|
||||
CATHERINE = -213, //daughter of Yvella and Cador, student of For-Lem
|
||||
FOR_LEM = -214, //gargoyle handyman and teacher of Catherine
|
||||
ANSIKART = -215, //gargoyle tavernkeeper
|
||||
WIS_SUR = -216, //gargoyle magic provisioner
|
||||
ANMANIVAS = -217, //gargoyle ex-miner
|
||||
FORANAMO = -218, //gargoyle ex-miner
|
||||
AURVIDLEM = -219 //provisioner
|
||||
};
|
||||
|
||||
//Buccaneer's Den residents
|
||||
enum buccaneers_den_npcs
|
||||
{
|
||||
PETROPH = -220, //fellowship prisoner and conman
|
||||
LEODON = -221, //pirate companion
|
||||
HOMER = -222, //manager of the Baths
|
||||
LEONNA = -223, //pirate companion
|
||||
CAPTAIN_FOX = -224, //pirate
|
||||
SHAWN = -225, //cook
|
||||
CAPTAIN_ELAD = -226, //ex-pirate
|
||||
JOHANN = -227, //ex-pirate
|
||||
LUCKY = -228, //trainer
|
||||
BUDO = -229, //provisioner
|
||||
GORDY = -230, //House of Games owner
|
||||
MANDY = -231, //innkeeper
|
||||
SEGGALLION = -232, //
|
||||
DANAG = -251, //fellowship leader
|
||||
|
||||
|
||||
AMANDA = -240 //barkeep
|
||||
};
|
||||
|
||||
//Miscellaneous NPCs (dungeons and other minor locations)
|
||||
enum misc_npcs
|
||||
{
|
||||
BEHLEM = -191, // Beh Lem
|
||||
|
||||
IRIALE = -128, //Fellowship Retreat, guardian of the Cube
|
||||
IAN = -202, //Fellowship Retreat, director
|
||||
GORN = -138, //Fellowship Retreat, recurring cameo from long-forgotten Origin game
|
||||
|
||||
WAYNE = -109, //Dungeon Despise, lost monk
|
||||
GAROK = -110, //Dungeon Despise, mad mage and tax fugitive
|
||||
|
||||
ANDREA = -15, //Dagger Isle, vengeful half-sister of Amanda
|
||||
poop = -48, //Dagger Isle, vengeful half-sister of Eiko
|
||||
ISKANDER = -107, //Dagger Isle, cyclops and target of Eiko and Amanda's vengeance
|
||||
|
||||
HYDRA = -149, //Ambrosia, three-headed hydra, guardian of meteor
|
||||
KISSME = -151, //Ambrosia, horny faerie
|
||||
|
||||
CAIRBRE = -244, //Dungeon Destard, friend of Cosmo
|
||||
KALLIBRUS = -252, //Dungeon Destard, friend of Cosmo
|
||||
COSMO = -253, //Dungeon Destard, virgin
|
||||
LASHER = -254, //Dungeon Destard, unicorn and virgin-detector
|
||||
|
||||
HOOK = -291, //Isle of the Avatar, arch-villain
|
||||
FORSKIS = -298, //Isle of the Avatar, arch-villain
|
||||
LAURIANNA = -299, //Isle of the Avatar, arch-villain
|
||||
CSIL= -300 //Isle of the Avatar, arch-villain
|
||||
};
|
||||
|
||||
enum intro_npcs
|
||||
{
|
||||
GARGTHUG1 = -264,
|
||||
GARGBYSTANDER1 = -299,
|
||||
GARGBYSTANDER2 = -300,
|
||||
GARGBYSTANDER3 = -301,
|
||||
GARGBYSTANDER4 = -302,
|
||||
GARGTHUG2 = -265,
|
||||
GARGTHUG3 = -266,
|
||||
GARGTHUG4 = -267,
|
||||
GARGPRIEST = -263,
|
||||
DEADGARG1 = -268,
|
||||
GARGTHUG5 = -278,
|
||||
GARGTHUG6 = -279,
|
||||
DEADGARG2 = -269
|
||||
};
|
||||
|
||||
enum junk_npcs
|
||||
{
|
||||
WRONG = -272, //clone_alagner
|
||||
BLANKDUNGEON = -273
|
||||
};
|
||||
|
||||
enum misc_npcs
|
||||
{
|
||||
|
||||
THUG1 = -254,
|
||||
THUG2 = -292,
|
||||
THUG3 = -289,
|
||||
THUG4 = -288,
|
||||
THUG5 = -280,
|
||||
THUG6 = -270,
|
||||
PALACE_GUARD1 = -16,
|
||||
PALACE_GUARD2 = -51
|
||||
};
|
||||
@@ -0,0 +1,427 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 Alun Bestor
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This header file defines constants for shapes and frames in Black Gate's
|
||||
* SHAPES.VGA. Fill them in as you go along! It is best to use enums to group
|
||||
* shapes thematically by type and frames by shape, rather than attempting to
|
||||
* order them numerically.
|
||||
*
|
||||
* Author: Alun Bestor (exult@washboardabs.net)
|
||||
* Last Modified: 2006-03-19
|
||||
*/
|
||||
|
||||
//Shapes
|
||||
//------
|
||||
|
||||
//Shapes used by NPCs (ones that will talk to you and have schedules). Note that there's a bit of confusion between this and monster_shapes since some NPCs have the monster flag (even though they are human).
|
||||
//Also note that some of these are duplicated to make 'monster' versions - you can find those in monster_shapes below.
|
||||
enum npc_shapes
|
||||
{
|
||||
//NPCs with unique appearances
|
||||
SHAPE_MALE_AVATAR = 721,
|
||||
SHAPE_FEMALE_AVATAR = 989,
|
||||
SHAPE_FERRYMAN = 155, //Doom Scythe is built into shape, unlike FERRYMAN2
|
||||
SHAPE_FERRYMAN2 = 952, //Actually this version is a monster...not sure which actually got used
|
||||
SHAPE_ALAGNER = 227,
|
||||
SHAPE_PAPA = 228,
|
||||
SHAPE_MAMA = 229,
|
||||
SHAPE_UNICORN = 375,
|
||||
SHAPE_KISSME = 382,
|
||||
SHAPE_FAIRY = 382,
|
||||
SHAPE_BATLIN = 403,
|
||||
SHAPE_BATLIN2 = 482, //Not sure which is the Real Batlin and which is the clone
|
||||
|
||||
SHAPE_IOLO = 465,
|
||||
SHAPE_SHAMINO = 487,
|
||||
SHAPE_DUPRE = 488,
|
||||
SHAPE_SPARK = 489,
|
||||
SHAPE_JAANA = 490,
|
||||
|
||||
SHAPE_LORD_BRITISH = 466,
|
||||
SHAPE_SMITH = 476, //Smith the Horse
|
||||
SHAPE_FRANK = 477, //Frank the Fox
|
||||
SHAPE_SHERRY = 478, //Sherry the Mouse
|
||||
SHAPE_DRAXINUSOM = 480, //Sherry the Mouse
|
||||
|
||||
SHAPE_HOOK = 506, //Hook is a monster, yet Forskis isn't. Huh.
|
||||
SHAPE_FORSKIS = 805,
|
||||
SHAPE_ELIZABETH = 881,
|
||||
SHAPE_ABRAHAM = 882,
|
||||
|
||||
SHAPE_EMP = 479, //There's also a monster emp, SHAPE_MONSTER_EMP. Could be this one is Saralek, and the monster one is everyone else
|
||||
SHAPE_TROLL = 861, //Not to be confused with monster trolls, this one is used for the troll jailer and troll prisoner
|
||||
|
||||
SHAPE_CYCLOPS = 380, //Friendly Cyclops, not monster cyclops (probably Iskender)
|
||||
SHAPE_WISP = 534,
|
||||
|
||||
//Gargoyle shapes
|
||||
SHAPE_GARGOYLE_FLYING = 226, //Never used AFAIK
|
||||
SHAPE_GARGOYLE_WINGED = 274,
|
||||
SHAPE_GARGOYLE_WARRIOR = 274, //White straps across torso
|
||||
SHAPE_GARGOYLE_NOBLE = 473, //Circlet on head
|
||||
SHAPE_GARGOYLE_WORKER = 475, //No wings
|
||||
SHAPE_GARGOYLE_WINGLESS = 475,
|
||||
|
||||
//While these have the MONSTER flag, they are only used as NPCs AFAIK
|
||||
SHAPE_GHOST_FEMALE = 299,
|
||||
SHAPE_GHOST_MALE = 317,
|
||||
|
||||
//General human shapes
|
||||
SHAPE_SAGE_MALE = 318,
|
||||
SHAPE_SAGE_FEMALE = 448,
|
||||
SHAPE_MAGE_MALE = 445,
|
||||
SHAPE_MAGE_FEMALE = 446,
|
||||
|
||||
SHAPE_SHOPKEEPER_FEMALE = 454,
|
||||
SHAPE_SHOPKEEPER_MALE = 455,
|
||||
|
||||
SHAPE_PEASANT_MALE = 319,
|
||||
SHAPE_PEASANT_FEMALE = 452,
|
||||
SHAPE_PEASANT_CHILD = 471,
|
||||
SHAPE_PEASANT_CHILD2 = 965, //Identical in appearance to CHILD
|
||||
|
||||
SHAPE_WOUNDED_MAN = 447,
|
||||
SHAPE_BEGGAR_CRUTCHES = 449,
|
||||
SHAPE_BEGGAR_NOLEGS = 450,
|
||||
|
||||
SHAPE_NOBLE_MALE = 451,
|
||||
SHAPE_NOBLE_FEMALE = 456,
|
||||
SHAPE_NOBLE_CHILD = 472,
|
||||
|
||||
SHAPE_GYPSY_MALE = 457,
|
||||
SHAPE_PIRATE = 458,
|
||||
SHAPE_WENCH = 459,
|
||||
SHAPE_RANGER_MALE = 460,
|
||||
SHAPE_RANGER_FEMALE = 461,
|
||||
|
||||
SHAPE_FIGHTER_MALE = 462,
|
||||
SHAPE_FIGHTER_FEMALE = 463,
|
||||
SHAPE_PALADIN = 464,
|
||||
|
||||
SHAPE_JESTER = 467,
|
||||
SHAPE_HIGHWAYMAN = 485, //Only used once, AFAIK
|
||||
SHAPE_ENTERTAINER_MALE = 468,
|
||||
SHAPE_ENTERTAINER_FEMALE = 469,
|
||||
|
||||
SHAPE_TOWNSMAN = 265,
|
||||
SHAPE_BLACKSMITH = 304,
|
||||
SHAPE_GUARD = 720, //Yes, the actual real-McCoy guard
|
||||
SHAPE_BARKEEP = 957, //Looks identical to SHOPKEEPER_MALE, just different name
|
||||
|
||||
SHAPE_BABY = 730, //This is just an object, basically. Kinda creepy.
|
||||
SHAPE_TODDLER = 864
|
||||
};
|
||||
|
||||
//Shapes used by 'monsters' - i.e. combatants and humans without schedules
|
||||
enum monster_shapes
|
||||
{
|
||||
//Unique monsters
|
||||
SHAPE_ETHEREAL_MONSTER = 230,
|
||||
SHAPE_HYDRA = 381,
|
||||
SHAPE_STONE_HARPIE = 753,
|
||||
SHAPE_GOLEM = 1015,
|
||||
|
||||
//Human 'monsters'
|
||||
SHAPE_MONSTER_MAGE = 154,
|
||||
SHAPE_MONSTER_PALADIN = 247,
|
||||
SHAPE_MONSTER_FIGHTER = 259,
|
||||
SHAPE_MONSTER_GUARD = 394,
|
||||
SHAPE_MONSTER_GUARD2 = 806,
|
||||
SHAPE_MONSTER_GUARD3 = 946, //Certainly laying it on with the duplicate guards.
|
||||
//(Presumably they each have different appearances and abilities.)
|
||||
SHAPE_MONSTER_PIRATE = 401,
|
||||
SHAPE_MONSTER_EMP = 784, //Not sure why this is a monster?
|
||||
SHAPE_MONSTER_GARGOYLE = 883, //Of the Wingless variety
|
||||
SHAPE_FELLOWSHIP_MALE = 884, //Found on Isle of the Avatar
|
||||
SHAPE_FELLOWSHIP_FEMALE = 929, //Found on Isle of the Avatar
|
||||
|
||||
SHAPE_GHOST = 299, //Your generic white-sheet jobbie
|
||||
|
||||
//Both of these are monsters - one has a crown, the other is more tatty. Not sure which is Horance.
|
||||
SHAPE_LICHE = 354,
|
||||
SHAPE_LICHE2 = 519,
|
||||
|
||||
SHAPE_ACID_SLUG = 491,
|
||||
SHAPE_ALLIGATOR = 492,
|
||||
SHAPE_BAT = 493,
|
||||
SHAPE_CORPSER = 499,
|
||||
|
||||
SHAPE_MONSTER_CYCLOPS = 501, //Not to be confused with SHAPE_CYCLOPS, which is the friendly NPC version
|
||||
|
||||
SHAPE_DRAGON = 504,
|
||||
SHAPE_DRAKE = 505,
|
||||
|
||||
SHAPE_GAZER = 511,
|
||||
SHAPE_GREMLIN = 513,
|
||||
SHAPE_HEADLESS = 514,
|
||||
|
||||
SHAPE_REAPER = 524,
|
||||
SHAPE_SEA_SERPENT = 525,
|
||||
|
||||
SHAPE_SKELETON = 528,
|
||||
SHAPE_SLIME = 529,
|
||||
|
||||
SHAPE_HARPIE = 532,
|
||||
SHAPE_MONSTER_TROLL = 533, //There's also an NPC troll, SHAPE_TROLL
|
||||
|
||||
SHAPE_TENTACLES = 536,
|
||||
SHAPE_MONGBAT = 661
|
||||
};
|
||||
|
||||
//Shapes used by 'normal' animals (i.e., real-life ones, whether friendly or hostile)
|
||||
enum animal_shapes
|
||||
{
|
||||
SHAPE_BEE = 494,
|
||||
SHAPE_CAT = 495,
|
||||
SHAPE_DOG = 496,
|
||||
SHAPE_CHICKEN = 498,
|
||||
SHAPE_COW = 500,
|
||||
SHAPE_DEER = 502,
|
||||
SHAPE_FISH = 509, //live fish in the water, not dead ones on your plate (those are frames of SHAPE_FOOD, see food_frames below)
|
||||
SHAPE_FOX = 510, //Not to be confused with Frank the Fox, who is SHAPE_FRANK
|
||||
SHAPE_FLY = 517,
|
||||
SHAPE_MOUSE = 521, //Not to be confused with Sherry the Mouse, who is SHAPE_SHERRY
|
||||
SHAPE_RAT = 523,
|
||||
SHAPE_SNAKE = 530,
|
||||
SHAPE_WOLF = 537,
|
||||
SHAPE_SCORPION = 706,
|
||||
SHAPE_BIRD = 716,
|
||||
SHAPE_HORSE = 727, //Not to be confused with Smith the Horse, who is SHAPE_SMITH
|
||||
SHAPE_DRAFT_HORSE = 796, //These hardly count as an animal, poor things
|
||||
SHAPE_RABBIT = 811,
|
||||
SHAPE_SPIDER = 865,
|
||||
SHAPE_SHEEP = 970
|
||||
};
|
||||
|
||||
const int SHAPE_KEY = 641;
|
||||
const int SHAPE_GOLD = 644; //Filthy lucre
|
||||
const int SHAPE_SCROLL = 797;
|
||||
const int SHAPE_EGG = 275;
|
||||
const int SHAPE_FISHING_ROD = 662; //fishing rod (quel surprise)
|
||||
|
||||
const int SHAPE_RUNE = 877;
|
||||
const int SHAPE_ORB = 785; //Orb of the Moons
|
||||
|
||||
const int SHAPE_PRISM = 981; //The Guardian's three prisms
|
||||
|
||||
const int SHAPE_FOOD = 377;
|
||||
const int SHAPE_BOTTLE = 616;
|
||||
const int SHAPE_REAGENT = 842;
|
||||
const int SHAPE_KITCHEN_ITEM = 863;
|
||||
const int SHAPE_BUCKET = 810;
|
||||
const int SHAPE_POWDER_KEG = 704;
|
||||
|
||||
const int SHAPE_DOUGH = 658;
|
||||
const int SHAPE_HEARTH = 831;
|
||||
|
||||
const int SHAPE_WHEAT = 677;
|
||||
const int SHAPE_MILLSTONE = 711;
|
||||
|
||||
const int SHAPE_WELL = 740;
|
||||
const int SHAPE_WELLBASE = 470;
|
||||
const int SHAPE_ROCK = 331;
|
||||
|
||||
const int SHAPE_WORKTABLE_VERTICAL = 1003;
|
||||
const int SHAPE_WORKTABLE_HORIZONTAL = 1018;
|
||||
|
||||
const int SHAPE_EMPTY_CRADLE = 992;
|
||||
const int SHAPE_FULL_CRADLE = 987;
|
||||
|
||||
const int SHAPE_SPILL = 912;
|
||||
|
||||
enum light_sources
|
||||
{
|
||||
SHAPE_LIGHTSOURCE = 336,
|
||||
SHAPE_SCONCE = 481,
|
||||
SHAPE_TORCH = 595,
|
||||
SHAPE_LIGHTSOURCE_LIT = 338,
|
||||
SHAPE_SCONCE_LIT = 435,
|
||||
SHAPE_TORCH_LIT = 701,
|
||||
SHAPE_CAMPFIRE = 825
|
||||
//SHAPE_FIREPIT lives in forging_shapes below
|
||||
};
|
||||
|
||||
enum cloth_shapes
|
||||
{
|
||||
SHAPE_THREAD = 654,
|
||||
SHAPE_LOOM = 261,
|
||||
SHAPE_CLOTH = 851,
|
||||
SHAPE_BANDAGE = 827,
|
||||
SHAPE_TOP = 249,
|
||||
SHAPE_PANTS = 738,
|
||||
SHAPE_TOY = 742,
|
||||
SHAPE_CLOAK = 285,
|
||||
SHAPE_COSTUME = 838,
|
||||
SHAPE_HOOD = 444,
|
||||
SHAPE_SHEARS = 698,
|
||||
SHAPE_WOOL = 653
|
||||
};
|
||||
|
||||
//Door shapes
|
||||
enum door_shapes
|
||||
{
|
||||
SHAPE_DOOR_HORIZONTAL = 270,
|
||||
SHAPE_DOOR_VERTICAL = 376,
|
||||
SHAPE_DOOR2_HORIZONTAL = 432,
|
||||
SHAPE_DOOR2_VERTICAL = 433,
|
||||
|
||||
SHAPE_ABBEY_DOOR_LEFT_HORIZONTAL = 246,
|
||||
SHAPE_ABBEY_DOOR_RIGHT_HORIZONTAL = 225,
|
||||
|
||||
SHAPE_ABBEY_DOOR_LEFT_VERTICAL = 250,
|
||||
SHAPE_ABBEY_DOOR_RIGHT_VERICAL = 392 //Note: This is actually a copy of ABBEY_DOOR_LEFT_VERTICAL. Maybe they screwed up but never used them anyway.
|
||||
};
|
||||
|
||||
//Chest shapes
|
||||
enum chest_shapes
|
||||
{
|
||||
SHAPE_CHEST = 800,
|
||||
SHAPE_LOCKED_CHEST = 522
|
||||
};
|
||||
|
||||
//Shapes used in mining
|
||||
enum mining_shapes
|
||||
{
|
||||
SHAPE_MINING_MACHINE = 410,
|
||||
SHAPE_CONVEYOR_BELT = 411,
|
||||
SHAPE_BLACKROCK = 914,
|
||||
SHAPE_LEAD_ORE = 915,
|
||||
SHAPE_IRON_ORE = 916,
|
||||
SHAPE_STONE_CHIPS = 815
|
||||
};
|
||||
|
||||
//Shapes used in weaponsmithing (e.g. Forge of Virtue)
|
||||
enum forging_shapes
|
||||
{
|
||||
SHAPE_SWORDBLANK = 668,
|
||||
SHAPE_ANVIL = 991,
|
||||
SHAPE_TROUGH_VERTICAL = 719,
|
||||
SHAPE_TROUGH_HORIZONTAL = 741,
|
||||
SHAPE_FIREPIT = 739
|
||||
};
|
||||
|
||||
enum moongate_shapes
|
||||
{
|
||||
SHAPE_ORB_MOONGATE_HORIZONTAL = 779,
|
||||
SHAPE_ORB_MOONGATE_VERTICAL = 157,
|
||||
SHAPE_STANDING_RED_MOONGATE = 776,
|
||||
SHAPE_STANDING_BLUE_MOONGATE = 777
|
||||
};
|
||||
|
||||
enum weapon_shapes
|
||||
{
|
||||
SHAPE_HAMMER = 623,
|
||||
SHAPE_CUSTOM_SWORD = 635,
|
||||
SHAPE_BLACK_SWORD = 707
|
||||
};
|
||||
|
||||
//Frames
|
||||
//------
|
||||
|
||||
//these are frames of SHAPE_TOP
|
||||
const int FRAME_SHIRT = 0;
|
||||
const int FRAME_DRESS1 = 1;
|
||||
const int FRAME_DRESS2 = 2;
|
||||
|
||||
const int FRAME_CUBE = 1; //the cube prism
|
||||
|
||||
const int FRAME_RUNE_HONOR = 6;
|
||||
|
||||
enum kitchen_item_frames
|
||||
{
|
||||
FRAME_FLOURSACK_OPEN = 0,
|
||||
FRAME_PITCHER = 2,
|
||||
|
||||
FRAME_ROLLINGPIN = 8,
|
||||
FRAME_ROLLINGPIN_2 = 9,
|
||||
FRAME_FLOURSACK = 13,
|
||||
FRAME_FLOURSACK_2 = 14,
|
||||
FRAME_CHURN = 15
|
||||
};
|
||||
|
||||
enum food_frames
|
||||
{
|
||||
FRAME_BREAD = 0,
|
||||
FRAME_ROLLS = 1,
|
||||
FRAME_BAGUETTE = 2,
|
||||
FRAME_BREAD_LONG = 2, //for you Francophobes (or should I call it "FRAME_BREAD_FREEDOM"?)
|
||||
FRAME_FRUITCAKE = 3,
|
||||
FRAME_CAKE = 4,
|
||||
FRAME_PIE = 5,
|
||||
FRAME_PASTRY = 6,
|
||||
|
||||
FRAME_SAUSAGES = 7,
|
||||
FRAME_MUTTON = 8,
|
||||
FRAME_BEEF = 9,
|
||||
FRAME_CHICKEN = 10,
|
||||
FRAME_HAM = 11,
|
||||
FRAME_TROUT = 12,
|
||||
FRAME_FLOUNDER = 13,
|
||||
FRAME_VENISON = 14,
|
||||
FRAME_JERKY = 15,
|
||||
|
||||
FRAME_APPLE = 16,
|
||||
FRAME_BANANA = 17,
|
||||
FRAME_CARROTS = 18,
|
||||
FRAME_CARROT = 18,
|
||||
FRAME_GRAPES = 19,
|
||||
FRAME_PUMPKIN1 = 20,
|
||||
FRAME_PUMPKIN_LARGE = 20,
|
||||
FRAME_PUMPKIN2 = 21,
|
||||
FRAME_PUMPKIN_SMALL = 21,
|
||||
FRAME_LEEK = 22,
|
||||
|
||||
FRAME_RIBS = 23,
|
||||
FRAME_EGG = 24,
|
||||
|
||||
FRAME_BUTTER = 25,
|
||||
FRAME_CHEESE1 = 26,
|
||||
FRAME_CHEESE_WHEEL = 26,
|
||||
FRAME_CHEESE2 = 27,
|
||||
FRAME_CHEESE_WEDGE = 27,
|
||||
FRAME_CHEESE3 = 28,
|
||||
FRAME_CHEESE_GREEN = 28,
|
||||
|
||||
FRAME_POTATO = 29,
|
||||
FRAME_FISH_AND_CHIPS = 30,
|
||||
FRAME_SILVERLEAF = 31
|
||||
};
|
||||
|
||||
enum bottle_frames
|
||||
{
|
||||
FRAME_MILK = 7
|
||||
};
|
||||
|
||||
enum dough_frames //used in baking.uc
|
||||
{
|
||||
FRAME_FLOUR = 0,
|
||||
FRAME_DOUGH_FLAT = 1, //this will now create a pastry when cooked in the oven
|
||||
FRAME_DOUGH_BALL = 2
|
||||
};
|
||||
|
||||
enum bucket_frames
|
||||
{
|
||||
FRAME_BUCKET_EMPTY = 0,
|
||||
FRAME_BUCKET_WATER = 1,
|
||||
FRAME_BUCKET_BLOOD = 2,
|
||||
FRAME_BUCKET_WINE = 3,
|
||||
FRAME_BUCKET_BEER = 4,
|
||||
FRAME_BUCKET_BEER2 = 5,
|
||||
FRAME_WATERINGCAN = 6
|
||||
};
|
||||
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This header file contains several more shape numbers. It is mostly unsorted...
|
||||
*
|
||||
* Author: Marzo Junior
|
||||
* Last Modified: 2006-02-27
|
||||
*/
|
||||
|
||||
const int SHAPE_SCONCE_SPENT = 535; //0x0217
|
||||
const int SHAPE_LIGHTSOURCE_SPENT = 997; //0x03E5
|
||||
const int QUALITY_TORCH_SPENT = 255; //0x00FF
|
||||
const int SHAPE_LIT_LAMP = 526;
|
||||
const int SHAPE_LAMPPOST = 889;
|
||||
|
||||
const int SHAPE_BACKPACK = 801;
|
||||
const int SHAPE_BAG = 802;
|
||||
|
||||
const int SHAPE_2H_HAMMER = 600;
|
||||
const int SHAPE_2H_SWORD = 602;
|
||||
const int SHAPE_MORNINGSTAR = 596;
|
||||
const int SHAPE_SPIKEDSHIELD = 578;
|
||||
const int SHAPE_HALBERD = 603;
|
||||
const int SHAPE_ARROWS = 722; //0x2D2
|
||||
const int SHAPE_BOLTS = 723; //0x2D3
|
||||
|
||||
const int SHAPE_BLACKSWORD = 707; //0x2C3
|
||||
const int SHAPE_MAGIC_BOLTS = 417;
|
||||
const int SHAPE_BURST_ARROWS = 554;
|
||||
const int SHAPE_MAGIC_ARROWS = 556;
|
||||
const int SHAPE_LUCKY_ARROWS = 558;
|
||||
const int SHAPE_LOVE_ARROWS = 560;
|
||||
const int SHAPE_TSERAMED_ARROWS = 568;
|
||||
const int SHAPE_LIGHTNING_WAND = 629;
|
||||
const int SHAPE_FIRE_WAND = 630;
|
||||
const int SHAPE_FIREDOOM_STAFF = 553;
|
||||
const int SHAPE_MAGICIANS_WAND = 792;
|
||||
|
||||
const int SHAPE_LEATHER_HELM = 1004;
|
||||
const int SHAPE_LEATHER_ARMOR = 582;
|
||||
const int SHAPE_LEATHER_COLLAR = 569;
|
||||
const int SHAPE_LEATHER_GLOVES = 579;
|
||||
const int SHAPE_LEATHER_LEGGINGS = 574;
|
||||
const int SHAPE_LEATHER_BOOTS = 587;
|
||||
|
||||
const int SHAPE_CHAIN_COIF = 539;
|
||||
const int SHAPE_CHAIN_ARMOUR = 571;
|
||||
const int SHAPE_CHAIN_LEGGINGS = 575;
|
||||
|
||||
const int SHAPE_GAUNTLETS = 580;
|
||||
const int SHAPE_GORGET = 586;
|
||||
const int SHAPE_PLATE_ARMOUR = 573;
|
||||
const int SHAPE_PLATE_LEGGINGS = 576;
|
||||
const int SHAPE_GREAT_HELM = 541;
|
||||
|
||||
const int SHAPE_MAGIC_ARMOR = 666;
|
||||
|
||||
const int SHAPE_GEM = 760;
|
||||
const int SHAPE_JEWELRY = 937;
|
||||
const int SHAPE_GOLD_NUGGET = 645;
|
||||
const int SHAPE_GOLD_BAR = 646;
|
||||
const int SHAPE_GOLD_COIN = 644;
|
||||
|
||||
const int SHAPE_SPELLBOOK = 761; //0x2F9
|
||||
|
||||
const int SHAPE_POTION = 340; //0x154
|
||||
|
||||
const int SHAPE_SEXTANT = 650; //0x28A
|
||||
|
||||
const int SHAPE_VENOM = 649; //0x289
|
||||
|
||||
const int SHAPE_AMULET = 955; //0x3BB
|
||||
|
||||
const int SHAPE_DEATHBOLT = 527; //0x20F
|
||||
|
||||
const int SHAPE_LARGE_BODIES = 778; //0x30A
|
||||
const int FRAME_DRAGON_BODY = 7; //0x007
|
||||
const int SHAPE_BODIES_1 = 400; //0x190
|
||||
const int FRAME_MONK_BODY_1 = 5; //0x005
|
||||
const int SHAPE_BODIES_2 = 414; //0x19E
|
||||
const int FRAME_LBBODY2 = 13; //0x00D
|
||||
const int SHAPE_BODIES_3 = 762; //0x19E
|
||||
const int FRAME_MAGEBODY = 22; //0x00D
|
||||
const int SHAPE_BODIES_4 = 892; //0x19E
|
||||
const int SHAPE_BODIES_5 = 778; //0x19E
|
||||
|
||||
const int SHAPE_BROKEN_DISH = 546;
|
||||
const int SHAPE_GARBAGE = 415;
|
||||
const int SHAPE_STAIN = 912;
|
||||
const int SHAPE_DIAPER = 822;
|
||||
const int SHAPE_BROKEN_ROOF = 223;
|
||||
const int SHAPE_ANCHOR = 886;
|
||||
const int SHAPE_BLOOD = 912;
|
||||
|
||||
const int SHAPE_DARK_CORE = 0x03DE;
|
||||
const int SHAPE_GHOST2 = 0x0151;
|
||||
|
||||
const int SHAPE_SLEEPING_POWDER = 648;
|
||||
|
||||
const int SHAPE_INVISIBILITY_DUST = 790;
|
||||
|
||||
const int SHAPE_BOOK = 642; //0x282
|
||||
|
||||
const int SHAPE_BEE_STINGER = 947;
|
||||
|
||||
const int SHAPE_PLANT = 999; //0x03E7
|
||||
|
||||
const int SHAPE_TOMBSTONE = 715; //0x02CB
|
||||
|
||||
const int SHAPE_BED_HORIZONTAL = 696;
|
||||
const int SHAPE_BED_VERTICAL = 1011;
|
||||
|
||||
const int SHAPE_CAULDRON = 995;
|
||||
|
||||
const int SHAPE_TRAP = 200; //0x0C8
|
||||
|
||||
const int SHAPE_PATH_EGG = 607;
|
||||
|
||||
const int SHAPE_WINCH_HORIZONTAL = 949;
|
||||
const int SHAPE_WINCH_VERTICAL = 950;
|
||||
|
||||
const int SHAPE_LEVER = 787;
|
||||
const int SHAPE_SWITCH = 788;
|
||||
|
||||
const int SHAPE_SPINNING_WHEEL = 651;
|
||||
|
||||
const int SHAPE_KITE = 329;
|
||||
|
||||
const int SHAPE_BELLOWS = 431;
|
||||
|
||||
const int SHAPE_KEG = 258;
|
||||
const int SHAPE_CASK = 434;
|
||||
|
||||
const int SHAPE_STRENGTH_TESTER = 743;
|
||||
|
||||
const int SHAPE_CHAIR = 873;
|
||||
|
||||
const int SHAPE_BEDROLL = 583;
|
||||
|
||||
const int SHAPE_FALSE_WALL_HORIZONTAL = 845;
|
||||
const int SHAPE_FALSE_WALL_VERTICAL = 828;
|
||||
|
||||
const int SHAPE_GHOST3 = 337;
|
||||
|
||||
const int SHAPE_LENS = 726; //0x2D6
|
||||
|
||||
const int KEY_PICKABLE_TRAPPED = 255; //only found on chests - doors cannot be trapped.
|
||||
|
||||
const int SHAPE_VIRTUE_STONE = 330;
|
||||
|
||||
const int SHAPE_SPELL_SLEEP = 72;
|
||||
const int SHAPE_SPELL_EXPLOSION = 78;
|
||||
const int SHAPE_SPELL_CHARM = 80;
|
||||
const int SHAPE_IGNITE = 280;
|
||||
const int SHAPE_CURSE = 281;
|
||||
const int SHAPE_SWORDSTRIKE = 287;
|
||||
const int SHAPE_ENERGY_MYST = 399;
|
||||
const int SHAPE_PARALYZE = 408;
|
||||
const int SHAPE_POISON = 424;
|
||||
const int SHAPE_TELEKINESIS = 443;
|
||||
const int SHAPE_DOUSE = 540;
|
||||
const int SHAPE_DELAYED_EXPLOSION = 621;
|
||||
const int SHAPE_DEATH_VORTEX = 639;
|
||||
const int SHAPE_LIGHTNING = 807;
|
||||
const int SHAPE_FIREBOLT = 856;
|
||||
|
||||
const int SHAPE_ENERGY_FIELD = 768;
|
||||
const int SHAPE_FIRE_FIELD = 895;
|
||||
const int SHAPE_POISON_FIELD = 900;
|
||||
const int SHAPE_SLEEP_FIELD = 902;
|
||||
|
||||
const int SHAPE_GUARDIAN_STATUE = 945;
|
||||
|
||||
const int SHAPE_CASTING_FRAMES = 859;
|
||||
|
||||
const int SHAPE_PEDESTAL = 718;
|
||||
|
||||
const int SHAPE_VORTEX_CUBE = 786;
|
||||
|
||||
const int SHAPE_STATUE = 854;
|
||||
|
||||
const int SHAPE_TIME_BARRIER = 1021;
|
||||
|
||||
const int KEY_INN = 255; //0x0FF, keys for inn doors.
|
||||
|
||||
const int SHAPE_BOW = 597;
|
||||
const int SHAPE_MAGIC_BOW = 606;
|
||||
const int SHAPE_CROSSBOW = 598;
|
||||
const int SHAPE_TRIPLE_XBOW = 647;
|
||||
@@ -0,0 +1,560 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 Alun Bestor/The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This header file defines general constants used throughout usecode, for
|
||||
* Black Gate and Serpent Isle. Constants particular to a function can be
|
||||
* found in the relevant codefile; constants particular to a game can be
|
||||
* found in that game's header directory.
|
||||
*
|
||||
* Author: Alun Bestor (exult@washboardabs.net)
|
||||
* With modifications by Marzo Junior (marzojr@yahoo.com)
|
||||
* Last modified: 2006-02-27
|
||||
*/
|
||||
|
||||
/*
|
||||
* Event types, compiled with help from Marzo
|
||||
* The global <event> variable is set with one of these values to describe
|
||||
* how the current function was called: whether by the player clicking on the
|
||||
* object, or by a scripted event, or by egg trigger conditions, or just the
|
||||
* item being onscreen, etc.
|
||||
* Functions check the value of <event> in order to provide different responses
|
||||
* to different events.
|
||||
* Functions can also set <event> to an arbitrary value, in order to mimic a
|
||||
* real event or just as a 'pseudo-argument' to functions called with the
|
||||
* likes of UI_path_run_usecode.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
enum events
|
||||
{
|
||||
PROXIMITY = 0, // Object is on-screen or nearby
|
||||
// This is called repeatedly, with a random delay
|
||||
// between each call
|
||||
DOUBLECLICK = 1, // Object is double-clicked on
|
||||
SCRIPTED = 2, // Function is called from inside a script{} block
|
||||
// (very common)
|
||||
EGG = 3, // Object is an egg that just hatched (triggered by
|
||||
// egg activation conditions)
|
||||
WEAPON = 4, // Object was wielded and 'swung' in combat
|
||||
// This is mainly used with 'weapon-like' objects
|
||||
// - e.g. smokebombs and fishing rods - that have more
|
||||
// advanced 'attack' behaviour.
|
||||
|
||||
READIED = 5, // Object was worn or readied in inventory - used by
|
||||
// items like the Ring of Invisibility
|
||||
UNREADIED = 6, // Object was taken off or put away in inventory
|
||||
|
||||
DEATH = 7, // NPC has just been killed (SI-only)
|
||||
STARTED_TALKING = 9, // NPC starts conversation with you (has TALK
|
||||
// schedule and has reached the Avatar)
|
||||
// This is SI-only - BG uses event 1 for this,
|
||||
// both for conversations triggered by doubleclick
|
||||
// and by the TALK schedule
|
||||
|
||||
//The following events are arbitrary programmer conventions:
|
||||
PATH_SUCCESS = 10, // Set with calls to UI_path_run_usecode, to indicate
|
||||
// a successful pathfind to the target object
|
||||
PATH_FAILURE = 11 // Set with calls to UI_set_path_failure, to indicate
|
||||
// an interrupted pathfind (e.g. when the player
|
||||
// moves the Avatar manually)
|
||||
};
|
||||
|
||||
/*
|
||||
* Coordinate axes - use when referencing X,Y,Z coordinate arrays.
|
||||
* Note that the coordinates returned by UI_click_on_item are 1 array-index
|
||||
* higher, because index 1 of the returned array is the actual item clicked on.
|
||||
* You can resolve this to a regular X,Y,Z coordinates array by using
|
||||
* array = removeFromArray(array, array[1]); (see also bg_externals.uc)
|
||||
*/
|
||||
enum axes
|
||||
{
|
||||
X = 1, //horizontal axis (numbered from west to east)
|
||||
Y = 2, //vertical axis (numbered from north to south)
|
||||
Z = 3 //lift axis (numbered from ground to sky)
|
||||
};
|
||||
|
||||
/*
|
||||
* Cardinal directions: returned by UI_get_direction. Use with face or step
|
||||
* statements in script{} blocks. e.g:
|
||||
* script item { step NORTH; step NORTH; face SOUTH; }
|
||||
* takes two steps north, then turn to face south
|
||||
*/
|
||||
enum directions
|
||||
{
|
||||
NORTH = 0,
|
||||
NORTHEAST = 1,
|
||||
EAST = 2,
|
||||
SOUTHEAST = 3,
|
||||
SOUTH = 4,
|
||||
SOUTHWEST = 5,
|
||||
WEST = 6,
|
||||
NORTHWEST = 7
|
||||
};
|
||||
|
||||
/*
|
||||
* parts of the day (3-hour intervals). Returned by UI_part_of_day. This is
|
||||
* usually only used by conversation scripts, as a way of narrowing down
|
||||
* schedule-related behaviour.
|
||||
*/
|
||||
enum day_periods
|
||||
{
|
||||
// The period is equal to one-third of the current game hour.
|
||||
MIDNIGHT = 0, // 0-2
|
||||
EARLY = 1, // 3-5
|
||||
DAWN = 2, // 6-8
|
||||
MORNING = 3, // 9-11
|
||||
NOON = 4, // 12-14
|
||||
AFTERNOON = 5, // 15-17
|
||||
EVENING = 6, // 18-20
|
||||
NIGHT = 7 // 21-23
|
||||
};
|
||||
|
||||
/*
|
||||
* Wildcards, used for specifying "any acceptable value for this parameter"
|
||||
* to a measuring function. These are commonly used with object-related
|
||||
* intrinsics like UI_get_cont_items, UI_count_objects, UI_remove_party_items.
|
||||
*/
|
||||
enum wildcards
|
||||
{
|
||||
SHAPE_ANY = -359,
|
||||
QUALITY_ANY = -359,
|
||||
FRAME_ANY = -359,
|
||||
FIND_ON_SCREEN = -359
|
||||
};
|
||||
|
||||
// tick multipliers, for use with UI_advance_time or script statements
|
||||
enum times
|
||||
{
|
||||
MINUTE = 25,
|
||||
HOUR = 1500
|
||||
};
|
||||
const long DAY = 36000;
|
||||
/*
|
||||
* Examples:
|
||||
* UI_advance_time(30 * MINUTE); // advance time by 30 game minutes
|
||||
* UI_advance_time(2 * HOUR); // advance time by two game hours
|
||||
* script after MINUTE ticks { ... } // schedule this script block to execute
|
||||
* // after one game minute
|
||||
*/
|
||||
|
||||
/*
|
||||
* Item/NPC flags, stolen from the Exult LB-joins-party patch with some
|
||||
* comments added.
|
||||
* These can be retrieved and set using UI_get_item_flag(itemref, flag),
|
||||
* UI_set_item_flag(itemref, flag) and UI_clear_item_flag(itemref, flag).
|
||||
*/
|
||||
enum item_flags
|
||||
{
|
||||
INVISIBLE = 0,
|
||||
ASLEEP = 1,
|
||||
CHARMED = 2,
|
||||
CURSED = 3,
|
||||
DEAD = 4,
|
||||
IN_PARTY = 6,
|
||||
PARALYZED = 7,
|
||||
PARALYSED = 7, //British spelling
|
||||
POISONED = 8,
|
||||
PROTECTION = 9,
|
||||
ON_MOVING_BARGE = 10,
|
||||
OKAY_TO_TAKE = 11, // The item does not belong to anyone, and won't
|
||||
// trigger stealing behaviour if you take it.
|
||||
MIGHT = 12, // Double strength, dext, intel.
|
||||
IMMUNITIES = 13, // Lots of imunities; can be gotten only.
|
||||
CANT_DIE = 14, // Test flag in monster_info.
|
||||
DANCING = 15, // Set by "Dance" spell in BG.
|
||||
DONT_MOVE = 16, // SI-only. NPC can't move; "cutscene" mode.
|
||||
DONT_RENDER = 16, // BG-only. Like DONT_MOVE, but avatar also
|
||||
// completely invisible.
|
||||
TEMPORARY = 18, // Is temporary - this means that the item will
|
||||
// be deleted once the party gets beyond a certain
|
||||
// range from it (outside the superchunk?)
|
||||
SAILOR = 20, // The barge's 'captain'. When getting the flag,
|
||||
// you will actually get the current captain.
|
||||
OKAY_TO_LAND = 21, // Used for flying-carpet.
|
||||
BG_DONT_MOVE = 22, // BG-only. NPC can't move; "cutscene" mode.
|
||||
SI_DONT_RENDER = 22, // SI-only. Like DONT_MOVE, but avatar also
|
||||
// completely invisible.
|
||||
IN_DUNGEON = 23, // If set, you won't be accused of stealing.
|
||||
CONFUSED = 25,
|
||||
IN_MOTION = 26, // Object is a barge object moving, or on a barge
|
||||
// object that is moving. Set in usecode, and mostly
|
||||
// used for the SI 'NPC' ships such as the turtle.
|
||||
MET = 28, // Has the npc been met before - originally this
|
||||
// was SI-only, but Exult implements it for BG
|
||||
// too. This determines conversation behaviour,
|
||||
// and whether the NPC's real name or shape name
|
||||
// is displayed when they are single-clicked on.
|
||||
// BG originally used global flags for this, which
|
||||
// amounts to an extra 250-odd flags.
|
||||
SI_TOURNAMENT = 29, // Call usecode (eventid = 7) on death
|
||||
SI_ZOMBIE = 30, // Used for sick Neyobi, Cantra, post-Bane companions.
|
||||
|
||||
NO_SPELL_CASTING = 31,
|
||||
POLYMORPH = 32, // Do not set this flag directly; use the
|
||||
// UI_set_polymorph intrinsic instead.
|
||||
TATTOOED = 33,
|
||||
READ = 34, // Can read non-Latin alphabet scrolls, books, signs.
|
||||
PETRA = 35,
|
||||
SI_LIZARD_KING = 36, //added by DB - SI lizard king
|
||||
FREEZE = 37,
|
||||
NAKED = 38, // Exult. Makes the avatar naked given its skin. Other NPCs should use set_polymorph instead.
|
||||
SHOPPED_BEFORE = 60, // added by DB - Makes shopping easier. If you asked npc about shop before, go ahead and buy/sell without digging around for it
|
||||
MET_2 = 61, //
|
||||
IS_EATING = 62, //added by DB - used to determine if npc is eating or in tavern
|
||||
SHOP_IS_OPEN = 63 //added by DB - used to fix interference with TALK schedule on schedule specific
|
||||
// shopkeepers.
|
||||
|
||||
};
|
||||
|
||||
// Business activities (taken from the cheat screen)
|
||||
enum schedules
|
||||
{
|
||||
IN_COMBAT = 0, // renamed to not conflict with COMBAT, the NPC
|
||||
// stat property.
|
||||
PACE_HORIZONTAL = 1, // Walk horizontally until you hit a wall, then
|
||||
// turn around. (Patrolling on the cheap.)
|
||||
PACE_VERTICAL = 2, // Same as above, but vertically.
|
||||
TALK = 3, // NPC runs to the Avatar to talk to them. When
|
||||
// they get within a certain distance of where the
|
||||
// Avatar was when this schedule was set, a
|
||||
// DOUBLECLICK event is triggered on the NPC.
|
||||
// At this point the schedule must be changed.
|
||||
DANCE = 4,
|
||||
EAT = 5,
|
||||
FARM = 6, // Waves farm implements around.
|
||||
TEND_SHOP = 7, // This is really just a more specific version of
|
||||
// LOITER, used for narrowing down schedule barks.
|
||||
// See BAKE, SEW and BLACKSMITH for more specific
|
||||
// examples of shop behaviour.
|
||||
MINE = 8,
|
||||
MINER = 8,
|
||||
HOUND = 9,
|
||||
STANDTHERE = 10, // renamed to not conflict with STAND, the NPC
|
||||
// animation frame
|
||||
LOITER = 11, // Hangs around a certain point, within 10 units
|
||||
// or so
|
||||
WANDER = 12, // Roams nearby a certain point (as much as a
|
||||
// 320x200 screen away)
|
||||
BLACKSMITH = 13,
|
||||
SLEEP = 14,
|
||||
WAIT = 15, // Similar to STAND, except that they will never
|
||||
// leave the WAIT schedule until it is manually
|
||||
// changed: their preset schedule list is ignored.
|
||||
MAJOR_SIT = 16,
|
||||
GRAZE = 17,
|
||||
BAKE = 18,
|
||||
SEW = 19,
|
||||
SHY = 20, // Tries to keep out of the Avatar's way - will
|
||||
// half-heartedly flee until out of a certain range.
|
||||
LAB = 21,
|
||||
THIEF = 22, // Approaches the party and will take gold from the Avatar's
|
||||
// backpack, then will bark "Greetings!" in SI.
|
||||
WAITER = 23,
|
||||
SPECIAL = 24, // ??
|
||||
KID_GAMES = 25, // Tag! Thou art it! And so forth.
|
||||
TAG = 25,
|
||||
EAT_AT_INN = 26, // same as Eat, only with different barks.
|
||||
DUEL = 27,
|
||||
SPAR = 27,
|
||||
PREACH = 28, // Broken in SI, Leon resets to Loiter after trying it.
|
||||
PATROL = 29, // This tells the AI to follow a particular set of
|
||||
// patrol waypoints, defined by path eggs.
|
||||
DESK_WORK = 30,
|
||||
FOLLOW_AVATAR = 31 // That most noble of pursuits. Like WAIT, this
|
||||
// completely overrides the NPC's schedule list.
|
||||
};
|
||||
|
||||
/*
|
||||
* NPC animation frames. Use these with UI_set_item_frame or (preferably) in
|
||||
* script blocks, with 'actor frame'.
|
||||
* e.g.: script AVATAR { actor frame STAND; actor frame USE; actor frame
|
||||
* SWING_1; actor_frame STAND; }
|
||||
* Important note: use 'actor frame' with NPCs instead of 'frame', as 'actor
|
||||
* frame' takes the NPC's current facing into account.
|
||||
*/
|
||||
enum npc_frames
|
||||
{
|
||||
STAND = 0,
|
||||
WALK_1 = 1,
|
||||
WALK_2 = 2,
|
||||
|
||||
USE = 3, //general use motion
|
||||
|
||||
SWING_1 = 4, //start of one-handed swing, arm up over shoulder
|
||||
SWING_2 = 5, //middle of one-handed swing, arm out to the side
|
||||
SWING_3 = 6, //end of one-handed swing, arm out to the front
|
||||
|
||||
SWING_2H_1 = 7, //start of 2-handed swing, arms up over shoulder
|
||||
SWING_2H_2 = 8, //middle of 2-handed swing, arms out to the side
|
||||
SWING_2H_3 = 9, //end of 2-handed swing, arms out to the front
|
||||
|
||||
SIT = 10, //sitting down
|
||||
LEAN = 11, //leaning down
|
||||
KNEEL = 12, //kneeling on one knee
|
||||
LIE = 13, //lying down
|
||||
CAST_1 = 14, //both arms high in the air (casting motion)
|
||||
CAST_2 = 15 //both arms stretched out (casting motion)
|
||||
};
|
||||
|
||||
// North/South/East/West frame offsets for the NPC frames. Only really necessary
|
||||
// if you're using UI_set_item_frame or 'frame'
|
||||
enum frame_offsets
|
||||
{
|
||||
NORTH_FRAMESET = 0,
|
||||
SOUTH_FRAMESET = 16,
|
||||
WEST_FRAMESET = 32,
|
||||
EAST_FRAMESET = 48
|
||||
};
|
||||
|
||||
// Ready slots for Black Gate: use with <UI_is_readied> or <UI_get_readied>.
|
||||
// These are the same whether paperdolls are on or off.
|
||||
enum inv_slots_bg
|
||||
{
|
||||
BG_BACKPACK = 0,
|
||||
BG_WEAPON_HAND = 1,
|
||||
BG_BOTH_HANDS = 1,
|
||||
BG_SHIELD_HAND = 2,
|
||||
BG_OFF_HAND = 2,
|
||||
BG_BELT = 3,
|
||||
BG_TORSO = 5,
|
||||
BG_LEFT_RING = 6,
|
||||
BG_RIGHT_RING = 7,
|
||||
BG_QUIVER = 8,
|
||||
BG_HEAD = 9,
|
||||
BG_LEGS = 10,
|
||||
BG_FEET = 11,
|
||||
BG_USECODE = 12,
|
||||
BG_CLOAK = 13, // Exult-only
|
||||
BG_GLOVES = 14, // Exult-only
|
||||
BG_EARS = 16, // Exult-only
|
||||
BG_BACK_SHIELD = 17, // Exult-only
|
||||
BG_BACK_2H = 19, // Exult-only
|
||||
BG_AMULET = 22 // Exult-only
|
||||
};
|
||||
|
||||
// Ready slots for Serpent Isle: use with <UI_is_readied> or <UI_get_readied>.
|
||||
// These are the same whether paperdolls are on or off.
|
||||
enum inv_slots_si
|
||||
{
|
||||
SI_SHIELD_HAND = 0,
|
||||
SI_OFF_HAND = 0,
|
||||
SI_WEAPON_HAND = 1,
|
||||
SI_BOTH_HANDS = 1,
|
||||
SI_CLOAK = 2,
|
||||
SI_AMULET = 3,
|
||||
SI_HEAD = 4,
|
||||
SI_GLOVES = 5,
|
||||
SI_USECODE = 6,
|
||||
SI_RIGHT_RING = 7,
|
||||
SI_LEFT_RING = 8,
|
||||
SI_EARS = 9,
|
||||
SI_QUIVER = 10,
|
||||
SI_BELT = 11,
|
||||
SI_TORSO = 12,
|
||||
SI_FEET = 13,
|
||||
SI_LEGS = 14,
|
||||
SI_BACKPACK = 15,
|
||||
SI_BACK_SHIELD = 16,
|
||||
SI_BACK_2H = 17
|
||||
};
|
||||
|
||||
/*
|
||||
* NPC properties (mostly ability scores)
|
||||
* These can be retrieved and set using UI_get_npc_property(npc, property) and
|
||||
* UI_set_npc_property(npc, property, value) respectively.
|
||||
* Note however that UI_set_npc_property will actually *add* the value to the
|
||||
* original property, not set it to that value. Which means you will need to
|
||||
* calculate a relative positive/negative adjustment to set it to a target
|
||||
* value.
|
||||
*/
|
||||
enum npc_properties
|
||||
{
|
||||
STRENGTH = 0,
|
||||
DEXTERITY = 1,
|
||||
INTELLIGENCE = 2,
|
||||
HEALTH = 3,
|
||||
COMBAT = 4,
|
||||
MANA = 5,
|
||||
MAX_MANA = 6,
|
||||
TRAINING = 7,
|
||||
EXPERIENCE = 8,
|
||||
FOODLEVEL = 9,
|
||||
SEX_FLAG = 10, // 1 (nonzero) if female, 0 if male.
|
||||
MISSILE_WEAPON = 11 // Cannot be set; returns 1 if wearing a missile
|
||||
// or (good) thrown weapon, 0 otherwise.
|
||||
};
|
||||
|
||||
|
||||
// NPC attack behaviours. Retrieve and set using UI_set_attack_mode(npc, mode)
|
||||
// and UI_get_attack_mode(npc).
|
||||
enum npc_attack_modes
|
||||
{
|
||||
NEAREST = 0,
|
||||
WEAKEST = 1,
|
||||
STRONGEST = 2,
|
||||
BERSERK = 3,
|
||||
PROTECT = 4,
|
||||
DEFEND = 5,
|
||||
FLANK = 6,
|
||||
FLEE = 7,
|
||||
RANDOM = 8,
|
||||
MANUAL = 9
|
||||
};
|
||||
|
||||
/*
|
||||
* Failure cursor constants for use with UI_flash_mouse. Note that these do not
|
||||
* correspond to frame numbers in pointers.uc, but to some internal mapping.
|
||||
* (the "BLOCKED" cursor seems to be unavailable through this method.)
|
||||
*/
|
||||
enum cursors
|
||||
{
|
||||
CURSOR_X = 1, //Default "no you can't do that" X cursor
|
||||
CURSOR_OUT_OF_RANGE = 2,
|
||||
CURSOR_OUT_OF_AMMO = 3,
|
||||
CURSOR_TOO_HEAVY = 4,
|
||||
CURSOR_WONT_FIT = 5
|
||||
};
|
||||
|
||||
enum egg_states
|
||||
{
|
||||
CACHED_IN = 0, // Activated when chunk read in?
|
||||
PARTY_NEAR = 1,
|
||||
AVATAR_NEAR = 2, // Avatar steps into area.
|
||||
AVATAR_FAR = 3, // Avatar steps outside area.
|
||||
AVATAR_FOOTPAD = 4, // Avatar must step on it.
|
||||
PARTY_FOOTPAD = 5,
|
||||
SOMETHING_ON = 6, // Something placed on/near it.
|
||||
EXTERNAL_CRITERIA = 7 // Appears on Isle of Avatar. Guessing
|
||||
};
|
||||
|
||||
//NPC atitudes toward the avatar
|
||||
enum alignments
|
||||
{
|
||||
NEUTRAL = 0,
|
||||
GOOD = 1,
|
||||
EVIL = 2,
|
||||
CHAOTIC = 3
|
||||
};
|
||||
|
||||
enum weather_types
|
||||
{
|
||||
CLEAR_WEATHER = 0,
|
||||
SNOWING = 1, //Unsure; in Exult, works the same as RAIN, below and seems identical to RAIN in the originals
|
||||
RAIN = 2,
|
||||
SPARKLE = 3, //Prevents casting of spells in BG (and maybe SI too?)
|
||||
FOG = 4, //Seems to work like RAIN in the originals
|
||||
OVERCAST = 5, //Seems to clear weather in the originals
|
||||
CLOUDY = 6
|
||||
};
|
||||
|
||||
//Mask values used (e.g.) in find_nearby intrinsic; these are flags, which mean
|
||||
//that they can be added together
|
||||
enum item_masks
|
||||
{
|
||||
MASK_NONE = 0x0,
|
||||
MASK_NPC = 0x04,
|
||||
MASK_NPC2 = 0x08, //Maybe non-party NPCs only? All NPCs in Exult
|
||||
MASK_EGG = 0x10, //Also for barges
|
||||
MASK_INVISIBLE = 0x20,
|
||||
MASK_PARTY_INVISIBLE = 0x40,
|
||||
MASK_TRANSLUCENT = 0x80,
|
||||
MASK_ALL_UNSEEN = 0xB0 //MASK_EGG+MASK_INVISIBLE+MASK_TRANLUCENT
|
||||
};
|
||||
|
||||
//NPC animation frames, WITH rotation bit. Use these with UI_set_item_frame_rot
|
||||
//or (preferably) in script blocks, with 'frame'.
|
||||
//e.g.: script AVATAR { frame STAND_WEST; frame USE_NORTH; frame SWING_1_SOUTH; frame STAND_EAST; }
|
||||
enum npc_rot_frames
|
||||
{
|
||||
STAND_NORTH = 0x0000,
|
||||
WALK_1_NORTH = 0x0001,
|
||||
WALK_2_NORTH = 0x0002,
|
||||
USE_NORTH = 0x0003,
|
||||
SWING_1_NORTH = 0x0004,
|
||||
SWING_2_NORTH = 0x0005,
|
||||
SWING_3_NORTH = 0x0006,
|
||||
SWING_2H_1_NORTH = 0x0007,
|
||||
SWING_2H_2_NORTH = 0x0008,
|
||||
SWING_2H_3_NORTH = 0x0009,
|
||||
SIT_NORTH = 0x000A,
|
||||
LEAN_NORTH = 0x000B,
|
||||
KNEEL_NORTH = 0x000C,
|
||||
LIE_NORTH = 0x000D,
|
||||
CAST_1_NORTH = 0x000E,
|
||||
CAST_2_NORTH = 0x000F,
|
||||
STAND_SOUTH = 0x0010,
|
||||
WALK_1_SOUTH = 0x0011,
|
||||
WALK_2_SOUTH = 0x0012,
|
||||
USE_SOUTH = 0x0013,
|
||||
SWING_1_SOUTH = 0x0014,
|
||||
SWING_2_SOUTH = 0x0015,
|
||||
SWING_3_SOUTH = 0x0016,
|
||||
SWING_2H_1_SOUTH = 0x0017,
|
||||
SWING_2H_2_SOUTH = 0x0018,
|
||||
SWING_2H_3_SOUTH = 0x0019,
|
||||
SIT_SOUTH = 0x001A,
|
||||
LEAN_SOUTH = 0x001B,
|
||||
KNEEL_SOUTH = 0x001C,
|
||||
LIE_SOUTH = 0x001D,
|
||||
CAST_1_SOUTH = 0x001E,
|
||||
CAST_2_SOUTH = 0x001F,
|
||||
STAND_WEST = 0x0020,
|
||||
WALK_1_WEST = 0x0021,
|
||||
WALK_2_WEST = 0x0022,
|
||||
USE_WEST = 0x0023,
|
||||
SWING_1_WEST = 0x0024,
|
||||
SWING_2_WEST = 0x0025,
|
||||
SWING_3_WEST = 0x0026,
|
||||
SWING_2H_1_WEST = 0x0027,
|
||||
SWING_2H_2_WEST = 0x0028,
|
||||
SWING_2H_3_WEST = 0x0029,
|
||||
SIT_WEST = 0x002A,
|
||||
LEAN_WEST = 0x002B,
|
||||
KNEEL_WEST = 0x002C,
|
||||
LIE_WEST = 0x002D,
|
||||
CAST_1_WEST = 0x002E,
|
||||
CAST_2_WEST = 0x002F,
|
||||
STAND_EAST = 0x0030,
|
||||
WALK_1_EAST = 0x0031,
|
||||
WALK_2_EAST = 0x0032,
|
||||
USE_EAST = 0x0033,
|
||||
SWING_1_EAST = 0x0034,
|
||||
SWING_2_EAST = 0x0035,
|
||||
SWING_3_EAST = 0x0036,
|
||||
SWING_2H_1_EAST = 0x0037,
|
||||
SWING_2H_2_EAST = 0x0038,
|
||||
SWING_2H_3_EAST = 0x0039,
|
||||
SIT_EAST = 0x003A,
|
||||
LEAN_EAST = 0x003B,
|
||||
KNEEL_EAST = 0x003C,
|
||||
LIE_EAST = 0x003D,
|
||||
CAST_1_EAST = 0x003E,
|
||||
CAST_2_EAST = 0x003F
|
||||
};
|
||||
|
||||
enum damage_types
|
||||
{
|
||||
NORMAL_DAMAGE = 0,
|
||||
FIRE_DAMAGE = 1,
|
||||
MAGIC_DAMAGE = 2,
|
||||
LIGHTNING_DAMAGE = 3,
|
||||
ETHEREAL_DAMAGE = 4,
|
||||
SONIC_DAMAGE = 5
|
||||
};
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006-2009 The Exult Team/Team TFL
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This header file contains several more constants used throughout usecode.
|
||||
* Specifically, it has constants for several sprite animations and sounds, as
|
||||
* well as some faces.
|
||||
*/
|
||||
|
||||
// Title: Constants 2
|
||||
// This header file defines general constants used throughout usecode, for
|
||||
// Black Gate and Serpent Isle. Constants particular to a function can be
|
||||
// found in the relevant codefile; constants particular to a game can be
|
||||
// found in that game's header directory.
|
||||
//
|
||||
// *Author:* Marzo Junior (marzojr at yahoo dot com)
|
||||
// with modifications by Peter M Dodge (twicescorned at gmail dot com)
|
||||
//
|
||||
// *Last modified:* 2009-01-31
|
||||
|
||||
// Enum: spite_effects
|
||||
// Various sprite effect references to sprites in sprites.vga for spell effects etc.
|
||||
//
|
||||
// ANIMATION_BIG_BLAST = 1 - The mother of all blast effects.
|
||||
// ANIMATION_CLOUDS = 3 - Overlay sprite for overcast cloud shadows.
|
||||
// ANIMATION_MEDIUM_BLAST = 4 - A large blast effect.
|
||||
// ANIMATION_SMALL_BLAST = 5 - A small blast effect.
|
||||
// ANIMATION_TELEPORT = 7 - Magical teleportation effect.
|
||||
// ANIMATION_DEATH_VORTEX = 8 - Effect for the death vortex spell.
|
||||
// ANIMATION_POOF = 9 - Little poof of smoke effect to show spell failure.
|
||||
// ANIMATION_FIREWORKS = 12 - From the fireworks spell.
|
||||
// ANIMATION_GREEN_BUBBLES = 13 - Odd little green bubles sprite used as an effect.
|
||||
// ANIMATION_CIRCLE_BARRIER = 15 - Unsure?
|
||||
// ANIMATION_LIGHTNING = 17 - Lightning, from storms or spells.
|
||||
// ANIMATION_BLUE_BEADS = 18 - Odd little blue beads sprite used as an effect.
|
||||
// ANIMATION_PURPLE_BUBBLES = 21 - Odd little purple bubbles sprite used as an effect.
|
||||
// ANIMATION_MUSIC = 24 - Little musical notes, such as from music box, to indicate
|
||||
// music playing visually.
|
||||
enum sprite_effects
|
||||
{
|
||||
ANIMATION_BIG_BLAST = 1,
|
||||
ANIMATION_CLOUDS = 3,
|
||||
ANIMATION_MEDIUM_BLAST = 4,
|
||||
ANIMATION_SMALL_BLAST = 5,
|
||||
ANIMATION_TELEPORT = 7,
|
||||
ANIMATION_DEATH_VORTEX = 8,
|
||||
ANIMATION_POOF = 9,
|
||||
ANIMATION_FIREWORKS = 12,
|
||||
ANIMATION_GREEN_BUBBLES = 13,
|
||||
ANIMATION_CIRCLE_BARRIER = 15,
|
||||
ANIMATION_LIGHTNING = 17,
|
||||
ANIMATION_BLUE_BEADS = 18,
|
||||
ANIMATION_PURPLE_BUBBLES = 21,
|
||||
ANIMATION_MUSIC = 24
|
||||
};
|
||||
|
||||
// Enum: sound_effects
|
||||
// Some sound effects often referenced in usecode. Not a complete or exhaustive
|
||||
// list by any means.
|
||||
//
|
||||
// SOUND_BLAST = 8 - Fireball spell sound effect.
|
||||
// SOUND_BIG_BLAST = 9 - Explosion spell sound effect.
|
||||
// SOUND_MOONGATE = 11 - Moongate raising sound effect. 00x000B
|
||||
// SOUND_BOOK = 14 - Apparently sounds like a book? Either way, the effect
|
||||
// when the book gump displays. 0x00E
|
||||
// SOUND_KEY = 27 - Sound made by keys when you use them. "Click"
|
||||
// SOUND_GLASS_SHATTER = 37 - Glass breaking sound effect. 0x25
|
||||
// SOUND_HIT = 62 - Something getting hit in combat. 0x003E
|
||||
// SOUND_TELEPORT = 72 - Teleportation sound effect.
|
||||
enum sound_effects
|
||||
{
|
||||
SOUND_BLAST = 8,
|
||||
SOUND_BIG_BLAST = 9,
|
||||
//SOUND_MOONGATE = 11, //Active elsehwere in my code so commented this out.
|
||||
SOUND_BOOK = 14,
|
||||
SOUND_KEY = 27,
|
||||
SOUND_GLASS_SHATTER = 37,
|
||||
SOUND_HIT = 62,
|
||||
SOUND_TELEPORT = 72
|
||||
};
|
||||
|
||||
// Enum: faces
|
||||
// Some faces referenced in usecode.
|
||||
//
|
||||
// DRACOTHRAXUS_FACE = -293 - Unsure, too lazy to check.
|
||||
// BLACK_SWORD_FACE = -292 - Black sword graphic.
|
||||
// ARCADION_GEM_FACE = -291 - Arcadion in the soul gem.
|
||||
// ARCADION_MIRROR_FACE = -290 - Arcadion in the mirror.
|
||||
// ERETHIAN_FACE = -286 - Erethian.
|
||||
enum faces
|
||||
{
|
||||
DRACOTHRAXUS_FACE = -293,
|
||||
BLACK_SWORD_FACE = -292,
|
||||
ARCADION_GEM_FACE = -291,
|
||||
ARCADION_MIRROR_FACE = -290,
|
||||
ERETHIAN_FACE = -286
|
||||
};
|
||||
@@ -0,0 +1,906 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 Alun Bestor/The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This header file defines generic helper functions added to the original.
|
||||
*
|
||||
* Author: Alun Bestor (exult@washboardabs.net)
|
||||
* Modified by Exult Team
|
||||
* Last modified: 2006-03-19
|
||||
*/
|
||||
|
||||
//Generic functions
|
||||
//-----------------
|
||||
|
||||
//returns a random entry from an array
|
||||
var randomIndex(var array)
|
||||
{
|
||||
var size = UI_get_array_size(array);
|
||||
var rand = UI_get_random(size);
|
||||
return array[rand];
|
||||
}
|
||||
|
||||
var getSixth(var array)
|
||||
{
|
||||
return array[6];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//checks to see if anyone in the party is poisoned
|
||||
var getPoisoned()
|
||||
{
|
||||
var partymember;
|
||||
var party = partymember->get_party_list();
|
||||
var npc;
|
||||
var poisoned_party;
|
||||
var npcname;
|
||||
var npc_num;
|
||||
var party_member;
|
||||
var party_number;
|
||||
|
||||
|
||||
|
||||
for (partymember in party with index)
|
||||
{
|
||||
|
||||
UI_error_message("npc num is: " + npc_num);
|
||||
// UI_error_message("poisoned party is: " + npc);
|
||||
if (UI_get_item_flag(npc, POISONED))
|
||||
{
|
||||
|
||||
poisoned_party = npc->get_npc_object();
|
||||
return poisoned_party;
|
||||
}
|
||||
else
|
||||
return poisoned_party;
|
||||
UI_error_message("poisoned party is: " + npc);
|
||||
}
|
||||
UI_error_message("Poisoned party member is: " + poisoned_party);
|
||||
|
||||
}
|
||||
|
||||
void freezeAvatar object# () ()
|
||||
{
|
||||
UI_set_item_flag(AVATAR, BG_DONT_MOVE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void unfreezeAvatar object# () ()
|
||||
{
|
||||
UI_clear_item_flag(AVATAR, BG_DONT_MOVE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//NPC-related functions
|
||||
//---------------------
|
||||
|
||||
//Returns true if the specified object is the avatar, false otherwise.
|
||||
var isAvatar(var object) { return (object->get_npc_object() == UI_get_avatar_ref()); }
|
||||
|
||||
//Check if the player has met the specified person (i.e. whether their Met flag has been set).
|
||||
//Can take either an NPC constant or an object reference.
|
||||
var hasMet(var npc) { return npc->get_item_flag(MET); }
|
||||
|
||||
//Returns true if the specified NPC is in the party, false otherwise
|
||||
//There should be an intrinsic for this, but it doesn't appear to be defined
|
||||
//Can take an NPC constant or an object reference.
|
||||
var inParty(var npc) { npc = npc->get_npc_object(); return (npc in UI_get_party_list()); }
|
||||
|
||||
//quick bark/say functions, useful for testing. See also randomPartySay() and randomPartyBark() (original functions)
|
||||
var avatarBark(var line) { if (canTalk(AVATAR)) AVATAR->item_say(line); }
|
||||
var avatarSay(var line) { if (canTalk(AVATAR)) AVATAR.say(line); }
|
||||
|
||||
|
||||
//Moving-stuff-around functions
|
||||
//-----------------------------
|
||||
|
||||
//Shift an object into a container (can be from another container or the world)
|
||||
var moveToContainer(var object, var container, var dont_check_ownership)
|
||||
{
|
||||
var orig_pos;
|
||||
var orig_container;
|
||||
|
||||
//record the previous container
|
||||
orig_container = object->get_container();
|
||||
//object was in the world - record its last position
|
||||
if (!orig_container) orig_pos = object->get_object_position();
|
||||
|
||||
//could not remove the item (protected?)
|
||||
if (!object->set_last_created()) return false;
|
||||
|
||||
//try to put the item into the new container
|
||||
if (container->give_last_created())
|
||||
{
|
||||
//check if the item was stolen, unless overridden
|
||||
if (!dont_check_ownership) stealItem(object);
|
||||
return true;
|
||||
}
|
||||
//if it couldn't be put into the new container, just put it back in the original container along with a mouse warning
|
||||
else
|
||||
{
|
||||
if (orig_container) { orig_container->give_last_created(); }
|
||||
else { UI_update_last_created(orig_pos); }
|
||||
|
||||
//UI_flash_mouse(4);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Opposite of moveToContainer: tries to place the item at the specified location, or returns it to its previous location/container if that couldn't be done.
|
||||
var moveToLocation(var object, var pos)
|
||||
{
|
||||
var orig_pos;
|
||||
var orig_container;
|
||||
|
||||
//record the previous container
|
||||
orig_container = object->get_container();
|
||||
//object was in the world - record its last position
|
||||
if (!orig_container) orig_pos = object->get_object_position();
|
||||
|
||||
//could not remove the item (protected?)
|
||||
if (!object->set_last_created()) return false;
|
||||
|
||||
//try to shift the item
|
||||
if (UI_update_last_created(pos)) return true;
|
||||
|
||||
//if it couldn't be moved, just put it back in the original container/location along with a mouse warning
|
||||
else
|
||||
{
|
||||
if (orig_container) { orig_container->give_last_created(); }
|
||||
else { UI_update_last_created(orig_pos); }
|
||||
|
||||
UI_flash_mouse(CURSOR_WONT_FIT);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//generic get-item-from-container/world script, used by item interactions. It is used at the end of a march-to-container script, to play an appropriate animation and transfer the item into the player's inventory.
|
||||
//once the item has been picked up, it will call the item's function with event = SCRIPTED.
|
||||
void pickUpItem object#() ()
|
||||
{
|
||||
var container = getOuterContainer(item);
|
||||
var direction = directionFromAvatar(container);
|
||||
|
||||
//The avatar is already carrying the item, call the function immediately and leave it at that
|
||||
//This shouldn't happen, since gotoAndGet() will have picked up this case already - however, it could be the player drags the item into their inventory while walking, so...
|
||||
if (isAvatar(container))
|
||||
{
|
||||
//The brief delay is present in the original scripts, and is purely cosmetic.
|
||||
script item { nohalt; wait 1; call get_usecode_fun(); }
|
||||
}
|
||||
else
|
||||
{
|
||||
//container is an NPC, animate the avatar frobbing the target
|
||||
if (container->is_npc())
|
||||
{
|
||||
script AVATAR
|
||||
{ face direction; actor frame ready;
|
||||
wait 3; actor frame standing;}
|
||||
}
|
||||
//container is a regular object or just the world, animate the avatar leaning down
|
||||
else
|
||||
{
|
||||
script AVATAR
|
||||
{ face direction; actor frame bowing;
|
||||
wait 3; actor frame standing;}
|
||||
}
|
||||
|
||||
//Puts the item in the player's inventory and calls the intended function
|
||||
script item
|
||||
{ nohalt; wait 3;
|
||||
call giveToAvatar; wait 2;
|
||||
call get_usecode_fun();}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Pathfind to the target item and pick it up once you get there (using pickUpItem). After this has happened, the item's function will be called with event = SCRIPTED. This is commonly used for item interactions that require the Avatar to be carrying the item first.
|
||||
void gotoAndGet (var target)
|
||||
{
|
||||
var offsetx;
|
||||
var offsety;
|
||||
var container;
|
||||
var func;
|
||||
|
||||
UI_close_gumps();
|
||||
|
||||
//item is contained by someone/thing - march the avatar over to the container and pick it up
|
||||
if (target->get_container())
|
||||
{
|
||||
container = getOuterContainer(target);
|
||||
//Avatar is the container - call the target's function immediately.
|
||||
if (isAvatar(container))
|
||||
{
|
||||
script target { nohalt; wait 1; call target->get_usecode_fun(); }
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
offsetx = [0, 1, -1, 1];
|
||||
offsety = [2, 1, 2, 0];
|
||||
|
||||
gotoObject(container, offsetx, offsety, -3, pickUpItem, target, 2);
|
||||
}
|
||||
}
|
||||
//item was lying on the ground
|
||||
else
|
||||
{
|
||||
offsetx = [0, 1, 1, 1, -1, -1, 0, -1];
|
||||
offsety = [1, 1, 0, -1, 1, 0, -1, -1];
|
||||
|
||||
//go to item and call result function
|
||||
//(func = pickUpItem())...which means I need to go and define bloody numbers again
|
||||
gotoObject(target, offsetx, offsety, -3, pickUpItem, target, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Pathfind to the target item and pick it up once you get there (using pickUpItem). After this has happened, the item's function will be called with event = SCRIPTED. This is commonly used for item interactions that require the Avatar to be carrying the item first.
|
||||
void gotoAndGet2 (var npc, var target)
|
||||
{
|
||||
var offsetx;
|
||||
var offsety;
|
||||
var container;
|
||||
var func;
|
||||
|
||||
UI_close_gumps();
|
||||
|
||||
//item is contained by someone/thing - march the avatar over to the container and pick it up
|
||||
if (target->get_container())
|
||||
{
|
||||
container = getOuterContainer(target);
|
||||
//Avatar is the container - call the target's function immediately.
|
||||
if (isAvatar(container))
|
||||
{
|
||||
script target { nohalt; wait 1; call target->get_usecode_fun(); }
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
offsetx = [0, 1, -1, 1];
|
||||
offsety = [2, 1, 2, 0];
|
||||
|
||||
gotoObject(container, offsetx, offsety, -3, pickUpItem, target, 2);
|
||||
}
|
||||
}
|
||||
//item was lying on the ground
|
||||
else
|
||||
{
|
||||
offsetx = [0, 1, 1, 1, -1, -1, 0, -1];
|
||||
offsety = [1, 1, 0, -1, 1, 0, -1, -1];
|
||||
|
||||
//go to item and call result function
|
||||
//(func = pickUpItem())...which means I need to go and define bloody numbers again
|
||||
gotoObject(target, offsetx, offsety, -3, pickUpItem, target, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//returns true if obj is contained by target, or false otherwise
|
||||
var containedBy (var obj, var target)
|
||||
{
|
||||
var container;
|
||||
|
||||
container = obj->get_container();
|
||||
while (container)
|
||||
{
|
||||
if (container == target) return true;
|
||||
container = container->get_container();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//Animation functions
|
||||
//-------------------
|
||||
|
||||
//returns the direction (N/S/W/E) that the NPC is currently facing
|
||||
var getFacing (var npc)
|
||||
{
|
||||
var direction;
|
||||
var framenum;
|
||||
|
||||
framenum = npc->get_item_frame_rot();
|
||||
|
||||
if (framenum >= EAST_FRAMESET) direction = EAST;
|
||||
else if (framenum >= WEST_FRAMESET) direction = WEST;
|
||||
else if (framenum >= SOUTH_FRAMESET) direction = SOUTH;
|
||||
else direction = NORTH;
|
||||
|
||||
return direction;
|
||||
}
|
||||
|
||||
|
||||
/*//DISABLED FOR NOW
|
||||
void bellringer object#() ()
|
||||
{
|
||||
var hour = UI_game_hour()-1;
|
||||
var minute = UI_game_minute();
|
||||
var frame = UI_get_item_frame(DAVER);
|
||||
var schedule = UI_get_schedule_type(DAVER);
|
||||
var bell = UI_find_nearest(item, SHAPE_BELL, 30);
|
||||
|
||||
|
||||
if ((event == EGG) && (isNearby(DAVER)))
|
||||
{
|
||||
if (frame != 16)
|
||||
UI_set_item_frame(DAVER, 16);
|
||||
|
||||
if (minute == 00)
|
||||
{
|
||||
script bell
|
||||
{
|
||||
nohalt;
|
||||
frame 0;
|
||||
repeat hour //should repeat 1 time per hour
|
||||
{
|
||||
repeat 7
|
||||
{
|
||||
next frame cycle;
|
||||
|
||||
};
|
||||
sfx 19;
|
||||
};
|
||||
wait 15;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
script item after 30 ticks
|
||||
{
|
||||
|
||||
call bellringer;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
abort;
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
//Simple function to reverse a direction (NORTH becomes SOUTH, etc.)
|
||||
var invertDirection (var direction) { return (direction + 4) % 8; }
|
||||
|
||||
//Gold-related functions (for streamlining shopping)
|
||||
//--------------------------------------------------
|
||||
|
||||
//returns the total amount of gold the party has
|
||||
var countGold (var amount) { return PARTY->count_objects(SHAPE_GOLD, QUALITY_ANY, FRAME_ANY); }
|
||||
|
||||
//returns true if the party has <amount> gold, false otherwise
|
||||
var hasGold (var amount)
|
||||
{
|
||||
var num_gold = PARTY->count_objects(SHAPE_GOLD, QUALITY_ANY, FRAME_ANY);
|
||||
return (num_gold >= amount);
|
||||
}
|
||||
|
||||
//tries to deduct <amount> from the party's gold: returns true if they had the cash, or false if they can't afford it
|
||||
var chargeGold (var amount)
|
||||
{
|
||||
if (hasGold(amount)) return UI_remove_party_items(amount, SHAPE_GOLD, QUALITY_ANY, FRAME_ANY, true);
|
||||
else return false;
|
||||
}
|
||||
|
||||
//give <amount> gold to the party: returns true if successful, false otherwise
|
||||
var giveGold (var amount) { return UI_add_party_items(amount, SHAPE_GOLD, QUALITY_ANY, FRAME_ANY, true); }
|
||||
|
||||
|
||||
|
||||
//Script-related functions (used in script{} blocks)
|
||||
//--------------------------------------------------
|
||||
//Note that these functions cannot be passed any arguments, which is why they perform a specific action upon <item>.
|
||||
|
||||
//use during script sequences, to prevent the actor from moving according to schedule or player input
|
||||
//IMPORTANT: Use nohalt; in these script sequences, otherwise the actor may remain frozen forever if the script is interrupted!
|
||||
void GenericFreeze object#() () { set_item_flag(BG_DONT_MOVE); }
|
||||
void GenericUnfreeze object#() () { clear_item_flag(BG_DONT_MOVE); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
void monsterStats (var monster, var stats)
|
||||
{
|
||||
var stat_value;
|
||||
//IDs of the properties to set:
|
||||
var stat_ids = [STRENGTH, DEXTERITY, INTELLIGENCE, HEALTH, COMBAT];
|
||||
for (statnum in stat_ids)
|
||||
{
|
||||
//For each stat in the array, set the monster's attribute:
|
||||
stat_value = monster->get_npc_prop(statnum + 1);
|
||||
monster->set_npc_prop(statnum + 1, stats[statnum + 1] - stat_value);
|
||||
}
|
||||
}
|
||||
|
||||
void monsterEquipment (var monster, var arms, var arms_quality, var pouch_content, var pouch_frames, var pouch_quantities, var pouch_qualities)
|
||||
{
|
||||
var bag;
|
||||
var new_obj;
|
||||
var index;
|
||||
|
||||
// for (itemnum in arms with counterindex)
|
||||
{
|
||||
//For each item in arms,
|
||||
//increment counter:
|
||||
//index = index + 1;
|
||||
//Create the object:
|
||||
new_obj = UI_create_new_object(itemnum);
|
||||
//Set quality:
|
||||
new_obj->set_item_quality(arms_quality[index]);
|
||||
//Give to monster:
|
||||
monster->give_last_created();
|
||||
}
|
||||
|
||||
//Create a backpack:
|
||||
bag = UI_create_new_object(SHAPE_BACKPACK);
|
||||
//Give to monster:
|
||||
monster->give_last_created();
|
||||
//Reset counter:
|
||||
index = 0;
|
||||
while (index < UI_get_array_size(pouch_content))
|
||||
{
|
||||
//For each object in the array,
|
||||
//increment counter:
|
||||
index = index + 1;
|
||||
//Create object:
|
||||
new_obj = UI_create_new_object(pouch_content[index]);
|
||||
//Set frame:
|
||||
new_obj->set_item_frame(pouch_frames[index]);
|
||||
if (pouch_quantities[index] > 1)
|
||||
//Set quantity where available:
|
||||
new_obj->set_item_quantity(pouch_quantities[index]);
|
||||
//Set quality:
|
||||
new_obj->set_item_quality(pouch_qualities[index]);
|
||||
//Put in the backpack:
|
||||
bag->give_last_created();
|
||||
}
|
||||
}
|
||||
|
||||
var monsterCreate (var shapenum, var npcid, var pos, var facedir, var stats, var arms, var arms_quality, var pouch_content, var pouch_frames, var pouch_quantities, var pouch_qualities)
|
||||
{
|
||||
//Create the monster:
|
||||
var monster = UI_create_new_object(shapenum);
|
||||
//Initially set monster to be neutral:
|
||||
monster->set_alignment(1);
|
||||
//Have the monster be in WAIT mode:
|
||||
monster->set_schedule_type(WAIT);
|
||||
//Make him temporary:
|
||||
monster->set_item_flag(TEMPORARY);
|
||||
|
||||
|
||||
//Set the monster's attributes:
|
||||
monsterStats(monster, stats);
|
||||
//Give him some equipment:
|
||||
monsterEquipment(monster, arms, arms_quality, pouch_content, pouch_frames, pouch_quantities, pouch_qualities);
|
||||
//Set NPC ID to requested value:
|
||||
monster->set_npc_id(npcid);
|
||||
|
||||
|
||||
//Set monster as last created:
|
||||
monster->set_last_created();
|
||||
//Update monster to desired spot:
|
||||
UI_update_last_created(pos);
|
||||
//Have monster face desired direction:
|
||||
script monster face facedir;
|
||||
return monster;
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
//Functions added by DB//
|
||||
//---------------------------------------------------
|
||||
|
||||
var isWearingAmulet()
|
||||
{
|
||||
if (UI_is_readied(AVATAR, BG_AMULET, SHAPE_AMULET_SUBMISSION, FRAME_ANY))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var throwRandomBottle(var target) //location passed to function
|
||||
{
|
||||
var rand_bottle = UI_die_roll(6, 12); //for bottle frames
|
||||
var rand_booze = UI_die_roll(8, 15); //for booze frames
|
||||
|
||||
var bottle = UI_create_new_object(SHAPE_BOTTLE);
|
||||
bottle->UI_set_item_frame(rand_bottle);
|
||||
bottle->update_last_created([target]);
|
||||
|
||||
|
||||
var booze = UI_create_new_object(912); //for booze splotch (blood shape)
|
||||
booze->set_item_frame(rand_booze);
|
||||
booze->update_last_created([target]);
|
||||
UI_play_sound_effect(37);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
var getExpLevel(var npc)
|
||||
{
|
||||
var level;
|
||||
var current_experience = UI_get_npc_prop(npc, EXPERIENCE);
|
||||
|
||||
if ((current_experience > 0) && (current_experience < 100))
|
||||
{
|
||||
level = 1;
|
||||
return level;
|
||||
}
|
||||
else
|
||||
if ((current_experience >= 100) && (current_experience < 200))
|
||||
{
|
||||
level = 2;
|
||||
return level;
|
||||
}
|
||||
else
|
||||
if ((current_experience >= 200) && (current_experience < 400))
|
||||
{
|
||||
level = 3;
|
||||
return level;
|
||||
}
|
||||
else
|
||||
if ((current_experience >= 400) && (current_experience < 800))
|
||||
{
|
||||
level = 4;
|
||||
return level;
|
||||
}
|
||||
else
|
||||
if ((current_experience >= 800) && (current_experience < 1600))
|
||||
{
|
||||
level = 5;
|
||||
return level;
|
||||
}
|
||||
else
|
||||
if ((current_experience >= 1600) && (current_experience < 3200))
|
||||
{
|
||||
level = 6;
|
||||
return level;
|
||||
}
|
||||
else
|
||||
if ((current_experience >= 3200) && (current_experience < 6400))
|
||||
{
|
||||
level = 7;
|
||||
return level;
|
||||
}
|
||||
else
|
||||
if (current_experience >= 6400)
|
||||
{
|
||||
level = 8; //no spells above 8 so it doesn't matter
|
||||
return level;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
var hasSpell(var spell) //used to check if certain spell in spellbook in AVATAR's inventory
|
||||
{
|
||||
var spellbook = UI_find_object(AVATAR, 761, QUALITY_ANY, FRAME_ANY); //makes sure Avatar has spellbook
|
||||
|
||||
return UI_has_spell(spellbook, spell);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var daypart(var part_of_day)
|
||||
{
|
||||
|
||||
var hour = UI_game_hour();
|
||||
|
||||
if ((hour >= 6) && (hour < 12)) //'good morning'
|
||||
{
|
||||
return "morning";
|
||||
//return time_of_day;
|
||||
}
|
||||
else if ((hour >= 12) && (hour < 18)) //'good afternoon'
|
||||
{
|
||||
part_of_day = "afternoon";
|
||||
return "afternoon";
|
||||
}
|
||||
else
|
||||
part_of_day = "evening";
|
||||
return part_of_day;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Sank object# () ()
|
||||
{
|
||||
var raft = UI_find_nearby_avatar(SHAPE_RAFT);
|
||||
var barge = get_barge();
|
||||
var npc;
|
||||
var party = UI_get_party_list();
|
||||
|
||||
UI_halt_scheduled(raft); //should stop any other scripts from running
|
||||
|
||||
UI_remove_item(raft);
|
||||
UI_remove_item(barge);
|
||||
|
||||
|
||||
|
||||
UI_clear_item_flag(AVATAR, SAILOR);
|
||||
UI_clear_item_flag(AVATAR, ON_MOVING_BARGE);
|
||||
UI_clear_item_flag(AVATAR, IN_MOTION);
|
||||
|
||||
UI_kill_npc(AVATAR);
|
||||
UI_clear_item_flag(AVATAR, BG_DONT_MOVE);
|
||||
|
||||
UI_set_npc_id(SMITH, 0); //resets SMITH's ID for warning level 0.
|
||||
|
||||
}
|
||||
|
||||
void Sinking object# () ()
|
||||
{
|
||||
var raft = UI_find_nearby_avatar(SHAPE_RAFT);
|
||||
var barge = get_barge();
|
||||
var npc;
|
||||
var party = UI_get_party_list();
|
||||
|
||||
|
||||
UI_set_item_flag(AVATAR, BG_DONT_MOVE);
|
||||
UI_halt_scheduled(raft);
|
||||
|
||||
UI_earthquake(40); //change if need be
|
||||
|
||||
randomPartyBark("@We're sinking!!@");
|
||||
|
||||
for (npc in party)
|
||||
{
|
||||
script npc after 3 ticks
|
||||
{
|
||||
repeat 2
|
||||
{
|
||||
say "@Aiieeee!@"; wait 2; actor frame bowing; wait 1; actor frame kneeling; wait 1;
|
||||
actor frame standing; wait 2; actor frame LIE;
|
||||
actor frame LIE; wait 1;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
script raft after 20 ticks
|
||||
{
|
||||
sfx 25; wait 5; sfx 38; wait 1; sfx 25; wait 3;
|
||||
sfx 26; wait 3; sfx 26; wait 4; sfx 38; wait 2;
|
||||
sfx 40; wait 3; sfx 38; wait 2; sfx 40; wait 5;
|
||||
|
||||
call Sank;
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DeepWater object#() () //used to determine if raft is too far away from shore - in deep water.
|
||||
{
|
||||
var barge = get_barge();
|
||||
var surf = [612, 613, 632, 699, 736, 737, 751, 806, 834, 875, 907, 911, 918];
|
||||
var waves = [384, 985, 1008, 1009];
|
||||
var warning = UI_get_npc_id(SMITH); //warning level for raft. If too much time in deep water, raft will sink.
|
||||
var raft = UI_find_nearby_avatar(SHAPE_RAFT);
|
||||
|
||||
UI_error_message("Deep water script called"); //remove after testing
|
||||
UI_error_message("@Warning level is " + warning + "@");
|
||||
|
||||
if (warning >= 4)
|
||||
{
|
||||
script barge after 10 ticks
|
||||
{
|
||||
call Sinking;
|
||||
};
|
||||
}
|
||||
|
||||
if (UI_find_nearby(AVATAR, waves, 7, 0x10))
|
||||
{
|
||||
UI_set_npc_id(SMITH, warning + 1); //sets ID for warning level.
|
||||
UI_error_message("Waves are found"); //for testing
|
||||
//add various levels of warnings based on warning level.
|
||||
if (warning == 1)
|
||||
randomPartySay("@This raft isn't meant for deep ocean travel, we must turn back to shore!@");
|
||||
if (warning == 2)
|
||||
randomPartySay("@We must turn back now, the raft will break upon these waves!@");
|
||||
if (warning == 3)
|
||||
randomPartySay("@This raft isn't meant for deep ocean travel, we must turn back!@");
|
||||
if (warning >= 4)
|
||||
{
|
||||
randomPartySay("@The raft is breaking apart! We're going to sink!!@");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
script raft after 60 ticks
|
||||
{
|
||||
call DeepWater;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Eruption (var egg)
|
||||
{
|
||||
const int SPRITE_EXPLOSION = 1;
|
||||
const int SFX_ERUPT = 60;
|
||||
var avatar_distance = UI_get_distance(egg, AVATAR);
|
||||
|
||||
//determine if it explodes
|
||||
var rand = UI_get_random(100);
|
||||
UI_error_message("Volcano egg hatched: rand number is " + rand);
|
||||
|
||||
if (rand < 25)
|
||||
{
|
||||
UI_error_message("Rand numb was " + rand + ", volcano erupts");
|
||||
var target;
|
||||
|
||||
|
||||
//determine how many npcs are neaby
|
||||
var targets = UI_find_nearby(egg, SHAPE_ANY, 6, MASK_NPC2);
|
||||
|
||||
//exp effect
|
||||
|
||||
UI_obj_sprite_effect(egg, SPRITE_EXPLOSION, 0, 0, 0 ,0, 0, -1);
|
||||
|
||||
//play sound
|
||||
UI_play_sound_effect(SFX_ERUPT, item);
|
||||
|
||||
UI_earthquake(1);
|
||||
var count = 0;
|
||||
//apply damage
|
||||
for (target in targets)
|
||||
{
|
||||
count += 1;
|
||||
UI_error_message("Target " + count + ", is damaged!");
|
||||
var target_distance = UI_get_distance(egg, target);
|
||||
var damage_base = (50 / target_distance);
|
||||
UI_apply_damage(damage_base, 15, FIRE_DAMAGE, target);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// script egg after 50 ticks
|
||||
// {
|
||||
// call volcano;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern var getAvatarName 0x0908();
|
||||
extern var getNPCName 0x90F (var npc);
|
||||
extern var getNPCStat 0x910 (var npc, var stat);
|
||||
extern void trainStrength 0x914 (var npc, var delta);
|
||||
extern void trainDexterity 0x915 (var npc, var delta);
|
||||
extern void trainIntelligence 0x916 (var npc, var delta);
|
||||
extern void trainCombat 0x917 (var npc, var delta);
|
||||
extern void trainMagic 0x918 (var npc, var delta);
|
||||
extern var selectWhoTrains 0x920 ();
|
||||
extern var checkCanTrain 0x922 (var statArray, var goldCost, var npc, var numTraining);
|
||||
|
||||
void LoubetTrain 0x8D0 (var statArray, var goldCost)
|
||||
{
|
||||
var pronoun;
|
||||
var npc = selectWhoTrains();
|
||||
var name = getNPCName(npc);
|
||||
var verb = "feels";
|
||||
var avname = getAvatarName();
|
||||
var pronoun2;
|
||||
var title;
|
||||
var possessive;
|
||||
if (name == avname)
|
||||
{
|
||||
|
||||
if (!gflags[TRAINED_WITH_LOUBET])
|
||||
{
|
||||
gflags[TRAINED_WITH_LOUBET] = true;
|
||||
}
|
||||
name = "you";
|
||||
pronoun = "you";
|
||||
pronoun2 = "you";
|
||||
verb = "feel";
|
||||
}
|
||||
else
|
||||
{
|
||||
pronoun2 = "they";
|
||||
if (npc == JULIA || npc == JAANA|| npc == KATRINA || npc == LEODON || npc == LEONNA || npc == GWENNO || npc == KATRINA)
|
||||
{
|
||||
pronoun = "her";
|
||||
title = "madame";
|
||||
possessive = "she's";
|
||||
}
|
||||
else
|
||||
{
|
||||
pronoun = "him";
|
||||
title = "m'sieur";
|
||||
possessive = "he's";
|
||||
}
|
||||
}
|
||||
if (npc)
|
||||
{
|
||||
var ret = checkCanTrain(statArray, goldCost, npc, 3); //train points?
|
||||
if (ret == 0)
|
||||
say("@I am sorry, but thou dost not have enough experience to train at this time. Return at a later date and zen I would be most happy to give thee a lesson.@");
|
||||
else if (ret == 1)
|
||||
{
|
||||
var partyGold = UI_count_objects(PARTY, SHAPE_GOLD, QUALITY_ANY, FRAME_ANY);
|
||||
if (partyGold < goldCost)
|
||||
say("@Mon dieu! It seems that thou hast not enough gold. Do return when thou art a bit wealthier.@");
|
||||
}
|
||||
else if (ret == 2)
|
||||
say("@But no! You are too skilled, I 'ave nothing more to teach you!@"); //too skilled
|
||||
else
|
||||
{
|
||||
UI_remove_party_items(goldCost, SHAPE_GOLD, QUALITY_ANY, FRAME_ANY, true);
|
||||
say("Loubet takes your money then hands " + name + " a foil and a mask of golden mesh.*");
|
||||
say("He shows " + name + " the correct stance, then " + pronoun2 + " spar for a bit.*");
|
||||
say("Now ze off hand, " + title + "... Mon dieu, you are -how you say it?- ambidextrous! Very good, mah friend.@");
|
||||
say("M'sieur Loubet is a skilled teacher, and " + name + " " + verb + " like " + possessive + " really learned something.");
|
||||
|
||||
|
||||
if (getNPCStat(npc, DEXTERITY) < 30)
|
||||
trainDexterity(npc, 1);
|
||||
|
||||
if (getNPCStat(npc, COMBAT) < 30)
|
||||
trainCombat(npc, 2); //
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,266 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This source file contains some generic utility functions.
|
||||
*
|
||||
* Author: Marzo Junior
|
||||
* Last Modified: 2006-02-27
|
||||
*/
|
||||
|
||||
//Finds a temporary NPC from a given shape and NPC id.
|
||||
var findNearbyMonsterWithID (var loc, var shp, var dist, var id)
|
||||
{
|
||||
var npcs = UI_find_nearby(loc, shp, dist, MASK_NONE);
|
||||
for (npc in npcs)
|
||||
if ((npc->get_npc_number() > 0) && (npc->get_npc_id() == id))
|
||||
return npc;
|
||||
}
|
||||
|
||||
//Sets BG_DONT_MOVE flag:
|
||||
void trueFreeze object#() () { set_item_flag(BG_DONT_MOVE); }
|
||||
//Clears BG_DONT_MOVE flag:
|
||||
void trueUnfreeze object#() () { clear_item_flag(BG_DONT_MOVE); }
|
||||
//Puts an NPC in casting mode:
|
||||
void showCastingFrames object#() () { begin_casting_mode(); }
|
||||
|
||||
void GenericUnfade object#() ()
|
||||
{
|
||||
UI_fade_palette(0, 0, true); //unfadefade from black
|
||||
|
||||
}
|
||||
|
||||
void freezeParty ()
|
||||
{
|
||||
//Get party list:
|
||||
var party = UI_get_party_list();
|
||||
//Random NPC for bark:
|
||||
var rand = UI_get_random(UI_get_array_size(party) - 1) + 1;
|
||||
for (member in party with index)
|
||||
{
|
||||
//For each NPC in party,
|
||||
//freeze NPC:
|
||||
member->trueFreeze();
|
||||
//This is the randomly chosen NPC which barks something:
|
||||
if (rand == index)
|
||||
script member {wait 4; say "@I am frozen in place!@";}
|
||||
}
|
||||
}
|
||||
|
||||
void unfreezeParty ()
|
||||
{
|
||||
//Get party list:
|
||||
var party = UI_get_party_list();
|
||||
for (member in party)
|
||||
//Unfreeze all party members:
|
||||
member->trueUnfreeze();
|
||||
}
|
||||
|
||||
var createContainerWithObjects (var cont_shape, var item_shapes, var item_frames, var item_quantity, var item_quality)
|
||||
{
|
||||
var shape_count = UI_get_array_size(item_shapes);
|
||||
var counter;
|
||||
var obj;
|
||||
|
||||
var num;
|
||||
var max;
|
||||
|
||||
//Create a container from the desired shape:
|
||||
var cont = UI_create_new_object(cont_shape);
|
||||
//Allow Avatar to take it without problems:
|
||||
cont->set_item_flag(OKAY_TO_TAKE);
|
||||
//Make it temporary:
|
||||
cont->set_item_flag(TEMPORARY);
|
||||
|
||||
while (counter < shape_count)
|
||||
{
|
||||
//Increment counter:
|
||||
counter = counter + 1;
|
||||
|
||||
if (item_quantity[counter])
|
||||
{
|
||||
//Create the object:
|
||||
obj = UI_create_new_object(item_shapes[counter]);
|
||||
|
||||
//Set its frame:
|
||||
obj->set_item_frame(item_frames[counter]);
|
||||
|
||||
//Set its quality
|
||||
obj->set_item_quality(item_quality[counter]);
|
||||
|
||||
//Make it okay to take and temporary:
|
||||
obj->set_item_flag(OKAY_TO_TAKE);
|
||||
obj->set_item_flag(TEMPORARY);
|
||||
|
||||
//Try to set quantity; if the item does not have a quantity,
|
||||
//the intrinsic will return 0:
|
||||
if (!obj->set_item_quantity(item_quantity[counter]))
|
||||
{
|
||||
//Since the item does not have a quantity, we have to create
|
||||
//each item individually.
|
||||
|
||||
//Place the last object in the container:
|
||||
cont->give_last_created();
|
||||
|
||||
//Repeat the creation-setting-giving proccess:
|
||||
num = 1;
|
||||
while (num < item_quantity[counter])
|
||||
{
|
||||
num = num + 1;
|
||||
obj = UI_create_new_object(item_shapes[counter]);
|
||||
obj->set_item_frame(item_frames[counter]);
|
||||
obj->set_item_quality(item_quality[counter]);
|
||||
obj->set_item_flag(OKAY_TO_TAKE);
|
||||
obj->set_item_flag(TEMPORARY);
|
||||
|
||||
//Place the last object in the container:
|
||||
cont->give_last_created();
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//The item has a quantity, and it has been correctly set.
|
||||
|
||||
//Place it in the container:
|
||||
cont->give_last_created();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return cont;
|
||||
}
|
||||
|
||||
void interjectIfPossible (var npcnum, var msg)
|
||||
{
|
||||
if (npcnum->npc_nearby())
|
||||
{
|
||||
var facenum = 0;
|
||||
/*
|
||||
* Note: Not all NPCs have their NPC # equal to their face number.
|
||||
* Here would be a good place to set the face number for these NPCs,
|
||||
* along the lines of
|
||||
* if (npcnum->get_item_shape() == 0x02EB)
|
||||
* npcnum = 0xFED6;
|
||||
* or maybe
|
||||
* if (npcnum == 0xFED6)
|
||||
* npcnum = 0xFEDA;
|
||||
* Also, specifying a different face here is a good idea if the NPC
|
||||
* should use a different face.
|
||||
*/
|
||||
|
||||
|
||||
npcnum->show_npc_face(facenum);
|
||||
if (npcnum->get_item_flag(CONFUSED))
|
||||
say("@Slurp@");
|
||||
else
|
||||
{
|
||||
for (lines in msg)
|
||||
say(lines);
|
||||
}
|
||||
npcnum.hide();
|
||||
}
|
||||
}
|
||||
|
||||
var forceGiveObjToParty (var obj)
|
||||
{
|
||||
//Get party list:
|
||||
var party = UI_get_party_list();
|
||||
//Set the desired object as being the last created:
|
||||
obj->set_last_created();
|
||||
for (npc in party)
|
||||
{
|
||||
//For each npc in the party,
|
||||
//try to give item to NPC:
|
||||
if (npc->give_last_created())
|
||||
{
|
||||
//If successful, see if it is the Avatar:
|
||||
if (npc != UI_get_avatar_ref())
|
||||
{
|
||||
//It isn't; have the NPC pop up and say it
|
||||
//will take the item:
|
||||
npc.say("@I'll take it!@");
|
||||
npc.hide();
|
||||
}
|
||||
//Success:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//Failure:
|
||||
return false;
|
||||
}
|
||||
|
||||
void buyItemsOld (var options, var shapes, var frames, var price, var quantity, var articles, var quantity_text, var quantity_tokens, var dialog)
|
||||
{
|
||||
var choice_index;
|
||||
var msg;
|
||||
var sell_result;
|
||||
var total_price;
|
||||
var isplural;
|
||||
|
||||
//Present the options to the player:
|
||||
choice_index = chooseFromMenu2(options);
|
||||
|
||||
//Keep doing this until the player choses not to buy anything else:
|
||||
while (!(choice_index==1))
|
||||
{
|
||||
total_price = price[choice_index] * quantity[choice_index];
|
||||
|
||||
if (quantity[choice_index] > 1)
|
||||
isplural = true;
|
||||
else
|
||||
isplural = false;
|
||||
|
||||
//Inform price to player:
|
||||
say("@^",
|
||||
makeSellPriceString(articles[choice_index], options[choice_index],
|
||||
isplural, price[choice_index],
|
||||
quantity_text[choice_index]),
|
||||
dialog[1]);
|
||||
|
||||
//See if player agrees with price:
|
||||
if (askYesNo())
|
||||
{
|
||||
//Ask for quantity:
|
||||
say(dialog[2], quantity_tokens[choice_index], dialog[3]);
|
||||
|
||||
//Sell everything to the party:
|
||||
sell_result = sellAmountToParty(shapes[choice_index], frames[choice_index], quantity[choice_index], price[choice_index], 32, 1, true);
|
||||
|
||||
if (sell_result == 1)
|
||||
msg = dialog[4]; //can't carry
|
||||
else if (sell_result == 2)
|
||||
msg = dialog[5];
|
||||
else if (sell_result == 3)
|
||||
msg = dialog[6];
|
||||
else
|
||||
msg = dialog[7]; //not agreeable - answered no
|
||||
|
||||
//Inform the player if the buy was successful:
|
||||
say(msg);
|
||||
}
|
||||
|
||||
else
|
||||
say(dialog[8]);
|
||||
|
||||
//Present the menu again:
|
||||
choice_index = chooseFromMenu2(options);
|
||||
}
|
||||
|
||||
say(dialog[9]);
|
||||
}
|
||||
239
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/general.uc
Executable file
239
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/general.uc
Executable file
@@ -0,0 +1,239 @@
|
||||
//Aliases for original functions
|
||||
//------------------------------
|
||||
|
||||
//IMPORTANT NOTE: The original functions appear to have their arguments in the exact opposite order you would expect. This may be a quirk of the decompiler, or of the extern assignment.
|
||||
|
||||
extern checkIfItemStolen 0x8FA(var object); //Checks whether the item used belonged to someone else.
|
||||
//This does not actually return a value - it executes the stolen-item behaviour (guards showing up, NPCs leaving etc.)
|
||||
extern subtractItemQuantity 0x925(var object); //Remove 1 item from the item's quantity stack (for Quantity items)
|
||||
|
||||
//npc says a line with a delay - use delayedBark instead, which has the arguments the right way round
|
||||
extern oldDelayedBark 0x933(var delay, var line, var npc);
|
||||
|
||||
extern randomPartyBark 0x08FE(var line); //Get a random nearby party member to say the line as a bark
|
||||
extern randomPartySay 0x08FF(var line); //Get a random nearby party member to say the line in conversation form
|
||||
|
||||
extern var npcCanTalk 0x937(var npc); //Conjecture
|
||||
|
||||
//return a random party member who is nearby, or the avatar if none can be found
|
||||
//(this is used by both of the above functions)
|
||||
extern getRandomPartyMember 0x900();
|
||||
|
||||
extern var getAvatarName 0x0908(); //As it says, returns the name of the Avatar
|
||||
|
||||
//try to pathfind to the target object.
|
||||
//offsetx, offsety and offsetz define a cubic perimeter of points around the object, and it will pathfind to the nearest point on that perimeter. offsetx and offsety are usually specified as arrays.
|
||||
//if the player can get there, then they will walk there immediately. When they arrive in the region, func will be called with obj_context as the item and eventid as the event.
|
||||
//if the player cannot get there, it displays the X cursor and no movement occurs.
|
||||
//Note: This has been overridden by gotoObject, which just flips the order of the arguments to how they should be. Use that instead.
|
||||
extern oldGotoObject 0x828(var eventid, var obj_context, var func, var rangez, var rangey, var rangex, var target);
|
||||
|
||||
//returns true if the object is carried by the avatar, false otherwise. Supports recursive containers.
|
||||
extern var containedByAvatar 0x944(var obj);
|
||||
|
||||
//returns an itemref for the outermost container of an object. Used for when an object is contained several levels deep.
|
||||
extern var getOuterContainer 0x945(var obj);
|
||||
|
||||
//returns the cardinal direction the object lies to, relative to the avatar
|
||||
extern var directionFromAvatar 0x92D(var obj);
|
||||
|
||||
//Put specified object in the player's inventory
|
||||
extern giveToAvatar 0x692(var object);
|
||||
|
||||
extern giveExperience 0x911(var exp); //gives the specified amount of experience points to every party member
|
||||
|
||||
|
||||
|
||||
//All-new functions
|
||||
//-----------------
|
||||
|
||||
//returns a random entry from an array
|
||||
var randomIndex 0xA00(var array)
|
||||
{
|
||||
var size = UI_get_array_size(array);
|
||||
var rand = UI_get_random(size);
|
||||
return array[rand];
|
||||
}
|
||||
|
||||
//returns true if the specified NPC is in the party, false otherwise
|
||||
//There should be an intrinsic for this, but it doesn't appear to be defined
|
||||
NPCInParty 0xA01(npc) { npc = UI_get_npc_object(npc); return (npc in UI_get_party_list()); }
|
||||
|
||||
avatarBark 0xA03(var line)
|
||||
{
|
||||
var avatar = UI_get_avatar_ref();
|
||||
if (npcCanTalk(avatar)) UI_item_say(avatar, line);
|
||||
}
|
||||
|
||||
avatarSay 0xA04(var line)
|
||||
{
|
||||
var avatar = UI_get_avatar_ref();
|
||||
if (npcCanTalk(avatar)) avatar->say(line);
|
||||
}
|
||||
|
||||
//Shift an object into a container (can be from another container or the world)
|
||||
moveToContainer 0xA05(var object, var container, var dont_check_ownership)
|
||||
{
|
||||
var orig_pos;
|
||||
var orig_container;
|
||||
|
||||
//record the previous container
|
||||
orig_container = UI_get_container(object);
|
||||
//object was in the world - record its last position
|
||||
if (!orig_container) orig_pos = UI_get_object_position(object);
|
||||
|
||||
//could not remove the item (protected?)
|
||||
if (!UI_set_last_created(object)) return false;
|
||||
|
||||
//try to put the item into the new container
|
||||
if (UI_give_last_created(container))
|
||||
{
|
||||
//check if the item was stolen, unless overridden
|
||||
if (!dont_check_ownership) checkIfItemStolen(object);
|
||||
return true;
|
||||
}
|
||||
//if it couldn't be put into the new container, just put it back in the original container along with a mouse warning
|
||||
else
|
||||
{
|
||||
if (orig_container) { UI_give_last_created(orig_container); }
|
||||
else { UI_update_last_created(orig_pos); }
|
||||
|
||||
//UI_flash_mouse(4);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Opposite of moveToContainer: tries to place the item at the specified location, or returns it to its previous location/container if that couldn't be done
|
||||
moveToLocation 0xA12(var object, var pos)
|
||||
{
|
||||
var orig_pos;
|
||||
var orig_container;
|
||||
|
||||
//record the previous container
|
||||
orig_container = UI_get_container(object);
|
||||
//object was in the world - record its last position
|
||||
if (!orig_container) orig_pos = UI_get_object_position(object);
|
||||
|
||||
//could not remove the item (protected?)
|
||||
if (!UI_set_last_created(object)) return false;
|
||||
|
||||
//try to shift the item
|
||||
if (UI_update_last_created(pos)) return true;
|
||||
|
||||
//if it couldn't be moved, just put it back in the original container/location along with a mouse warning
|
||||
else
|
||||
{
|
||||
if (orig_container) { UI_give_last_created(orig_container); }
|
||||
else { UI_update_last_created(orig_pos); }
|
||||
|
||||
//UI_flash_mouse(4);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//rewritten version of oldGotoObject() so that the calls are in their original orders
|
||||
//todo: work out why this is happening in the first place
|
||||
gotoObject 0xA06(var target, var rangex, var rangey, var rangez, var func, var obj_context, var eventid)
|
||||
{
|
||||
oldGotoObject(eventid, obj_context, func, rangez, rangey, rangex, target);
|
||||
}
|
||||
|
||||
//go to the target item, then call the specified pickup function when you get there (the pickup function should call pickUpItem, along with the actual target function you want)
|
||||
//this is pretty much identical to gotoObject, only with fixed offsets. It is commonly used for item interactions.
|
||||
gotoAndGet2 0xA07(var target, var func, var obj_context, var eventid)
|
||||
{
|
||||
var offsetx;
|
||||
var offsety;
|
||||
|
||||
UI_close_gumps();
|
||||
|
||||
//item is contained by someone/thing - march the avatar over to the container and pick it up
|
||||
//I have no idea what these positional offsets will look like - they're from the original game
|
||||
if (UI_get_container(target))
|
||||
{
|
||||
target = getOuterContainer(target);
|
||||
//avatar is the container - well I'll be. Call the pickup function directly.
|
||||
if (target == UI_get_avatar_ref())
|
||||
{
|
||||
UI_execute_usecode_array(obj_context, [0x27, eventid, 0x55, func]);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
offsetx = [0, 1, -1, 1];
|
||||
offsety = [2, 1, 2, 0];
|
||||
}
|
||||
}
|
||||
//item was lying on the ground
|
||||
else
|
||||
{
|
||||
offsetx = [0, 1, 1, 1, -1, -1, 0, -1];
|
||||
offsety = [1, 1, 0, -1, 1, 0, -1, -1];
|
||||
}
|
||||
|
||||
//go to item and call result function
|
||||
gotoObject(target, offsetx, offsety, -3, func, obj_context, eventid);
|
||||
}
|
||||
|
||||
//generic get-item-from-container/world script, used by item interactions. It is used at the end of a march-to-container script, to play an appropriate animation and transfer the item into the player's inventory.
|
||||
//once the item has been picked up, func is called with obj_context as the item and eventid as the event.
|
||||
|
||||
//Note: currently target is used in place of obj_context in most cases. This needs correcting.
|
||||
pickUpItem 0xA08(var target, var func, var obj_context, var eventid)
|
||||
{
|
||||
var container = getOuterContainer(target);
|
||||
var direction = directionFromAvatar(container);
|
||||
|
||||
//the avatar is already carrying the item, call the target function and leave it at that
|
||||
if (container == UI_get_avatar_ref())
|
||||
{
|
||||
UI_execute_usecode_array(obj_context, [0x27, eventid, 0x55, func]);
|
||||
return;
|
||||
}
|
||||
|
||||
//container is an NPC, animate the avatar frobbing the target
|
||||
else if (UI_is_npc(container)) UI_execute_usecode_array(UI_get_avatar_ref(), [0x59, direction, 0x64, 0x27, 3, 0x61]);
|
||||
|
||||
//container is a regular object or just the world, animate the avatar leaning down
|
||||
else UI_execute_usecode_array(UI_get_avatar_ref(), [0x59, direction, 0x6C, 0x27, 3, 0x61]);
|
||||
|
||||
//Hands the item to the avatar, and calls the intended function
|
||||
UI_execute_usecode_array(target, [0x27, 3, 0x55, 0x0692, 0x27, eventid, 0x55, func]);
|
||||
}
|
||||
|
||||
//Get the appropriate rotated frame for an NPC animation, based on the direction they should face
|
||||
getFrame 0xA09(var framenum, var direction)
|
||||
{
|
||||
//use front-facing frame set
|
||||
if (direction >= EAST && direction <= SOUTHWEST) framenum = framenum + 16;
|
||||
|
||||
return framenum;
|
||||
}
|
||||
|
||||
//returns true if the specified object is the avatar, false otherwise
|
||||
isAvatar 0xA0A(var object) { return (object == UI_get_avatar_ref()); }
|
||||
|
||||
//Check if the player has met the specified person (i.e. whether their Met flag has been set)
|
||||
//This can accept either an object reference or an NPC number/constant
|
||||
hasMet 0xA0B(var npc) { npc = UI_get_npc_object(npc); return UI_get_item_flag(npc, MET); }
|
||||
|
||||
//A reimplementation of oldDelayedBark, with arguments in the correct order
|
||||
delayedBark 0xA0C(var npc, var line, var delay) { oldDelayedBark(delay, line, npc); }
|
||||
|
||||
//returns the direction (N/S/W/E) that the NPC is facing, based on their current frame
|
||||
getFacing 0xA0D(var npc)
|
||||
{
|
||||
var direction;
|
||||
var framenum;
|
||||
|
||||
framenum = UI_get_item_frame_rot(npc);
|
||||
|
||||
if (framenum < 16) direction = NORTH;
|
||||
else if (framenum < 32) direction = SOUTH;
|
||||
else if (framenum < 48) direction = WEST;
|
||||
else if (framenum < 64) direction = EAST;
|
||||
|
||||
return direction;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,451 @@
|
||||
/* This script contains constants for each global flag used in the game. Fill them in as you go along! */
|
||||
|
||||
/* New flags */
|
||||
/*Flags we do not want to use
|
||||
//Flags we DON'T want to reset -
|
||||
//global flag # 61 (learned password) so the portullius works
|
||||
//global flag # 442 - quenton seance
|
||||
//global flag # 749 Set when the Magic Storm spell is cast:
|
||||
//const int MAGIC_STORM_SPELL = 0x02ED;
|
||||
//global flag # 30 Used the armageddon spell - const int CAST_ARMAGEDDON = 0x1E;
|
||||
*/
|
||||
|
||||
|
||||
enum main_quest_flags
|
||||
{
|
||||
INTRO = 1000,
|
||||
START_OF_GAME = 1001,
|
||||
|
||||
ASKED_NYSTUL_ABOUT_BOOK = 1002,
|
||||
ASKED_NYSTUL_ABOUT_ORB = 1003,
|
||||
|
||||
|
||||
//Mantras learned:
|
||||
LEARNED_MANTRA_VALOR = 1004,
|
||||
LEARNED_MANTRA_SACRIFICE = 1005,
|
||||
LEARNED_MANTRA_JUSTICE = 1006,
|
||||
LEARNED_MANTRA_COMPASSION = 1007, //Kenneth, Lady Nan
|
||||
LEARNED_MANTRA_SPIRITUALITY = 1008,
|
||||
LEARNED_MANTRA_HONESTY = 1009,
|
||||
LEARNED_MANTRA_HUMILITY = 1010,
|
||||
LEARNED_MANTRA_HONOR = 1011,
|
||||
|
||||
//Shrines freed:
|
||||
|
||||
SACRIFICE_FREED = 1012,
|
||||
COMPASSION_FREED = 1013,
|
||||
VALOR_FREED = 1014,
|
||||
JUSTICE_FREED = 1015,
|
||||
SPIRITUALITY_FREED = 1016,
|
||||
HONOR_FREED = 1017,
|
||||
HUMILITY_FREED = 1018,
|
||||
HONESTY_FREED = 1019,
|
||||
|
||||
//Used when you meditate at shrines so you don't get duplicate Karma
|
||||
MEDITATE_COMPASSION = 1020,
|
||||
MEDITATE_VALOR = 1021,
|
||||
MEDITATE_HONESTY = 1022,
|
||||
MEDITATE_JUSTICE = 1023,
|
||||
MEDITATE_HUMILITY = 1024,
|
||||
MEDITATE_HONOR = 1025,
|
||||
MEDITATE_SPIRITUALITY = 1026,
|
||||
MEDITATE_SACRIFICE = 1027,
|
||||
|
||||
|
||||
|
||||
// ASKED_MARIAH_ABOUT_BOOK = 1028,
|
||||
// MARIAH_READ_TABLET = 1029, //Triggers convo about book of prophesies with Sin Vraal
|
||||
|
||||
|
||||
|
||||
JOINED_THIEVES_GUILD = 1030,
|
||||
|
||||
|
||||
READ_GARGISH_SCROLL = 1031, //Set when double clicked John's scroll
|
||||
WEARING_AMULET_SUBMISSION = 1032, //checks to see if you are wearing the gargoyle amulet
|
||||
SUBMITTED_TO_DRAXINUSOM = 1033,
|
||||
|
||||
ASK_TO_SUBMIT = 1034, //valkadesh says to submit, you ask Naxatilor and Draxinosum
|
||||
|
||||
|
||||
PAPA_HAS_CUBE = 1035, //set by Myles or Mama when asked about cellar
|
||||
TOLD_ABOUT_CUBE = 1036, //set true when told about cube by Caretaker or visiting cyclops basement
|
||||
//and needing key
|
||||
|
||||
|
||||
//gargoyle shrine flags
|
||||
LEARNED_MANTRA_CONTROL = 1037,
|
||||
LEARNED_MANTRA_DILIGENCE = 1038,
|
||||
LEARNED_MANTRA_PASSION = 1039,
|
||||
|
||||
START_CODEX_QUEST = 1040, //given by Naxitilor
|
||||
FINAL_QUEST_GIVEN = 1041, //final codex quest by altar of singularity
|
||||
|
||||
//determines which stones you put into the vortex cube
|
||||
MOONSTONE1 = 1050,
|
||||
MOONSTONE2 = 1051,
|
||||
MOONSTONE3 = 1052,
|
||||
MOONSTONE4 = 1053,
|
||||
MOONSTONE5 = 1054,
|
||||
MOONSTONE6 = 1055,
|
||||
MOONSTONE7 = 1056,
|
||||
MOONSTONE8 = 1057,
|
||||
|
||||
|
||||
|
||||
VORTEX_CUBE_FULL = 1058, //set once all stones are put in
|
||||
HUMAN_LENS_PLACED = 1059,
|
||||
GARG_LENS_PLACED = 1060
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
enum town_flags
|
||||
{
|
||||
|
||||
//YEW
|
||||
|
||||
LENORA_GAVE_LETTER = 1070,
|
||||
ASKEDABOUTPERMISSION = 1071,
|
||||
GOT_BOSKIN_CELL_KEY = 1072,
|
||||
BOSKINCHILDREN = 1073,
|
||||
BOSKINPISSED = 1074,
|
||||
BOSKINLIES = 1075,
|
||||
BEN_FRIEND = 1076,
|
||||
FREEBOSKIN = 1077,
|
||||
BOSKINDENIED = 1078,
|
||||
LEARNED_ABOUT_NICODEMUS = 1079, //set by several npcs about "enchanter near Yew"
|
||||
|
||||
//Britain / Castle British
|
||||
VIRTUE_STONES = 1100, //for Mandrake quest
|
||||
ASKEDABOUTFREITAG = 1101, //Kytyn - used to open up conversation with Gertan in Cove
|
||||
ASKEDARIANAABOUTRUNE = 1102,
|
||||
ASKED_THOLDEN_ABOUT_RUNE = 1103,
|
||||
ASKED_PARENTS_PERMISSION = 1104, //Anya
|
||||
LEARNED_RUNE_COMPASSION = 1105,
|
||||
MR_NOSE = 1106,
|
||||
|
||||
BOUGHTTRIPLEXBOW = 1107,
|
||||
ASKEDABOUTTRIPLEXBOW = 1108, //Gwenno
|
||||
|
||||
GOT_DUCK = 1109, //Daros in the sewers
|
||||
|
||||
ASKED_LAZEENA_ABOUT_ARTAGEL = 1110, // Sidequest - Ask her about Artagel, can talk to him about Lazena
|
||||
ARTAGEL_IS_ALIVE = 1111, //can now tell Lazenna he's alive
|
||||
|
||||
//Skara Brae
|
||||
QUENTON_START = 1120, //quenton quest
|
||||
ASKED_LENORA_ABOUT_MURDER = 1121, //used in Michael / Quenton quest
|
||||
LEARNED_ABOUT_QUENTON = 1122, //set by Gideon when you learn what happened to open up convo flags on everyone else
|
||||
|
||||
LEARNED_ABOUT_SEANCE = 1123, //learned from Dezana
|
||||
LEARNED_SEANCE = 1124,
|
||||
SEANCE_QUENTON = 0x01BA, //0442
|
||||
LEARNED_MICHAEL_NAME = 1125,
|
||||
MICHAEL_PISSED = 1126,
|
||||
MARNEY_SAVED = 1127,
|
||||
FAILED_QUENTON_QUEST = 1128,
|
||||
RINALDO_BACK = 1129,
|
||||
STARTED_INVESTIGATION = 1130,
|
||||
MARNEY_GONE = 1131, //set when you screw up and Marney left with Michael. Bad ending
|
||||
MICHAEL_AT_DOCKS = 1132, //
|
||||
READ_MICHAELS_SCROLL = 1133,
|
||||
QUENTON_MURDER_SOLVED = 1134,
|
||||
MICHAEL_TO_SKARA = 1135, //
|
||||
RENTHAR_TELLS_RINALDO = 1136, //Renthar tells Rinaldo of Michael's safehouse location. Will set a timer to move Michael
|
||||
MICHAEL_CAPTURED = 1137, //Michael is now at the cell awaiting his fate. Set when Renthar is with you and you kill Michael
|
||||
MICHAEL_TIMER_SET = 1138,
|
||||
MARNEY_PISSED = 1139, //Marney was allowed to go with Michael by accident and holds a grudge against the Avatar
|
||||
RENTHAR_IN_PARTY = 1140, //Renthar is in the party now, used to keep him from staying too long
|
||||
STIVIUS_SAW_MICHAEL = 1141, //when you catch Stivius in a lie and he admits. Can tell Rinaldo now.
|
||||
MICHAEL_SHIP_BUILT = 1142, //Michael's ship is built
|
||||
|
||||
//MINOC
|
||||
ASKED_SELGANOR_ABOUT_RUNE = 1150,
|
||||
LEARNED_STONES = 1151,
|
||||
JOINED_ARTISANS_GUILD = 1152,
|
||||
SELGANOR_GAVE_RUNE = 1153,
|
||||
LEARNED_ABOUT_BALLOONIST = 1154, // where do I set this flag?!
|
||||
|
||||
//Trinsic
|
||||
LEARNED_WHITSABERS_SECRET = 1170, //Sandy?
|
||||
TALKEDTOHOMERABOUTMAP = 1171, //Homer
|
||||
WHITSABER_MAD = 1172,
|
||||
WHITSABER_KNOWS = 1173,
|
||||
WHITSABER_GAVE_MAP = 1174,
|
||||
KEEP_WHITSABERS_SECRET = 1175,
|
||||
|
||||
|
||||
//Moonglow
|
||||
//Lycaeum flags - set to randomize Quest books,
|
||||
BOOKS_ARE_RANDOMIZED = 1190,
|
||||
MANTRA_BOOK_PLACED = 1191,
|
||||
OZ_SNILWITS_BOOKS_PLACED = 1192,
|
||||
FOUND_OZ_BOOK = 1193,
|
||||
LEARNED_ABOUT_TABLET = 1194,
|
||||
ASK_ABOUT_BEYVIN = 1195, //when asked Agnar about rune
|
||||
|
||||
ASKED_MARIAH_ABOUT_BOOK = 1196,
|
||||
MARIAH_READ_TABLET = 1197, //Triggers convo about book of prophesies with Sin Vraal
|
||||
ASKED_MARIAH_ABOUT_TABLET = 1198, //asked about silver tablet, can talk to Zoltan about it now
|
||||
ASK_THARIAND_ABOUT_SHRINE = 1199, //talked to Mariah about the shrine
|
||||
|
||||
//Buccaneer's Den
|
||||
GAVE_HOMER_STORMCLOAK = 1200,
|
||||
FIND_STORMCLOAK = 1201,
|
||||
LEARNED_ABOUT_GUILD = 1202,
|
||||
RETIRE_PHOENIX = 1203,
|
||||
|
||||
//Jhelom
|
||||
|
||||
BRAWLING = 1210, //used for Bucs den brawling convos
|
||||
//Used in valor quest
|
||||
AVATAR_IS_SHERRY = 1211,
|
||||
LEARNED_ABOUT_SHERRY = 1212, //when ask Lyssandra in Jhelom about rune
|
||||
GOT_VALOR_RUNE = 1213,
|
||||
ASK_NOMAAN_ABOUT_RUNE = 1214, //set by Zellivan
|
||||
|
||||
//Serpents Hold
|
||||
|
||||
|
||||
JOINED_OSS = 1220,
|
||||
ASK_JOIN_OSS = 1221, //after join oss, can use again
|
||||
TRAINED_WITH_LOUBET = 1223,
|
||||
MAKE_SERPENT_SHIELD = 1224, //when you ask Koranda to join OSS, you can ask Gherick to make shield
|
||||
|
||||
//Empath Abbey
|
||||
GAVE_MOLE_SHOVEL = 1230, //Empath abbey sidequest
|
||||
GLENGRAPES = 1231
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
enum new_misc_flags
|
||||
{
|
||||
|
||||
/* Used for Gypsy schedules */
|
||||
GYPSY_TIMER_STARTED = 1300,
|
||||
DAY_ONE = 1301,
|
||||
DAY_TWO = 1302,
|
||||
DAY_THREE = 1303,
|
||||
DAY_FOUR = 1304,
|
||||
DAY_FIVE = 1305,
|
||||
DAY_SIX = 1306,
|
||||
DAY_SEVEN = 1307,
|
||||
|
||||
CHAOS_SWORD_EQUIPPED = 1308,
|
||||
|
||||
ASK_ABOUT_DUCK = 1309,
|
||||
KADOR_SAD = 1310,
|
||||
|
||||
//Drudgeworth Quest
|
||||
READ_LEAFLET = 1311,
|
||||
ASKED_PRIDGARM_ABOUT_DRUDGEY = 1312,
|
||||
ASK_ANDREA_ABOUT_DRUDGEY = 1313,
|
||||
HELP_DRUDGEWORTH = 1314, // set once you agree to help Drudgeworth after speaking to him in the mirror. Also sets Lucy convo flag on Chuckles
|
||||
CHUCKLES_WAITS = 1315, //set after you confront Chuckles about LUcy. has him wait at 3am by mirror in Blue Boar
|
||||
CHUCKLES_CREMATED = 1316, //set when you cremate Chuckles body, so you can bring his ashes to Drudgeworth
|
||||
CHUCKLES_KILLED = 1317, //set when you script kill him in front of the mirror
|
||||
CHUCKLES_SECRET = 1318, //set when you "let Chuckles go", will open up convo option on LB
|
||||
MET_DRUDGEWORTH = 1319, //when you double click mirror. Will trigger a prompt after reading the book for the first time.
|
||||
TATTLED_ON_CHUCKLES = 1320, //tattled on Chcukles to LB
|
||||
|
||||
MOONGLOW_HOUSE_CLEAN = 1321, //after house is purchased in moonglow, egg will clean it up next time you enter
|
||||
|
||||
//Map is overworld
|
||||
MAP_IS_OVERWORLD = 2045, //for leaveParty function
|
||||
|
||||
//flag if you want songs to play after converstations such as original.
|
||||
PLAY_ORIGINAL_TRACKS = 2046,
|
||||
|
||||
//flag to use Ankh as debugging tool
|
||||
DEBUG = 2047,
|
||||
|
||||
IOLO_HATES_HORSEFLESH = 1330, //set once Iolo eats the horseflesh
|
||||
|
||||
|
||||
SOLVED_CHUCKLES_QUEST = 1331,//when you read the last scroll on the run around quest.
|
||||
|
||||
//INNKEEPER FLAGS
|
||||
INN_PEYTON = 1340,
|
||||
INN_DORIS = 1341, //890 - true if rented room from Doris
|
||||
|
||||
//DUNGEON FLAGS
|
||||
SWITCH_WRONG = 1350,
|
||||
SWITCH_WRONG_2 = 1351,
|
||||
|
||||
SWITCH_CONTROL = 1352,
|
||||
SWITCH_BASEMENT = 1353,
|
||||
|
||||
SWITCH_TOMBKINGS = 1354, //used to remove barrier in tomb of kings when switch is flipped
|
||||
|
||||
|
||||
//Gargoyles
|
||||
HALL_OF_KNOWLEDGE = 1370, //set when Naxatilor asks you to read the book of ritual
|
||||
READ_BOOK_RITUAL = 1371, // for karma if you lie to Naxatilor
|
||||
SIXTH_MEMBER_LEAVES = 1372,
|
||||
|
||||
GET_HUMAN_LENS = 1373,
|
||||
MET_MONDAIN = 1374,
|
||||
MET_MINAX = 1375,
|
||||
MET_EXODUS = 1376,
|
||||
|
||||
MET_ALTAR_SINGULARITY = 1377,
|
||||
|
||||
|
||||
MADE_BALLOON = 1378, //set by scroll code when balloon has been made
|
||||
|
||||
BALLOON_IS_FLYING = 1379,
|
||||
LEARNED_ABOUT_FLYING = 1380,
|
||||
|
||||
|
||||
READ_BALLOON_PLANS = 1381, //sets flag to ask weavers about silk bag/thread/cloth
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
LEARNED_ABOUT_CAPT_JOHNE = 1382, //set by Zoltan once you ask him of Silver Tablet
|
||||
|
||||
LEARNED_ABOUT_HYTHLOTH = 1383,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GOT_ARMAGEDDON = 1384, //set when Armageddon spell received from Wisp
|
||||
GET_WISP_INFO = 1385, //set when Wisps ask for information, you can get the book of lost mantras
|
||||
WISPS_GAVE_GOLD = 1386, //Wisps either gave you information or gold
|
||||
|
||||
JAANA_IN_PARTY = 1387,
|
||||
SHERRY_IN_PARTY = 1388,
|
||||
IOLO_IN_PARTY = 1389,
|
||||
ASK_KADOR_TRICKS = 1390,
|
||||
|
||||
|
||||
LEARNEDGYPSYSSTOLEMAP = 1400,
|
||||
REFUSED_WANDA_SEX = 1401,
|
||||
ARTUROSIS = 1402, //set by Culham in Jhelom when asked about gypsy story
|
||||
WANDA_TIRED = 1403,
|
||||
DURING_WANDA_CUTSCENE = 1404,
|
||||
DURING_ANDREAS_CUTSCENE = 1405,
|
||||
ASKED_ABOUT_SACRIFICE_MANTRA = 1406,
|
||||
LENS = 1407, //Dale in Minoc makes Lens
|
||||
MET_ELAD = 1408, //bucs den 881
|
||||
LEONNA_IN_PARTY = 1409,
|
||||
LEODON_IN_PARTY = 1410,
|
||||
FENTRISSA_SOLD_OUT = 1411,
|
||||
|
||||
MET_CAPTAIN_JOHNE = 1411,
|
||||
|
||||
|
||||
|
||||
SEGGALLION_IN_PARTY = 1412,
|
||||
LEARNED_OF_CAPT_JOHNE = 1413,
|
||||
|
||||
|
||||
|
||||
//Used for orb of the moons locations
|
||||
FOUND_CONTROL = 1414,
|
||||
FOUND_PASSION = 1415,
|
||||
FOUND_DILIGENCE = 1416,
|
||||
FOUND_SLAB = 1417
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* Original game flags */
|
||||
|
||||
//Who the player has met. BG used global flags for this because the Met flag didn't exist.
|
||||
enum met_flags
|
||||
{
|
||||
// MET_JULIA = 0x1B,
|
||||
MET_LORD_BRITISH = 0x98,
|
||||
MET_FINNIGAN = 0x4C,
|
||||
MET_NYSTUL = 0x99,
|
||||
MET_CHUCKLES = 0x9A,
|
||||
MET_CANDICE = 0xAA,
|
||||
MET_GORDON = 0xBB,
|
||||
MET_GLADSTONE = 0x110
|
||||
};
|
||||
|
||||
//Flags used by the starting murder investigation quest
|
||||
enum trinsic_murder_flags
|
||||
{
|
||||
// GOT_CHRISTOPHERS_KEY = 0x3C,
|
||||
GOT_TRINSIC_PASSWORD = 0x3D,
|
||||
NEEDS_TRINSIC_PASSWORD = 0x42,
|
||||
UNLOCKED_CHRISTOPHERS_CHEST = 0x3E,
|
||||
|
||||
KNOWS_ABOUT_CHRISTOPERS_ARGUMENT = 0x3F,
|
||||
REFUSED_MURDER_INVESTIGATION = 0x59,
|
||||
EXPECTED_TO_LOOK_IN_STABLES = 0x5A,
|
||||
REPORTED_CHRISTOPHERS_KEY = 0x48,
|
||||
CAN_GIVE_MURDER_REPORT = 0x5B,
|
||||
STARTED_MURDER_REPORT = 0x5D,
|
||||
LEARNED_ABOUT_CROWN_JEWEL = 0x40,
|
||||
LEARNED_ABOUT_HOOK = 0x43,
|
||||
FINISHED_MURDER_INVESTIGATION = 0x44,
|
||||
WAITING_FOR_INVESTIGATION_PAYMENT = 0x45
|
||||
};
|
||||
|
||||
//Broken the tetrahedron generator that screws up magic. This affects most conversations with wizards.
|
||||
const int BROKE_TETRAHEDRON = 0x03;
|
||||
|
||||
//Used the armageddon spell
|
||||
const int CAST_ARMAGEDDON = 0x1E;
|
||||
|
||||
|
||||
//Flags used in conversation with Lord British
|
||||
enum lb_conversation_flags
|
||||
{
|
||||
WESTON_FREED = 0xCC,
|
||||
ASKED_LB_ABOUT_ORB = 0xDD,
|
||||
ASKED_LB_ABOUT_MAGIC = 0x66,
|
||||
LEARNED_ABOUT_BRITAIN_MURDER = 0xD1, //allows you to ask Patterson about it
|
||||
ASKED_LB_ABOUT_HEAL = 0xD3,
|
||||
LEARNED_ABOUT_BLACKROCK = 0x65, //allows you to ask Rudyom about it?
|
||||
ASKED_LB_ABOUT_GUARDIAN = 0xD4, //stops you ever asking him again (yes, plaster over those plot-holes)
|
||||
LB_REWARDED_FOR_FV = 0x30D //Received Lord British's reward for completing the Forge of Virtue
|
||||
};
|
||||
|
||||
//Flags used in conversation with Julia
|
||||
enum julia_conversation_flags
|
||||
{
|
||||
ASKED_JULIA_TO_LEAVE = 0x101,
|
||||
JULIA_IN_PARTY = 0x108,
|
||||
KATRINA_IN_PARTY = 0x121
|
||||
};
|
||||
|
||||
//Flags used in Minoc conversations to do with the sawmill murder
|
||||
enum minoc_murder_flags
|
||||
{
|
||||
LEARNED_ABOUT_MINOC_MURDER = 0x11F
|
||||
};
|
||||
|
||||
//Flags used by the Owen's Monument quest
|
||||
enum owen_monument_flags
|
||||
{
|
||||
// COMPLETED_OWENS_QUEST = 0xF7,
|
||||
LEARNED_ABOUT_PLANS = 0x10B,
|
||||
OWENS_PLANS_ARE_UNSAFE = 0xFD
|
||||
};
|
||||
|
||||
//Batlin has buggered off (after you talk to him with the cube in your possession)
|
||||
const int BATLIN_MISSING = 0xDA;
|
||||
|
||||
//Heard that Patterson is having an affair with Candice
|
||||
const int HEARD_ABOUT_PATTERSONS_AFFAIR = 0x80;
|
||||
|
||||
//Heard about the Inner Voice
|
||||
//const int HEARD_ABOUT_VOICE = 0x8C;
|
||||
56
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/keys.uc
Executable file
56
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/keys.uc
Executable file
@@ -0,0 +1,56 @@
|
||||
|
||||
const int QUALITY_BRITISH_SEWERS = 1;
|
||||
const int QUALITY_BRITISH_STUDY = 2;
|
||||
|
||||
const int QUALITY_NOMAAN = 4;
|
||||
const int QUALITY_MAX_ARMORY = 6;
|
||||
const int QUALITY_DORIS_INN = 10;
|
||||
const int FRAME_DORIS = 1;
|
||||
|
||||
|
||||
const int QUALITY_MOONGLOWHOUSE = 8; //buy from Aganar for 300g
|
||||
const int FRAME_MOONGLOWHOUSE = 11;
|
||||
|
||||
const int QUALITY_BEYVIN_CRYPT = 20;
|
||||
const int QUALITY_CRYPT_CHEST = 21;
|
||||
|
||||
//Innkeepers
|
||||
const int QUALITY_TIMOTHY_INN = 22;
|
||||
const int QUALITY_MARTIN_INN = 23;
|
||||
const int QUALITY_GIDEON_INN = 24;
|
||||
const int QUALITY_PEYTON_INN = 3;
|
||||
const int QUALITY_PETROPH_INN = 11;
|
||||
|
||||
//Key given by the jailer to escape
|
||||
const int FRAME_CELL_KEY = 17;
|
||||
const int QUALITY_CELL_KEY = 30;
|
||||
|
||||
const int FRAME_LBKEY = 28;
|
||||
const int QUALITY_LBKEY = 1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const int QUALITY_BASEMENT = 11; //the Cyclops' key
|
||||
const int FRAME_BASEMENT = 15; // cyclops key
|
||||
|
||||
//Key to Boskin's cell.
|
||||
const int QUALITY_BOSKIN_CELL_KEY = 45;
|
||||
const int FRAME_BOSKIN_CELL_KEY = 18;
|
||||
|
||||
//Key to Hythloth
|
||||
const int QUALITY_HYTH_KEY = 75;
|
||||
|
||||
//Key to chest in Heroes Hole
|
||||
const int QUALITY_HEROES = 76;
|
||||
|
||||
//Key to chest in Swamp Cave
|
||||
const int QUALITY_SWAMP = 77;
|
||||
|
||||
//key to Brandon's vault in Trinsic
|
||||
const int QUALITY_BRANDON_VAULT = 78;
|
||||
|
||||
//Key to Drudgeworth's chest
|
||||
const int QUALITY_DRUDGEWORTH = 41;
|
||||
const int FRAME_DRUDGEWORTH = 26;
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 Alun Bestor/The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This header file contains the shape numbers for all of the new
|
||||
* shapes installed by the Keyring mod. It is unsorted by shape #.
|
||||
*
|
||||
* Author: Marzo Junior/Alun Bestor
|
||||
* Last Modified: 2006-03-19
|
||||
*/
|
||||
|
||||
//const int SHAPE_NEW_BODIES = 1099; //0x44B
|
||||
const int SHAPE_KEYRING = 1100; //0x44C
|
||||
const int SHAPE_BARRIER = 1101; //0x44D
|
||||
const int SHAPE_JOURNAL = 1102; //0x44E
|
||||
const int SHAPE_LAURIANNA_MONSTER = 1103; //0x44F
|
||||
const int SHAPE_BLACKROCK_POTION = 1104; //0x450
|
||||
const int SHAPE_GEM_OF_DISPELLING = 1105; //0x451
|
||||
const int SHAPE_SPIDER_EGG = 1106; //0x452
|
||||
const int SHAPE_LAURIANNA = 1107; //0x453
|
||||
const int SHAPE_LAURIANNA_ROOTED = 1108; //0x454
|
||||
const int SHAPE_SPELL_SPELLBOOK = 1109; //0x455
|
||||
const int SHAPE_IOLOS_LUTE = 1110; //0x456
|
||||
const int SHAPE_SPELL_AMULET = 1111; //0x457
|
||||
const int SHAPE_JULIAS_HAMMER = 1112; //0x458
|
||||
//const int SHAPE_ORB_MOONGATE_NW_SE = 1113; //0x459
|
||||
//const int SHAPE_ORB_MOONGATE_NE_SW = 1114; //0x45A
|
||||
const int SHAPE_ETERNAL_FLAME = 1115; //0x45B
|
||||
const int SHAPE_FLAME_OF_INFINITY = 1116; //0x45C
|
||||
const int SHAPE_FLAME_OF_SINGULARITY = 1117; //0x45D
|
||||
const int SHAPE_DEATH_BOLT_NEW = 1118; //0x45E
|
||||
const int SHAPE_CODEX_BARRIER = 1119; //0x45F
|
||||
const int SHAPE_STAIRS_DOWN = 1120; //0x460
|
||||
const int SHAPE_FAKE_WATER = 1121; //0x461
|
||||
const int SHAPE_MARIAH = 1122; //0x462
|
||||
const int SHAPE_SHRINE = 1123; //0x463
|
||||
const int SHAPE_ITEM_OF_PRINCIPLE = 1124; //0x464
|
||||
const int SHAPE_CODEX_CARPET = 1125; //0x465
|
||||
const int SHAPE_LB_SCEPTER = 1126; //0x466
|
||||
const int SHAPE_LB_CROWN = 1127; //0x467
|
||||
const int SHAPE_LB_AMULET = 1128; //0x468
|
||||
const int SHAPE_MAGIC_CARPET = 1129; //0x469
|
||||
const int SHAPE_ROLLED_CARPET = 1130; //0x46A
|
||||
const int SHAPE_CARPET_ROLLER = 1131; //0x46B
|
||||
|
||||
//Added to SHAPE_STONE_CHIPS
|
||||
//added for Rune of Honor quest
|
||||
const int FRAME_SLATE = 5;
|
||||
|
||||
//Added to SHAPE_RUNE
|
||||
//added for Rune of Honor quest
|
||||
const int FRAME_RUNE_REPLICA = 8;
|
||||
|
||||
//Added to SHAPE_KITCHEN_ITEM
|
||||
const int FRAME_CHURN_2 = 16;
|
||||
const int FRAME_CHURN_3 = 17;
|
||||
const int FRAME_PITCHER_MILK = 18;
|
||||
|
||||
//Added to SHAPE_DOUGH
|
||||
//flat dough + apples = pie dough (when baked in oven, this creates a pie)
|
||||
const int FRAME_DOUGH_PIE = 3;
|
||||
//flour + egg = cake dough (when baked in oven, this creates a cake)
|
||||
const int FRAME_DOUGH_CAKE = 4;
|
||||
|
||||
//Added to SHAPE_BUCKET
|
||||
const int FRAME_BUCKET_MILK = 7;
|
||||
@@ -0,0 +1,869 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006-2009 Alun Bestor/The Exult Team/Team TFL
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
// Title: Constants
|
||||
// This header file defines general constants used throughout usecode, for
|
||||
// Black Gate and Serpent Isle. Constants particular to a function can be
|
||||
// found in the relevant codefile; constants particular to a game can be
|
||||
// found in that game's header directory.
|
||||
//
|
||||
// *Author:* Alun Bestor (exult at washboardabs dot net)
|
||||
// with modifications by Marzo Junior (marzojr at yahoo dot com)
|
||||
// and NaturalDocs implementation by Peter M Dodge (twicescorned at gmail dot com)
|
||||
//
|
||||
// *Last modified:* 2009-01-31
|
||||
|
||||
|
||||
// Enum: events
|
||||
// Event types, compiled with help from Marzo
|
||||
//
|
||||
// The global *event* variable is set with one of these values to describe
|
||||
// how the current function was called: whether by the player clicking on
|
||||
// the object, or by a scripted event, or by egg trigger conditions, or
|
||||
// just the item being onscreen, etc.
|
||||
//
|
||||
// Functions check the value of *event* in order to provide different responses
|
||||
// to different events.
|
||||
//
|
||||
// Functions can also set *event* to an arbitrary value, in order to mimic a real
|
||||
// event or just as a 'pseudo-argument' to functions called with the likes of UI_path_run_usecode.
|
||||
//
|
||||
// PROXIMITY = 0 - Object is on-screen or nearby. This is called repeatedly, with a random
|
||||
// delay between each call
|
||||
// DOUBLECLICK = 1 - Object is double-clicked on.
|
||||
// SCRIPTED = 2 - Function is called from inside a sript{} block (very common).
|
||||
// EGG = 3 - Object is an egg that just hatched (triggered by egg activation conditions).
|
||||
// WEAPON = 4 - Object was wielded and 'swung' in combat. This is mainly used with
|
||||
// 'weapon-like' objects, e.g. smokebombs and fishing rods, that have more advanced 'attack' behaviour.
|
||||
// READIED = 5 - Object was worn or readied in inventory - used by items like the Ring of Invisibility.
|
||||
// UNREADIED = 6 - Object was taken off or put away in inventory.
|
||||
// DEATH = 7 - NPC has just been killed (SI-only).
|
||||
// STARTED_TALKING = 9 - NPC starts conversation with you (has TALK schedule and has reached the Avatar).
|
||||
// This is SI-only, BG uses event 1 for this, both for conversations triggered by doubleclick
|
||||
// and by the TALK schedule.
|
||||
//
|
||||
// The following events are set manually in usecode, which means they're arbitrary programmer
|
||||
// conventions rather than recognised game states.
|
||||
//
|
||||
// PATH_SUCCESS = 10 - Set with calls to UI_path_run_usecode, to indicate a successful pathfind
|
||||
// to the target object.
|
||||
// PATH_FAILURE = 11 - Set with calls to UI_set_path_failure, to indicate an interrupted pathfind
|
||||
// (e.g. when the player moves the Avatar manually)
|
||||
//
|
||||
// In particular, I switched to SI values for these events because si_tournament flag
|
||||
// also works in BG now.
|
||||
enum events
|
||||
{
|
||||
PROXIMITY = 0,
|
||||
DOUBLECLICK = 1,
|
||||
SCRIPTED = 2,
|
||||
EGG = 3,
|
||||
WEAPON = 4,
|
||||
READIED = 5,
|
||||
UNREADIED = 6,
|
||||
DEATH = 7,
|
||||
STARTED_TALKING = 9,
|
||||
PATH_SUCCESS = 10,
|
||||
PATH_FAILURE = 11
|
||||
};
|
||||
|
||||
|
||||
// Enum: axes
|
||||
// Coordinate axes, use when referencing X,Y,Z coordinate arrays, e.g. from UI_get_object_position
|
||||
//
|
||||
// Note that the coordinates returned by UI_click_on_item are 1 array-index higher, because
|
||||
// index 1 of the returned array is the actual item clicked on. You can resolve this to a
|
||||
// regular X,Y,Z coordinates array by using array = removeFromArray(array, array[1]).
|
||||
//
|
||||
// X = 1 - horizontal axis (numbered from west to east).
|
||||
// Y = 2 - vertical axis (numbered from north to south).
|
||||
// Z = 3 - lift axis (numbered from ground to sky).
|
||||
//
|
||||
// See Also:
|
||||
// <Externals>
|
||||
enum axes
|
||||
{
|
||||
X = 1,
|
||||
Y = 2,
|
||||
Z = 3
|
||||
};
|
||||
|
||||
|
||||
// Enum: directions
|
||||
// Cardinal directions: returned by UI_get_direction. Use with face or step statements in script{} blocks.
|
||||
//
|
||||
// NORTH = 0 - Compass north.
|
||||
// NORTHEAST = 1 - Compass northeast.
|
||||
// EAST = 2 - Compass east.
|
||||
// SOUTHEAST = 3 - Compass southeast.
|
||||
// SOUTH = 4 - Compass south.
|
||||
// SOUTHWEST = 5 - Compass southwest.
|
||||
// WEST = 6 - Compass west.
|
||||
// NORTHWEST = 7 - Compass northwest.
|
||||
//
|
||||
// Example:
|
||||
// > script item { step NORTH; step NORTH; face SOUTH; } //take two steps north, then turn to face south
|
||||
enum directions
|
||||
{
|
||||
NORTH = 0,
|
||||
NORTHEAST = 1,
|
||||
EAST = 2,
|
||||
SOUTHEAST = 3,
|
||||
SOUTH = 4,
|
||||
SOUTHWEST = 5,
|
||||
WEST = 6,
|
||||
NORTHWEST = 7
|
||||
};
|
||||
|
||||
|
||||
// Enum: day_periods
|
||||
// Parts of the day (3-hour intervals). Returned by UI_part_of_day. This is usually only
|
||||
// used by conversation scripts, as a way of narrowing down schedule-related behaviour.
|
||||
//
|
||||
// MIDNIGHT = 0 - 0-2
|
||||
// EARLY = 1 - 3-5 (dim palette)
|
||||
// DAWN = 2 - 6-8 (day palette)
|
||||
// MORNING = 3 - 9-11
|
||||
// NOON = 4 - 12-14
|
||||
// AFTERNOON = 5 - 15-17
|
||||
// EVENING = 6 - 18-20 (dim palette)
|
||||
// NIGHT = 7 - 21-23 (night palette)
|
||||
enum day_periods
|
||||
{
|
||||
MIDNIGHT = 0,
|
||||
EARLY = 1,
|
||||
DAWN = 2,
|
||||
MORNING = 3,
|
||||
NOON = 4,
|
||||
AFTERNOON = 5,
|
||||
EVENING = 6,
|
||||
NIGHT = 7
|
||||
};
|
||||
|
||||
|
||||
// Enum: wildcards
|
||||
// Wildcards, used for specifying "any acceptable value for this parameter" to a
|
||||
// measuring function. These are commonly used with object-related intrinsics like
|
||||
// <UI_get_cont_items>, <UI_count_objects>, <UI_remove_party_items>, etc.
|
||||
//
|
||||
// SHAPE_ANY = -359 - Any valid object from SHAPES.VGA.
|
||||
// QUALITY_ANY = -359 - Any valid quality parameter.
|
||||
// FRAME_ANY = -359 - Any valid fram for a given shape.
|
||||
enum wildcards
|
||||
{
|
||||
SHAPE_ANY = -359,
|
||||
QUALITY_ANY = -359,
|
||||
FRAME_ANY = -359,
|
||||
FIND_ON_SCREEN = -359
|
||||
};
|
||||
|
||||
|
||||
// Enum: times
|
||||
// Tick multipliers, for use with UI_advance_time or script statements
|
||||
//
|
||||
// MINUTE = 25 - One game 'minute'.
|
||||
// HOUR = 1500 - One game 'hour'.
|
||||
// DAY = 36000 - One game 'day'.
|
||||
//
|
||||
// Examples:
|
||||
// > UI_advance_time(30 * MINUTE); //advance time by 30 game minutes
|
||||
// > UI_advance_time(2 * HOUR); //advance time by two game hours
|
||||
// > script after MINUTE ticks { ... } //schedule this script block to execute after one game minute
|
||||
enum times
|
||||
{
|
||||
MINUTE = 25,
|
||||
HOUR = 1500
|
||||
};
|
||||
const long DAY = 36000;
|
||||
|
||||
|
||||
// Enum: item_flags
|
||||
// Item/NPC flags, stolen from the Exult LB-joins-party patch with some comments added.
|
||||
//
|
||||
// These can be retrieved and set using UI_get_item_flag(itemref, flag),
|
||||
// UI_set_item_flag(itemref, flag) and UI_clear_item_flag(itemref, flag).
|
||||
//
|
||||
// INVISIBLE = 0 - Object is invisible (rendered with 'invisible' palette).
|
||||
// See <Invisibility>, <MassInvisibility>.
|
||||
// ASLEEP = 1 - Object is asleep. Only really useful for PC/NPC/monster.
|
||||
// See <Sleep>.
|
||||
// CHARMED = 2 - Object is charmed (attacks allies). Only really useful for PC/NPC/monster.
|
||||
// See <Charm>, <MassCharm>.
|
||||
// CURSED = 3 - Object is cursed (stats malus). Only really useful for PC/NPC/monster. See <Curse>.
|
||||
// DEAD = 4 - Object is dead. Only really useful for NPC/monster.
|
||||
// *DONT set on dead bodies, causes bugs.*
|
||||
// IN_PARTY = 6 - Object is an NPC in the party.
|
||||
// PARALYZED = 7 - Object is paralysed and unable to move. Normal objects will be stationary by default.
|
||||
// See <Paralyze>.
|
||||
// PARALYSED = 7 - Canadian/British spelling.
|
||||
// POISONED = 8 - Object is afflicted with poison.
|
||||
// Can be set on objects, but will only do anything to PC/NPC/monster. See <Poison>.
|
||||
// PROTECTION = 9 - Object is protected from harm. Only really useful for PC/NPC/monster. See <Protection>.
|
||||
// ON_MOVING_BARGE = 10 - Object is on a 'barge' object that is moving.
|
||||
// OKAY_TO_TAKE = 11 - Object will not trigger stealing usecode if you take it.
|
||||
// MIGHT = 12 - Object has might. (Stats boon) Only really useful for PC/NPC/monster.
|
||||
// See <Might>, <MassMight>.
|
||||
// IMMUNITIES = 13 - Object has several immunities. Can be gotten only.
|
||||
// CANT_DIE = 14 - Object can't die. Used for testing purposes, and certain critical NPCs (such as L.B.).
|
||||
// DANCING = 15 - Object is executing the usecode called by the <Dance> spell.
|
||||
// DONT_MOVE = 16 - SI: User cannot move.
|
||||
// DONT_RENDER = 16 - BG: Same as INVISIBLE, but don't render at all.
|
||||
// SI_ON_MOVING_BARGE = 17 - SI: Object is on a special instance of the SI barges. (Turtle for example.)
|
||||
// TEMPORARY = 18 - Object is temporary and will decay once the chunk it is in is un-cached.
|
||||
// SAILOR = 20 - Object is the 'captain' of a barge. *Only set on PC/NPCs!*
|
||||
// OKAY_TO_LAND = 21 - Set in usecode for flying carpet, TRUE if you can land currently.
|
||||
// BG_DONT_MOVE = 22 - BG: BG's version of DONT_MOVE.
|
||||
// IN_DUNGEON = 23 - If set on PC or an NPC, they won't trigger the stealing usecode if they take food objects.
|
||||
// CONFUSED = 25 - Object is 'confused' - no apparent intrinsic affects. Was supposed to be part of a spell
|
||||
// axed for space limitations in spellbook.
|
||||
// IN_MOTION = 26 - Object is a barge object moving, or on a barge object that is moving. Set in usecode, and
|
||||
// mostly used for the SI 'NPC' ships such as the turtle.
|
||||
// MET = 28 - Object has been talked to previously. Should be set in a conversation Usecode script.
|
||||
// This determines conversation behaviour, and whether the NPC's real name or shape name is displayed when they are
|
||||
// single-clicked on. BG originally used global flags for this, which amounts to an extra 250-odd flags. What a waste of
|
||||
// time.
|
||||
//
|
||||
// Flags 29, 30, and 38 were originally SI-only, but are implemented in BG by Exult.
|
||||
//
|
||||
// SI_TOURNAMENT = 29 - Object call usecode (eventid = 7) on death. Used for the List Field in SI.
|
||||
// SI_ZOMBIE = 30 - Object will not respond to normal cues.
|
||||
// Used for sick Neyobi, insane party members/Cantra.
|
||||
// NAKED = 38 - Object is naked. On PC, causes them to use appropriate 'naked' shape. On NPCs or
|
||||
// monsters, no effect unless you give it a meaning in Usecode scripting. To actually make NPCs naked, use
|
||||
// set_polymorph instead.
|
||||
//
|
||||
// Flags > 31 appear to be SI flags only, excepting 38 which Exult implements (above).
|
||||
//
|
||||
// NO_SPELL_CASTING = 31 - Object cannot cast spells nor have spells cast upon them. Used to protect certain NPCs.
|
||||
// POLYMORPH = 32 - Object is polymorphed. Used in <SerpentBond> spell.
|
||||
// TATTOOED = 33 - Object has been tattooed. Set after the lady tattoos you by usecode. Causes the NPC
|
||||
// portraits to use a different 'tattooed' shape num.
|
||||
// READ = 34 - Object can read serpent-script text. Set by the <Translate> spell. Only really
|
||||
// meaningful used on the PC.
|
||||
// PETRA = 35 - Object has switched bodies with petra. Only really meaningful used on the PC.
|
||||
// FREEZE = 36 - Object cannot move. Used as part of the <Freeze> spell.
|
||||
enum item_flags
|
||||
{
|
||||
INVISIBLE = 0,
|
||||
ASLEEP = 1,
|
||||
CHARMED = 2,
|
||||
CURSED = 3,
|
||||
DEAD = 4,
|
||||
IN_PARTY = 6,
|
||||
PARALYZED = 7,
|
||||
PARALYSED = 7,
|
||||
POISONED = 8,
|
||||
PROTECTION = 9,
|
||||
ON_MOVING_BARGE = 10,
|
||||
OKAY_TO_TAKE = 11,
|
||||
MIGHT = 12,
|
||||
IMMUNITIES = 13,
|
||||
CANT_DIE = 14,
|
||||
DANCING = 15,
|
||||
//DONT_MOVE = 16,
|
||||
DONT_RENDER = 16,
|
||||
SI_ON_MOVING_BARGE= 17,
|
||||
TEMPORARY = 18,
|
||||
SAILOR = 20,
|
||||
OKAY_TO_LAND = 21,
|
||||
BG_DONT_MOVE = 22,
|
||||
IN_DUNGEON = 23,
|
||||
CONFUSED = 25,
|
||||
IN_MOTION = 26,
|
||||
MET = 28,
|
||||
SI_TOURNAMENT = 29,
|
||||
SI_ZOMBIE = 30,
|
||||
NO_SPELL_CASTING = 31,
|
||||
POLYMORPH = 32,
|
||||
TATTOOED = 33,
|
||||
READ = 34,
|
||||
PETRA = 35,
|
||||
FREEZE = 37,
|
||||
NAKED = 38
|
||||
};
|
||||
|
||||
|
||||
// Enum: schedules
|
||||
// Business activities (taken from the cheat screen).
|
||||
//
|
||||
// IN_COMBAT = 0 - Creature will fight nearby creatures of opposite alignment. Renamed to not conflict with
|
||||
// COMBAT, the NPC stat property.
|
||||
// PACE_HORIZONTAL = 1 - Walk horizontally until you hit a wall, then turn around. (Patrolling on the cheap.)
|
||||
// PACE_VERTICAL = 2 - Same as above, but vertically.
|
||||
// TALK = 3 - NPC runs to the Avatar to talk to them. When they get within a certain distance of where
|
||||
// the Avatar was when this schedule was set, a doubleclick event is triggered on the NPC. At this point the
|
||||
// schedule must be changed.
|
||||
// DANCE = 4 - NPC dances, basically moving about and looking kinda funny. :-)
|
||||
// EAT = 5 - Find the nearest table with a place set with plate. Wait for food. Eat.
|
||||
// FARM = 6 - Waves farm implements around. Otherwise, same as *Loiter*.
|
||||
// TEND_SHOP = 7 - Same as *Loiter,* but used to narrow down schedule barks in the Usecode.
|
||||
// MINE = 8 - Wander around with pickaxe, hack at random dungeon walls.
|
||||
// MINER = 8 - Same as above. Convinence name.
|
||||
// HOUND = 9 - Follow PC and party members very closely if they come close.
|
||||
// STANDTHERE = 10 - Just stand around, as name implies. Renamed to not conflict with STAND, the
|
||||
// NPC animation frame.
|
||||
// LOITER = 11 - Hangs around a certain point, within 10 units or so.
|
||||
// WANDER = 12 - Roams nearby a certain point (as much as a 320x200 screen away).
|
||||
// BLACKSMITH = 13 - Same as *Loiter*/*Tend_Shop*, except if there is a firepit, anvil, and trough around, the NPC
|
||||
// will smith items.
|
||||
// SLEEP = 14 - Find a bed, sleep in it. Pretty simple.
|
||||
// WAIT = 15 - Similar to *Stand*, except that they will never leave the WAIT schedule until it is
|
||||
// manually changed: their preset schedule list is overridden.
|
||||
// MAJOR_SIT = 16 - Do absolutely nothing but find the nearest seat and sit in it.
|
||||
// GRAZE = 17 - Wander around in the plains, eat grass. More for animals than NPCs. :-)
|
||||
// BAKE = 18 - Same as *Loiter*, unless the NPC has an oven and a table around, in which case they will
|
||||
// produce baked goods.
|
||||
// SEW = 19 - Same as *Loiter*, unless the NPC has a seat with a weaving loom and a seat with a spinning
|
||||
// wheel, in which case they will produce clothing.
|
||||
// SHY = 20 - Tries to keep out of the Avatar's way - will half-heartedly flee until out of a
|
||||
// certain range.
|
||||
// LAB = 21 - Same as *Loiter*, unless there is a table and cauldron around, in which case they will
|
||||
// produce potions.
|
||||
// THEIF = 22 - NPC follows the party, tries to steal items. Only really works if the NPC usecode has a
|
||||
// handler to take the items.
|
||||
// WAITER = 23 - NPC will go to other NPCs in the vicinity (same range as *Wander*), 'serving' food items to
|
||||
// them if they have a plate in front of them.
|
||||
// SPECIAL = 24 - Used in some special usecode scripts, namely Frigidazzi in SI. Basically stops a NPC from
|
||||
// wandering around such as with *Wait* but without neccesarily wiping the schedule.
|
||||
// KID_GAMES = 25 - Tag! Thou art it! And so forth.
|
||||
// TAG = 25 - Convinence name, same as above.
|
||||
enum schedules
|
||||
{
|
||||
IN_COMBAT = 0,
|
||||
PACE_HORIZONTAL = 1,
|
||||
PACE_VERTICAL = 2,
|
||||
TALK = 3,
|
||||
DANCE = 4,
|
||||
EAT = 5,
|
||||
FARM = 6,
|
||||
TEND_SHOP = 7,
|
||||
MINE = 8,
|
||||
MINER = 8,
|
||||
HOUND = 9,
|
||||
STANDTHERE = 10,
|
||||
LOITER = 11,
|
||||
WANDER = 12,
|
||||
BLACKSMITH = 13,
|
||||
SLEEP = 14,
|
||||
WAIT = 15,
|
||||
MAJOR_SIT = 16,
|
||||
GRAZE = 17,
|
||||
BAKE = 18,
|
||||
SEW = 19,
|
||||
SHY = 20,
|
||||
LAB = 21,
|
||||
THIEF = 22,
|
||||
WAITER = 23,
|
||||
SPECIAL = 24,
|
||||
KID_GAMES = 25,
|
||||
TAG = 25,
|
||||
EAT_AT_INN = 26, //same as Eat, only with different barks.
|
||||
DUEL = 27,
|
||||
SPAR = 27,
|
||||
PREACH = 28,
|
||||
PATROL = 29, //This tells the AI to follow a particular set of patrol waypoints
|
||||
DESK_WORK = 30,
|
||||
FOLLOW_AVATAR = 31 //That most noble of pursuits. Like WAIT, this completely overrides the NPC's schedule list.
|
||||
};
|
||||
|
||||
// Enum: npc_frames
|
||||
// NPC animation frames. Use these with UI_set_item_frame or (preferably) in script blocks,
|
||||
// with 'actor frame'.
|
||||
//
|
||||
// *Important note:* use 'actor frame' with NPCs instead of 'frame', as 'actor frame' takes
|
||||
// the NPC's current facing into account.
|
||||
//
|
||||
// Examples:
|
||||
// > script AVATAR { actor frame STAND; actor frame USE; actor frame SWING_1; actor_frame STAND; }
|
||||
//
|
||||
// STAND = 0 - standing at rest
|
||||
// WALK_1 = 1 - stepping forward
|
||||
// WALK_2 = 2 - stepping forward
|
||||
//
|
||||
// USE = 3 - general use motion
|
||||
//
|
||||
// SWING_1 = 4 - start of one-handed swing, arm up over shoulder
|
||||
// SWING_2 = 5 - middle of one-handed swing, arm out to the side
|
||||
// SWING_3 = 6 - end of one-handed swing, arm out to the front
|
||||
//
|
||||
// SWING_2H_1 = 7 - start of 2-handed swing, arms up over shoulder
|
||||
// SWING_2H_2 = 8 - middle of 2-handed swing, arms out to the side
|
||||
// SWING_2H_3 = 9 - end of 2-handed swing, arms out to the front
|
||||
//
|
||||
// SIT = 10 - sitting down
|
||||
// LEAN = 11 - leaning down
|
||||
// KNEEL = 12 - kneeling on one knee
|
||||
// LIE = 13 - lying down
|
||||
// CAST_1 = 14 - both arms high in the air (casting motion)
|
||||
// CAST_2 = 15 - both arms stretched out (casting motion)
|
||||
enum npc_frames
|
||||
{
|
||||
STAND = 0,
|
||||
WALK_1 = 1,
|
||||
WALK_2 = 2,
|
||||
|
||||
USE = 3,
|
||||
|
||||
SWING_1 = 4,
|
||||
SWING_2 = 5,
|
||||
SWING_3 = 6,
|
||||
|
||||
SWING_2H_1 = 7,
|
||||
SWING_2H_2 = 8,
|
||||
SWING_2H_3 = 9,
|
||||
|
||||
SIT = 10,
|
||||
LEAN = 11,
|
||||
KNEEL = 12,
|
||||
LIE = 13,
|
||||
CAST_1 = 14,
|
||||
CAST_2 = 15
|
||||
};
|
||||
|
||||
// Enum: frame_offsets
|
||||
// North/South/East/West frame offsets for the NPC frames. Only really necessary if you're
|
||||
// using <UI_set_item_frame> or 'frame'
|
||||
//
|
||||
// NORTH_FRAMESET = 0 - Frames in Shapes.vga start facing north
|
||||
// SOUTH_FRAMESET = 16 - After 16 frames they face south.
|
||||
// WEST_FRAMESET = 32 - After 32 frames they face west.
|
||||
// EAST_FRAMESET = 48 - After 48 frames they face east.
|
||||
enum frame_offsets
|
||||
{
|
||||
NORTH_FRAMESET = 0,
|
||||
SOUTH_FRAMESET = 16,
|
||||
WEST_FRAMESET = 32,
|
||||
EAST_FRAMESET = 48
|
||||
};
|
||||
|
||||
// Enum: is_readied_inv_slots
|
||||
// Ready slots: use with <UI_is_readied>. These are the same whether paperdolls are on or off.
|
||||
//
|
||||
//
|
||||
// IR_RIGHT_HAND = 1 - Item wielded in right hand
|
||||
// IR_WEAPON_HAND = 1 - Right hand is also called the weapon hand
|
||||
// IR_BOTH_HANDS = 1 - Item wielded with both hands
|
||||
//
|
||||
// IR_LEFT_HAND = 2 - Item wielded in left hand
|
||||
// IR_SHIELD_HAND = 2 - Left hand is also called the shield hand
|
||||
// IR_OFF_HAND = 2 - Left hand is also called the off hand
|
||||
//
|
||||
// IR_NECK = 3 - Item worn around the neck
|
||||
// IR_CLOAK = 3 - Cloaks happen to be worn around the neck
|
||||
//
|
||||
// IR_RIGHT_FINGER = 6 - Item worn on right finger (ring)
|
||||
// IR_LEFT_FINGER = 7 - Item worn on left finger (ring)
|
||||
// IR_GLOVES = 6 - Gloves technically take up the right finger spot.
|
||||
//
|
||||
// IR_HEAD = 9 - Items worn on the head such as headbands, helms, etc
|
||||
// IR_BELT = 11 - Items worn around the waist such as belts, girdles
|
||||
enum is_readied_inv_slots
|
||||
{
|
||||
IR_RIGHT_HAND = 1,
|
||||
IR_WEAPON_HAND = 1,
|
||||
IR_BOTH_HANDS = 1, //For two-handed items
|
||||
|
||||
IR_LEFT_HAND = 2,
|
||||
IR_SHIELD_HAND = 2,
|
||||
IR_OFF_HAND = 2,
|
||||
|
||||
IR_NECK = 3,
|
||||
IR_CLOAK = 3,
|
||||
|
||||
IR_RIGHT_FINGER = 6,
|
||||
IR_LEFT_FINGER = 7,
|
||||
IR_GLOVES = 6,
|
||||
|
||||
IR_HEAD = 9,
|
||||
|
||||
IR_QUIVER = 10,
|
||||
IR_BELT = 11, // - Worn across the waist, such as belts and girdles
|
||||
IR_TORSO = 5, // - Worn on the torso, such as armour
|
||||
IR_FEET = 13, // - Worn on feet, such as boots
|
||||
IR_LEGS = 14, // - Worn on legs, such as greaves
|
||||
IR_BACKPACK = 15, // - Containers worn on the back, such as backpacks
|
||||
IR_BACK_SHIELD = 16, // - *SI only.* Shield slung across the back
|
||||
IR_BACK_SPOT = 17 // - *SI only.* Weapon slung across the back
|
||||
|
||||
};
|
||||
|
||||
// Enum: get_readied_inv_slots
|
||||
// Ready slots: use with <UI_get_readied>. These are the same whether paperdolls are on or off.
|
||||
//
|
||||
// LEFT_HAND = 0 - Items wielded in the left hand.
|
||||
// SHIELD_HAND = 0 - Left hand is also called shield hand.
|
||||
// OTHER_HAND = 0 - Left hand is also called other hand.
|
||||
//
|
||||
// RIGHT_HAND = 1 - Items wielded in the right hand.
|
||||
// WEAPON_HAND = 1 - Right hand is also called the weapon hand.
|
||||
// BOTH_HANDS = 1 - Items worn in both hands technically count as wielded in the right hand.
|
||||
//
|
||||
// CLOAK = 2 - *SI only.* Items worn around the neck and back such as cloaks and capes.
|
||||
// NECK = 3 - Items worn on the neck such as a collar.
|
||||
// HEAD = 4 - Items worn on the head such as a helm.
|
||||
//
|
||||
// GLOVES = 5 - Items worn on both hands, such as gloves.
|
||||
// In BG, exclusive with ONE_FINGER and OTHER_FINGER
|
||||
//
|
||||
// USECODE_CONTAINER = 6 - *SI only.* Usecode container, used for containing eggs 'carried' by player.
|
||||
//
|
||||
// ONE_FINGER = 7 - Ring or item worn on right hand. In BG, exclusive with GLOVES.
|
||||
// OTHER_FINGER = 8 - Ring or item worn on left hand. In BG, exclusive with GLOVES
|
||||
//
|
||||
// EARRINGS = 9 - *SI only.* Earrings, such as the serpent earrings
|
||||
//
|
||||
// QUIVER = 10 - Arrows held in quiver
|
||||
// BELT = 11 - Worn across the waist, such as belts and girdles
|
||||
// TORSO = 12 - Worn on the torso, such as armour
|
||||
// FEET = 13 - Worn on feet, such as boots
|
||||
// LEGS = 14 - Worn on legs, such as greaves
|
||||
// BACKPACK = 15 - Containers worn on the back, such as backpacks
|
||||
// BACK_SHIELD = 16 - *SI only.* Shield slung across the back
|
||||
// BACK_SPOT = 17 - *SI only.* Weapon slung across the back
|
||||
enum get_readied_inv_slots
|
||||
{
|
||||
LEFT_HAND = 0,
|
||||
SHIELD_HAND = 0,
|
||||
OTHER_HAND = 0,
|
||||
|
||||
RIGHT_HAND = 1,
|
||||
WEAPON_HAND = 1,
|
||||
BOTH_HANDS = 1,
|
||||
|
||||
CLOAK = 2, //SI only
|
||||
NECK = 3,
|
||||
HEAD = 4,
|
||||
|
||||
GLOVES = 5, //In BG, exclusive with ONE_FINGER and OTHER_FINGER
|
||||
|
||||
USECODE_CONTAINER = 6, //SI only
|
||||
|
||||
ONE_FINGER = 7, //In BG, exclusive with GLOVES
|
||||
OTHER_FINGER = 8, //In BG, exclusive with GLOVES
|
||||
|
||||
EARRINGS = 9, //SI only
|
||||
|
||||
QUIVER = 10,
|
||||
BELT = 11,
|
||||
TORSO = 12,
|
||||
FEET = 13,
|
||||
LEGS = 14,
|
||||
BACKPACK = 15,
|
||||
BACK_SHIELD = 16, //SI only
|
||||
BACK_SPOT = 17 //SI only
|
||||
};
|
||||
|
||||
// Enum: npc_properties
|
||||
// NPC properties (mostly ability scores). These can be retrieved and set
|
||||
// using <UI_get_npc_property>(npc, property) and <UI_set_npc_property>(npc, property, value)
|
||||
// respectively. Note however that <UI_set_npc_property> will actually *add* the value to
|
||||
// the original property, not set it to that value. Which means you will need to calculate
|
||||
// a relative positive/negative adjustment to set it to a target value.
|
||||
//
|
||||
// STRENGTH = 0 - How strong a character is.
|
||||
// DEXTERITY = 1 - The manual dexterity of the character.
|
||||
// INTELLIGENCE = 2 - How intelligent a character is.
|
||||
// HEALTH = 3 - How much punishment a character can take before they die.
|
||||
// COMBAT = 4 - The combat skill of a character.
|
||||
// MANA = 5 - The mental reserves of a spellcaster.
|
||||
// MAX_MANA = 6 - The maximum mana a spellcaster can have.
|
||||
// TRAINING = 7 - Training points are used to increase stats.
|
||||
// EXPERIENCE = 8 - Experience points accumulate to increase levels.
|
||||
// FOODLEVEL = 9 - How sustained a character is.
|
||||
enum npc_properties
|
||||
{
|
||||
STRENGTH = 0,
|
||||
DEXTERITY = 1,
|
||||
INTELLIGENCE = 2,
|
||||
HEALTH = 3,
|
||||
COMBAT = 4,
|
||||
MANA = 5,
|
||||
MAX_MANA = 6,
|
||||
TRAINING = 7,
|
||||
EXPERIENCE = 8,
|
||||
FOODLEVEL = 9
|
||||
};
|
||||
|
||||
// Enum: npc_attack_modes
|
||||
// NPC attack behaviours. Retrieve and set using <UI_set_attack_mode>(npc, mode)
|
||||
// and <UI_get_attack_mode>(npc).
|
||||
//
|
||||
// NEAREST = 0 - Attack the nearest hostile NPC.
|
||||
// WEAKEST = 1 - Attack the hostile NPC deemed the weakest.
|
||||
// STRONGEST = 2 - Attack the hostile NPC deemed the strongest.
|
||||
// BERSERK = 3 - Attack anything and everything!
|
||||
// PROTECT = 4 - Go to the protection of party members in Defend mode.
|
||||
// DEFEND = 5 - Defend a designated party member. Only useful for members of the party.
|
||||
// FLANK = 6 - Try to get to the enemy's side.
|
||||
// FLEE = 7 - Flee from any enemy that tries to engage them.
|
||||
// RANDOM = 8 - Random of the above.
|
||||
// MANUAL = 9 - Player-controlled. Only the Avatar can be manual controlled, though in
|
||||
// the future I'd like to see it that it can just be any _one_ party member.
|
||||
enum npc_attack_modes
|
||||
{
|
||||
NEAREST = 0,
|
||||
WEAKEST = 1,
|
||||
STRONGEST = 2,
|
||||
BERSERK = 3,
|
||||
PROTECT = 4,
|
||||
DEFEND = 5,
|
||||
FLANK = 6,
|
||||
FLEE = 7,
|
||||
RANDOM = 8,
|
||||
MANUAL = 9
|
||||
};
|
||||
|
||||
// Enum: cursors
|
||||
// Failure cursor constants for use with <UI_flash_mouse>. Note that these do not
|
||||
// correspond to frame numbers in pointers.uc, but to some internal mapping. (the
|
||||
// "BLOCKED" cursor seems to be unavailable through this method.)
|
||||
//
|
||||
// CURSOR_X = 1 - Default "no you can't do that" X cursor
|
||||
// CURSOR_OUT_OF_RANGE = 2 - Displays a message "out of range"
|
||||
// CURSOR_OUT_OF_AMMO = 3 - Displays a message "out of ammo", should only be for projectile weapons of course.
|
||||
// CURSOR_TOO_HEAVY = 4 - Displays a message "too heavy", when we cant move something.
|
||||
// CURSOR_WONT_FIT = 5 - Displays a message "won't fit", when we exceed container size.
|
||||
enum cursors
|
||||
{
|
||||
CURSOR_X = 1,
|
||||
CURSOR_OUT_OF_RANGE = 2,
|
||||
CURSOR_OUT_OF_AMMO = 3,
|
||||
CURSOR_TOO_HEAVY = 4,
|
||||
CURSOR_WONT_FIT = 5
|
||||
};
|
||||
|
||||
// Enum: alignments
|
||||
// NPC atitudes toward the player.
|
||||
//
|
||||
// FRIENDLY = 0 - Will aid the player in combat.
|
||||
// NEUTRAL = 1 - Won't aid, or hinder, the player in combat.
|
||||
// HOSTILE = 2 - Will hinder the player and attempt to attack them if possible.
|
||||
// RANDOM_ALIGN = 3 - Random of the above.
|
||||
enum alignments
|
||||
{
|
||||
FRIENDLY = 0,
|
||||
NEUTRAL = 1,
|
||||
HOSTILE = 2,
|
||||
RANDOM_ALIGN = 3
|
||||
};
|
||||
|
||||
// Enum: weather_types
|
||||
// Different engine weather types.
|
||||
//
|
||||
// CLEAR_WEATHER = 0 - Clear skies, no clouds, nothing.
|
||||
// SNOWING = 1 - Unsure; in Exult, works the same as RAIN, below and seems identical to RAIN in the originals.
|
||||
// RAIN = 2 - Rain falling, overcast and dark skies.
|
||||
// SPARKLE = 3 - Prevents casting of spells in BG (and maybe SI too?)
|
||||
// FOG = 4 - Seems to work like RAIN in the originals. More overcast.
|
||||
// OVERCAST = 5 - Seems to clear weather in the originals.
|
||||
// CLOUDY = 6 - Clouds appear but otherwise, clear.
|
||||
enum weather_types
|
||||
{
|
||||
CLEAR_WEATHER = 0,
|
||||
SNOWING = 1, //Unsure; in Exult, works the same as RAIN, below and seems identical to RAIN in the originals
|
||||
RAIN = 2,
|
||||
SPARKLE = 3, //Prevents casting of spells in BG (and maybe SI too?)
|
||||
FOG = 4, //Seems to work like RAIN in the originals
|
||||
OVERCAST = 5, //Seems to clear weather in the originals
|
||||
CLOUDY = 6
|
||||
};
|
||||
|
||||
// Enum: item_masks
|
||||
// Mask values used (e.g.) in <find_nearby> intrinsic; these are flags, which mean
|
||||
// that they can be added together.
|
||||
//
|
||||
// MASK_NONE = 0x0 - No masks apply to this object.
|
||||
// MASK_NPC = 0x04 - Non-player characters.
|
||||
// MASK_NPC2 = 0x08 - Maybe non-party NPCs only? All NPCs in Exult.
|
||||
// MASK_EGG = 0x10 - Item is a usecode egg. Also for barges
|
||||
// MASK_INVISIBLE = 0x20 - Render the object using the invisible pallete.
|
||||
// MASK_PARTY_INVISIBLE = 0x40 - Invisible, but only to the party? Unsure.
|
||||
// MASK_TRANSLUCENT = 0x80 - Do not render.
|
||||
// MASK_ALL_UNSEEN = 0xB0 - MASK_EGG + MASK_INVISIBLE + MASK_TRANLUCENT.
|
||||
enum item_masks
|
||||
{
|
||||
MASK_NONE = 0x0,
|
||||
MASK_NPC = 0x04,
|
||||
MASK_NPC2 = 0x08,
|
||||
MASK_EGG = 0x10,
|
||||
MASK_INVISIBLE = 0x20,
|
||||
MASK_PARTY_INVISIBLE = 0x40,
|
||||
MASK_TRANSLUCENT = 0x80,
|
||||
MASK_ALL_UNSEEN = 0xB0
|
||||
};
|
||||
|
||||
// Enum: npc_rot_frames
|
||||
// NPC animation frames, WITH rotation bit. Use these with UI_set_item_frame_rot
|
||||
// or (preferably) in script blocks, with 'frame'.
|
||||
//
|
||||
// Examples:
|
||||
// > script AVATAR { frame STAND_WEST; frame USE_NORTH; frame SWING_1_SOUTH; frame STAND_EAST; }
|
||||
//
|
||||
// STAND_NORTH - 0x0000
|
||||
// WALK_1_NORTH - 0x0001
|
||||
// WALK_2_NORTH - 0x0002
|
||||
// USE_NORTH - 0x0003
|
||||
// SWING_1_NORTH - 0x0004
|
||||
// SWING_2_NORTH - 0x0005
|
||||
// SWING_3_NORTH - 0x0006
|
||||
// SWING_2H_1_NORTH - 0x0007
|
||||
// SWING_2H_2_NORTH - 0x0008
|
||||
// SWING_2H_3_NORTH - 0x0009
|
||||
// SIT_NORTH - 0x000A
|
||||
// LEAN_NORTH - 0x000B
|
||||
// KNEEL_NORTH - 0x000C
|
||||
// LIE_NORTH - 0x000D
|
||||
// CAST_1_NORTH - 0x000E
|
||||
// CAST_2_NORTH - 0x000F
|
||||
// STAND_SOUTH - 0x0010
|
||||
// WALK_1_SOUTH - 0x0011
|
||||
// WALK_2_SOUTH - 0x0012
|
||||
// USE_SOUTH - 0x0013
|
||||
// SWING_1_SOUTH - 0x0014
|
||||
// SWING_2_SOUTH - 0x0015
|
||||
// SWING_3_SOUTH - 0x0016
|
||||
// SWING_2H_1_SOUTH - 0x0017
|
||||
// SWING_2H_2_SOUTH - 0x0018
|
||||
// SWING_2H_3_SOUTH - 0x0019
|
||||
// SIT_SOUTH - 0x001A
|
||||
// LEAN_SOUTH - 0x001B
|
||||
// KNEEL_SOUTH - 0x001C
|
||||
// LIE_SOUTH - 0x001D
|
||||
// CAST_1_SOUTH - 0x001E
|
||||
// CAST_2_SOUTH - 0x001F
|
||||
// STAND_WEST - 0x0020
|
||||
// WALK_1_WEST - 0x0021
|
||||
// WALK_2_WEST - 0x0022
|
||||
// USE_WEST - 0x0023
|
||||
// SWING_1_WEST - 0x0024
|
||||
// SWING_2_WEST - 0x0025
|
||||
// SWING_3_WEST - 0x0026
|
||||
// SWING_2H_1_WEST - 0x0027
|
||||
// SWING_2H_2_WEST - 0x0028
|
||||
// SWING_2H_3_WEST - 0x0029
|
||||
// SIT_WEST - 0x002A
|
||||
// LEAN_WEST - 0x002B
|
||||
// KNEEL_WEST - 0x002C
|
||||
// LIE_WEST - 0x002D
|
||||
// CAST_1_WEST - 0x002E
|
||||
// CAST_2_WEST - 0x002F
|
||||
// STAND_EAST - 0x0030
|
||||
// WALK_1_EAST - 0x0031
|
||||
// WALK_2_EAST - 0x0032
|
||||
// USE_EAST - 0x0033
|
||||
// SWING_1_EAST - 0x0034
|
||||
// SWING_2_EAST - 0x0035
|
||||
// SWING_3_EAST - 0x0036
|
||||
// SWING_2H_1_EAST - 0x0037
|
||||
// SWING_2H_2_EAST - 0x0038
|
||||
// SWING_2H_3_EAST - 0x0039
|
||||
// SIT_EAST - 0x003A
|
||||
// LEAN_EAST - 0x003B
|
||||
// KNEEL_EAST - 0x003C
|
||||
// LIE_EAST - 0x003D
|
||||
// CAST_1_EAST - 0x003E
|
||||
// CAST_2_EAST - 0x003F
|
||||
enum npc_rot_frames
|
||||
{
|
||||
STAND_NORTH = 0x0000,
|
||||
WALK_1_NORTH = 0x0001,
|
||||
WALK_2_NORTH = 0x0002,
|
||||
USE_NORTH = 0x0003,
|
||||
SWING_1_NORTH = 0x0004,
|
||||
SWING_2_NORTH = 0x0005,
|
||||
SWING_3_NORTH = 0x0006,
|
||||
SWING_2H_1_NORTH = 0x0007,
|
||||
SWING_2H_2_NORTH = 0x0008,
|
||||
SWING_2H_3_NORTH = 0x0009,
|
||||
SIT_NORTH = 0x000A,
|
||||
LEAN_NORTH = 0x000B,
|
||||
KNEEL_NORTH = 0x000C,
|
||||
LIE_NORTH = 0x000D,
|
||||
CAST_1_NORTH = 0x000E,
|
||||
CAST_2_NORTH = 0x000F,
|
||||
STAND_SOUTH = 0x0010,
|
||||
WALK_1_SOUTH = 0x0011,
|
||||
WALK_2_SOUTH = 0x0012,
|
||||
USE_SOUTH = 0x0013,
|
||||
SWING_1_SOUTH = 0x0014,
|
||||
SWING_2_SOUTH = 0x0015,
|
||||
SWING_3_SOUTH = 0x0016,
|
||||
SWING_2H_1_SOUTH = 0x0017,
|
||||
SWING_2H_2_SOUTH = 0x0018,
|
||||
SWING_2H_3_SOUTH = 0x0019,
|
||||
SIT_SOUTH = 0x001A,
|
||||
LEAN_SOUTH = 0x001B,
|
||||
KNEEL_SOUTH = 0x001C,
|
||||
LIE_SOUTH = 0x001D,
|
||||
CAST_1_SOUTH = 0x001E,
|
||||
CAST_2_SOUTH = 0x001F,
|
||||
STAND_WEST = 0x0020,
|
||||
WALK_1_WEST = 0x0021,
|
||||
WALK_2_WEST = 0x0022,
|
||||
USE_WEST = 0x0023,
|
||||
SWING_1_WEST = 0x0024,
|
||||
SWING_2_WEST = 0x0025,
|
||||
SWING_3_WEST = 0x0026,
|
||||
SWING_2H_1_WEST = 0x0027,
|
||||
SWING_2H_2_WEST = 0x0028,
|
||||
SWING_2H_3_WEST = 0x0029,
|
||||
SIT_WEST = 0x002A,
|
||||
LEAN_WEST = 0x002B,
|
||||
KNEEL_WEST = 0x002C,
|
||||
LIE_WEST = 0x002D,
|
||||
CAST_1_WEST = 0x002E,
|
||||
CAST_2_WEST = 0x002F,
|
||||
STAND_EAST = 0x0030,
|
||||
WALK_1_EAST = 0x0031,
|
||||
WALK_2_EAST = 0x0032,
|
||||
USE_EAST = 0x0033,
|
||||
SWING_1_EAST = 0x0034,
|
||||
SWING_2_EAST = 0x0035,
|
||||
SWING_3_EAST = 0x0036,
|
||||
SWING_2H_1_EAST = 0x0037,
|
||||
SWING_2H_2_EAST = 0x0038,
|
||||
SWING_2H_3_EAST = 0x0039,
|
||||
SIT_EAST = 0x003A,
|
||||
LEAN_EAST = 0x003B,
|
||||
KNEEL_EAST = 0x003C,
|
||||
LIE_EAST = 0x003D,
|
||||
CAST_1_EAST = 0x003E,
|
||||
CAST_2_EAST = 0x003F
|
||||
};
|
||||
|
||||
// Enum: damage_types
|
||||
// Constants for the various types of damage in the game.
|
||||
//
|
||||
// NORMAL_DAMAGE = 0 - Normal damage.
|
||||
// FIRE_DAMAGE = 1 - Damage from heat sources.
|
||||
// MAGIC_DAMAGE = 2 - Damage from a magical source.
|
||||
// LIGHTNING_DAMAGE = 3 - Damage from electrical sources such as lightning.
|
||||
// ETHEREAL_DAMAGE = 4 - Special magical damage, basically magic damage not
|
||||
// blocked by normal magic resistance.
|
||||
// SONIC_DAMAGE = 5 - Sound-based damage.
|
||||
enum damage_types
|
||||
{
|
||||
NORMAL_DAMAGE = 0,
|
||||
FIRE_DAMAGE = 1,
|
||||
MAGIC_DAMAGE = 2,
|
||||
LIGHTNING_DAMAGE = 3,
|
||||
ETHEREAL_DAMAGE = 4,
|
||||
SONIC_DAMAGE = 5
|
||||
};
|
||||
565
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/services.uc
Executable file
565
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/services.uc
Executable file
@@ -0,0 +1,565 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This source file contains functions used in general services (selling of
|
||||
* items, spells and healing).
|
||||
*
|
||||
* Author: Marzo Junior
|
||||
* Last Modified: 2006-02-27
|
||||
*/
|
||||
|
||||
|
||||
enum selling_result
|
||||
{
|
||||
NO_QUANTITY = 0,
|
||||
SELL_SUCCEEDED = 1,
|
||||
CANNOT_CARRY = 2,
|
||||
NOT_ENOUGH_GOLD = 3
|
||||
};
|
||||
|
||||
enum healing_type
|
||||
{
|
||||
USE_HERBS = 1,
|
||||
USE_BANDAGES = 2,
|
||||
USE_POTIONS = 3,
|
||||
USE_MAGIC = 4
|
||||
};
|
||||
|
||||
enum healing_prices
|
||||
{
|
||||
SERVICE_NONE = 0,
|
||||
SERVICE_CURE = 1,
|
||||
SERVICE_HEAL = 2,
|
||||
SERVICE_RESURRECT = 3
|
||||
};
|
||||
|
||||
|
||||
enum npc_wizard_flags
|
||||
{
|
||||
//New spell effects:
|
||||
CONFUSION = 40, //Under the effects of Consufion spell
|
||||
DEATH_PROTECTION = 41, //Protected from death spells
|
||||
MAGIC_PROTECTION = 42, //Protected from spells -- e.g., LB's crown
|
||||
//Spellcasting power:
|
||||
ARCHWIZARD = 45, //Cheat mode
|
||||
MAGE_CLASS = 46, //Full spellcasting capabilities
|
||||
BARD_CLASS = 47, //1/2 level spellcasting
|
||||
WARMAGE = 48, //Combat spells cost half as much mana (round up)
|
||||
SUMMONER = 49, //Summoning spells cost half as much mana (round up)
|
||||
HEALER = 50, //Casts healing as if level 8, no death spells
|
||||
NECROMANCER = 51, //Casts death as if level 8, no healing spells
|
||||
//The next constants are used to control spellcaster AI; the AI is NOT
|
||||
//IMPLEMENTED YET.
|
||||
AI_CAST_DONT_CAST = 52, //AI will not cast any spells
|
||||
AI_CAST_VERY_FEW = 53, //AI will cast every 32-36 ticks
|
||||
AI_CAST_FEW = 54, //AI will cast every 24-28 ticks
|
||||
//AI_CAST_DEFAULT //AI will cast every 16-20 ticks
|
||||
AI_CAST_MANY = 55, //AI will cast every 8-12 ticks
|
||||
AI_HEALING = 56, //AI will try to cast healing spells first
|
||||
AI_SUPPORT = 57, //AI will try to cast support spells first
|
||||
AI_OFFENSE = 58, //AI will try to cast damaging combat first
|
||||
AI_SUMMON = 59, //AI will try to summon creatures first
|
||||
AI_ENCHANT = 60, //AI will try to cast non-damage combat spells
|
||||
AI_DEATH = 61, //AI will try to cast death spells first
|
||||
AI_MISDIRECTION = 62, //AI will try to use invisibility+blink+mass confusion very early and often
|
||||
AI_TEMPORARY = 63 //AI will stop casting when it runs out of targets
|
||||
};
|
||||
|
||||
var giveItemsToParty (var quantity, var shapenum, var quality, var framenum, var flag, var unknown)
|
||||
{
|
||||
var startcount = PARTY->count_objects(shapenum, quality, framenum);
|
||||
var itemconts = UI_add_party_items(quantity, shapenum, quality, framenum, flag);
|
||||
|
||||
if (UI_get_array_size(itemconts) == 1)
|
||||
return [0, 0];
|
||||
|
||||
else
|
||||
{
|
||||
var finalcount = PARTY->count_objects(shapenum, quality, framenum);
|
||||
var delta = finalcount - startcount;
|
||||
|
||||
var companions = removeFromArrayByIndex(itemconts, 1);
|
||||
|
||||
if (companions)
|
||||
{
|
||||
if (quantity == 1)
|
||||
say("@Thou art so encumbered! Perhaps one of thy friends might be willing to carry this?@");
|
||||
else
|
||||
say("@Thou art so encumbered! Let me give some of this to thy friends.@");
|
||||
|
||||
var msgs = ["@I'll help carry it.@", "@I will carry that.@", "@I will carry some.@", "@Let me help with that.@"];
|
||||
|
||||
for (npc in companions)
|
||||
interjectIfPossible(UI_get_npc_number(npc), msgs[UI_get_random(UI_get_array_size(msgs))]);
|
||||
}
|
||||
|
||||
if (delta > 0)
|
||||
{
|
||||
if (quantity == 1)
|
||||
say("@Since thou art so encumbered, I shall set this upon the ground.@");
|
||||
else if (delta == 1)
|
||||
say("@Since not one of you can hold another, I shall place this last remaining one upon the ground.@");
|
||||
else
|
||||
say("@Since thou art so encumbered, I shall place the remaining ",
|
||||
delta, " of these upon the ground.@");
|
||||
|
||||
var pos = AVATAR->get_object_position();
|
||||
var groundobjs = shapenum->create_new_object();
|
||||
groundobjs->set_item_frame(framenum);
|
||||
groundobjs->set_item_quality(quality);
|
||||
if (delta > 1)
|
||||
{
|
||||
if (groundobjs->set_item_quantity(delta) == 0)
|
||||
{
|
||||
UI_update_last_created(pos);
|
||||
while (delta > 1)
|
||||
{
|
||||
groundobjs = shapenum->create_new_object();
|
||||
groundobjs->set_item_frame(framenum);
|
||||
groundobjs->set_item_quality(quality);
|
||||
UI_update_last_created(pos);
|
||||
delta = delta - 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
UI_update_last_created(pos);
|
||||
}
|
||||
else
|
||||
UI_update_last_created(AVATAR->get_object_position());
|
||||
}
|
||||
return itemconts;
|
||||
}
|
||||
}
|
||||
|
||||
var sellAmountToPartyExt (var shapenum, var framenum, var base_quant, var price, var max_quant, var min_quant, var money_shape)
|
||||
{
|
||||
var amount;
|
||||
var finalquant;
|
||||
|
||||
//Default to standard gold coins
|
||||
if (!money_shape)
|
||||
money_shape = SHAPE_GOLD;
|
||||
|
||||
var partygold = PARTY->count_objects(money_shape, QUALITY_ANY, FRAME_ANY);
|
||||
|
||||
if (max_quant == 0)
|
||||
amount = 1;
|
||||
else
|
||||
amount = UI_input_numeric_value(min_quant, max_quant, 1, 1);
|
||||
|
||||
if (price > 1)
|
||||
finalquant = price * amount;
|
||||
else
|
||||
finalquant = amount;
|
||||
|
||||
if (amount == 0)
|
||||
return NO_QUANTITY;
|
||||
else
|
||||
{
|
||||
if (partygold >= (base_quant * amount))
|
||||
{
|
||||
UI_remove_party_items((base_quant * amount), money_shape, QUALITY_ANY, SHAPE_ANY, true);
|
||||
giveItemsToParty(finalquant, shapenum, QUALITY_ANY, framenum, false, true);
|
||||
return SELL_SUCCEEDED;
|
||||
}
|
||||
else
|
||||
return NOT_ENOUGH_GOLD;
|
||||
}
|
||||
}
|
||||
|
||||
var promptForPayment (var price, var dialog)
|
||||
{
|
||||
if (price > 0)
|
||||
{
|
||||
say(dialog[2], price, dialog[3]);
|
||||
if (askYesNo())
|
||||
{
|
||||
if (!hasGold(price))
|
||||
{
|
||||
say(dialog[4]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
say(dialog[5]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static var service_healing_targets;
|
||||
static var service_healing_spell;
|
||||
|
||||
|
||||
|
||||
var getServiceHealingDialog (var npcnum)
|
||||
{
|
||||
switch (npcnum)
|
||||
{
|
||||
case TIBERIUS:
|
||||
return ["@Which of my services dost thou have need of?@", //ask gold
|
||||
"@I see thy injury. Wilt thou make an offering of 30 gold?@", //
|
||||
"@If thou wilt not pay, I cannot heal thee.@", //wont pay
|
||||
"@Which of you needs to be ", "?@", //who healed?
|
||||
"@But all of you are well@!",
|
||||
"@But all of you are well@", //no one poisoned
|
||||
"@But thou art well!@", //person not injured
|
||||
"@Art thou sure? Some of thy friends still need to be healed.@",
|
||||
"@Art thou sure? Some of thy friends still appear to be poisoned.@",
|
||||
"@I see that thou dost carry another slain friend.@", //still need resu
|
||||
"@Is there aught else I can do for thee?@"]; //don't need anything
|
||||
case TARA:
|
||||
return ["@Which of my services dost thou have need of?@",
|
||||
"@I see thy injury. Wilt thou make an offering of 30 gold?@",
|
||||
"@If thou wilt not pay, I cannot heal thee.@",
|
||||
"@Then thou must look elsewhere for that service.@",
|
||||
"@Who dost thou wish to be ", "?@",
|
||||
"@It pleases me that none of you are wounded.@",
|
||||
"@I am pleased that none of you are poisoned.@",
|
||||
"@I do not see anyone who needs resurrecting. I must be able to see the body to resurrect. If thou art carrying thy friend, pray lay them on the ground so that I may attend to them.@",
|
||||
"@Art thou sure? Some of thy friends still need to be healed.@",
|
||||
"@Art thou sure? Some of thy friends still appear to be poisoned.@",
|
||||
"@Art thou sure? Some of thy friends still appear to require mine aid.@",
|
||||
"@Is there aught else I can do for thee?@"];
|
||||
case DEZANA:
|
||||
return ["@I can heal, cure, and even resurrect.@",
|
||||
"@My price is ", " gold. Dost thou agree?@",
|
||||
"@Thou dost not have that much gold! Mayhaps thou couldst return with more and purchase the service then.@",
|
||||
"@Then thou must look elsewhere for that service.@",
|
||||
"@Whom dost thou wish to have ", "?@",
|
||||
"@Well, I do not see anyone wounded here.@ He laughs.",
|
||||
"@Well, no one here is poisoned, it seems.@ He laughs.",
|
||||
"@Well, I do not seem to see anyone who needs mine assistance. Unless thou art carrying someone in thy packs....@ He laughs.",
|
||||
"@Art thou sure? Some of thy friends still need to be healed.@",
|
||||
"@Art thou sure? Some of thy friends still appear to be poisoned.@",
|
||||
"@Art thou sure? Some of thy friends still appear to require mine aid.@",
|
||||
"@Though I want thy business, I am pleased to see my services are not needed!@"];
|
||||
case LEIGH:
|
||||
return ["@Which of my services dost thou have need of?@",
|
||||
"@My price is ", " gold. Art thou interested?@",
|
||||
"@Thou dost not have enough gold! Mayhaps thou couldst return when thou hast more.@",
|
||||
"@Then thou must go elsewhere.@",
|
||||
"@Who dost thou wish to have ", "?@",
|
||||
"@None of you seem to be wounded.@~~She appears pleased.",
|
||||
"@None of you seem to be poisoned.@~~She appears pleased.",
|
||||
"@There seems to be no one who needs such assistance. Perhaps, if I have overlooked anyone, thou couldst set him or her before me.@",
|
||||
"@Art thou sure? Some of thy friends still need to be healed.@",
|
||||
"@Art thou sure? Some of thy friends still appear to be poisoned.@",
|
||||
"@Art thou sure? Some of thy friends still appear to require mine aid.@",
|
||||
"@Excellent, thou art uninjured!@"];
|
||||
case INMANILEM:
|
||||
return ["@To need which of my services?@",
|
||||
"@To charge ", " gold. To still want my services?@",
|
||||
"@To have not that much gold! To perhaps return with more and purchase the service then.@",
|
||||
"@To be sorry. To look elsewhere for that service then.@",
|
||||
"@To want to ", " whom?@",
|
||||
"@To not see anyone in need of healing.@",
|
||||
"@To not see anyone poisoned.@",
|
||||
"@To not see anyone who is in need of resurrection. To have to see the body to save the spirit. To lay your companion on the ground so that I may return them to this world.@",
|
||||
"@To ask if thou art sure. To see that some of thy friends still need to be healed.@",
|
||||
"@To ask if thou art sure. To see that some of thy friends still appear to be poisoned.@",
|
||||
"@To ask if thou art sure. To see that some of thy friends still appear to require mine aid.@",
|
||||
"@To have no need for my healing.@"];
|
||||
case CHANTU:
|
||||
return ["@Which of my services dost thou need?@",
|
||||
"@My price is ", " gold. Is this satisfactory?@",
|
||||
"@Thou dost not have any gold. I am truly sorry. I cannot help thee until thou canst provide the proper fee.@",
|
||||
"@Then I am truly sorry. I must charge what I must charge. We do not live in prosperous times.@",
|
||||
"@Who dost thou wish to be ", "?@",
|
||||
"@I apologize, " + getPoliteTitle() + ", but I do not see anyone who is in need of healing.@",
|
||||
"@I apologize, " + getPoliteTitle() + ", but I do not see anyone who needs to be cured of poison.@",
|
||||
"@I apologize, " + getPoliteTitle() + ", but I do not see anyone who is in need of resurrection. I must be able to see the body to save the spirit. If thou art carrying thy misfortunate friend, pray lay them on the ground so that I may return them to this world.@",
|
||||
"@Some of thy friends still need to be healed; I will be here shouldst thou reconsider.@",
|
||||
"@Some of thy friends still appear to be poisoned; I will be here shouldst thou reconsider.@",
|
||||
"@Some of thy friends still appear to require mine aid; I will be here shouldst thou reconsider.@",
|
||||
"@So thou art healthy? 'Tis good news. If thou dost need my services in the future, do not hesitate to return.@"];
|
||||
case JAANA:
|
||||
return ["@Which of my services dost thou have need of?@",
|
||||
"@My price is ", " gold. Is this price agreeable?@",
|
||||
"@Thou dost not have that much gold! Mayhaps thou couldst return with more and purchase the service then.@",
|
||||
"@Then thou must look elsewhere for that service.@",
|
||||
"@Who dost thou wish to be ", "?@",
|
||||
"@I do not see anyone who is in need of healing.@",
|
||||
"@I do not see anyone who needs to be cured of poison.@",
|
||||
"@I do believe I am going blind. I do not see anyone who is in need of resurrection. Art thou fooling me again, or art thou hiding the injured one? I must be able to see the person to help them. If thou art carrying thy friend in thy pack, pray lay them on the ground so that I may perform my duties as thou hast requested.@",
|
||||
"@Art thou sure? I believe that some of thy friends still need to be healed.@",
|
||||
"@Art thou sure? I believe that some of thy friends still appear to be poisoned.@",
|
||||
"@Art thou sure? I believe that some of thy friends still appear to require mine aid.@",
|
||||
"@Avatar! Thou dost tell me to prepare to heal and then thou dost tell me 'Nobody'! Is this thine idea of a joke? Healing is a serious business!@"];
|
||||
case LAURIANNA:
|
||||
return ["@Which mode of healing dost thou wish?@",
|
||||
"", "",
|
||||
"",
|
||||
"",
|
||||
"@Who dost thou wish to be ", "?@",
|
||||
"@None of you seem to be wounded.@~~She appears pleased.",
|
||||
"@None of you seem to be poisoned.@~~She appears pleased.",
|
||||
"@I am sorry, but thou hast not presented anyone to me who requires mine assistance. If there is someone who truly needs my skills, I must have a closer look.@",
|
||||
"@Art thou sure? Some of thy friends still need to be healed.@",
|
||||
"@Art thou sure? Some of thy friends still appear to be poisoned.@",
|
||||
"@Art thou sure? Some of thy friends still appear to require mine aid.@",
|
||||
"@I am glad that thou art not in need of healing!@"];
|
||||
case LORD_BRITISH:
|
||||
return ["@Of which service dost thou have need?@",
|
||||
"", "",
|
||||
"",
|
||||
"",
|
||||
"@Who dost thou wish to be ", "?@",
|
||||
"@I do apologize, " + getAvatarName() + ", but I do not see anyone who must be healed.@",
|
||||
"@I do apologize, " + getAvatarName() + ", but I do not see anyone who must be cured of poison.@",
|
||||
"@I do apologize, " + getAvatarName() + ", but I do not see anyone who must be resurrected. I must be able to see the body. If thou art carrying thine unlucky companion, please lay them on the ground.@",
|
||||
"@Art thou sure? I can see that some of thy friends still need to be healed.@",
|
||||
"@Art thou sure? I can see that some of thy friends still appear to be poisoned.@",
|
||||
"@Art thou sure? I can see that some of thy friends still appear to require mine aid.@",
|
||||
"@'Tis good to hear that thou art well. Do not hesitate to come and see me if thou dost need healing of any kind.@"];
|
||||
}
|
||||
}
|
||||
|
||||
var getServiceHealingPricelist (var npcnum)
|
||||
{
|
||||
switch (npcnum)
|
||||
{
|
||||
case REYNA:
|
||||
return [10, 30, 400];
|
||||
case JAANA:
|
||||
if ((npcnum->get_npc_object() in UI_get_party_list()) ||
|
||||
(npcnum->get_schedule_type() == WAIT))
|
||||
return 0;
|
||||
else
|
||||
return [15, 30, 400];
|
||||
case LAURIANNA:
|
||||
case LORD_BRITISH:
|
||||
return 0;
|
||||
case TARA:
|
||||
return [10, 30, 400];
|
||||
case ELAD:
|
||||
return [10, 25, 425];
|
||||
case LEIGH:
|
||||
return [8, 25, 385];
|
||||
case INMANILEM:
|
||||
return [10, 25, 430];
|
||||
case CHANTU:
|
||||
return [15, 30, 400];
|
||||
}
|
||||
}
|
||||
|
||||
void serviceHeal ()
|
||||
{
|
||||
UI_push_answers();
|
||||
|
||||
var npcnum = get_npc_number();
|
||||
// Ensure proper initialization:
|
||||
//var npcind = spellitemGetNPCIndex(npcnum);
|
||||
var dialog = getServiceHealingDialog(npcnum);
|
||||
var price_list = getServiceHealingPricelist(npcnum);
|
||||
var magicheal = (!get_item_flag(NECROMANCER) && (get_item_flag(MAGE_CLASS) || get_item_flag(BARD_CLASS)));
|
||||
|
||||
var choices = ["none"];
|
||||
var healing_spells = [];
|
||||
|
||||
if (magicheal)
|
||||
{
|
||||
// healing_spells = getLeveledSpellList(item,
|
||||
// get_item_flag(HEALER),
|
||||
// ["Cure", "Mass cure", "Heal", "Great heal", "Restoration", "Resurrect", "Mass resurrect"],
|
||||
// [1, 2, 3, 5, 7, 8, 8],
|
||||
// global_spells_unknown[npcind]);
|
||||
// if (("Cure" in healing_spells) || ("Mass cure" in healing_spells))
|
||||
// choices << "curing";
|
||||
/// if (("Heal" in healing_spells) || ("Great heal" in healing_spells) || ("Restoration" in healing_spells))
|
||||
// choices << "healing";
|
||||
// if (("Resurrect" in healing_spells) || ("Mass resurrect" in healing_spells))
|
||||
// choices << "resurrection";
|
||||
}
|
||||
else
|
||||
choices << ["curing", "healing"];
|
||||
|
||||
say(dialog[1]);
|
||||
var reply = chooseFromMenu2([choices]) - 1;
|
||||
if (reply)
|
||||
{
|
||||
var targets = [];
|
||||
var bodynpcs = [];
|
||||
if (reply == SERVICE_HEAL)
|
||||
targets = filterListByRelHits(UI_get_party_list(), 4);
|
||||
else if (reply == SERVICE_CURE)
|
||||
targets = filterListByFlag(UI_get_party_list(), POISONED, true);
|
||||
else if (reply == SERVICE_RESURRECT)
|
||||
{
|
||||
var bodyshapes = [SHAPE_BODIES_1, SHAPE_BODIES_2, SHAPE_LARGE_BODIES, SHAPE_NEW_BODIES];
|
||||
var bodies = [];
|
||||
for (shnum in bodyshapes)
|
||||
bodies = [bodies, find_nearby(shnum, 25, MASK_NONE)];
|
||||
|
||||
for (body in bodies)
|
||||
if (body->get_body_npc())
|
||||
{
|
||||
targets << body;
|
||||
bodynpcs << body->get_body_npc();
|
||||
}
|
||||
}
|
||||
|
||||
var numtargets = UI_get_array_size(targets);
|
||||
if (numtargets == 0)
|
||||
{
|
||||
if (reply == SERVICE_HEAL)
|
||||
say(dialog[8]);
|
||||
else if (reply == SERVICE_CURE)
|
||||
say(dialog[9]);
|
||||
else if (reply == SERVICE_RESURRECT)
|
||||
say(dialog[10]);
|
||||
}
|
||||
else
|
||||
{
|
||||
numtargets = UI_get_array_size(targets);
|
||||
var namelist;
|
||||
if (reply == SERVICE_RESURRECT)
|
||||
namelist = bodynpcs->get_npc_name();
|
||||
else
|
||||
namelist = targets->get_npc_name();
|
||||
var choice = 1;
|
||||
var heal_everyone = true;
|
||||
if (numtargets > 1 && price_list)
|
||||
{
|
||||
if (reply == SERVICE_HEAL)
|
||||
say(dialog[6], "healed", dialog[7]);
|
||||
else if (reply == SERVICE_CURE)
|
||||
say(dialog[6], "cured of poison", dialog[7]);
|
||||
else if (reply == SERVICE_RESURRECT)
|
||||
say(dialog[6], "resurrected", dialog[7]);
|
||||
choice = chooseFromMenu2(["Nobody", "Everyone", namelist]) - 1;
|
||||
heal_everyone = (choice == 1);
|
||||
if (choice > 1)
|
||||
choice = choice - 1;
|
||||
}
|
||||
else if (price_list)
|
||||
heal_everyone = false;
|
||||
|
||||
if (!choice)
|
||||
{
|
||||
targets = 0;
|
||||
if (reply == SERVICE_HEAL)
|
||||
say(dialog[11]);
|
||||
else if (reply == SERVICE_CURE)
|
||||
say(dialog[12]);
|
||||
else if (reply == SERVICE_RESURRECT)
|
||||
say(dialog[13]);
|
||||
}
|
||||
else if (price_list)
|
||||
{
|
||||
var price = price_list[reply];
|
||||
if (heal_everyone && price)
|
||||
{
|
||||
if (magicheal)
|
||||
if (((reply == SERVICE_HEAL) && ("Restoration" in healing_spells)) ||
|
||||
((reply == SERVICE_CURE) && ("Mass cure" in healing_spells)) ||
|
||||
((reply == SERVICE_RESURRECT) && ("Mass resurrect" in healing_spells)))
|
||||
price = (price * 5)/2;
|
||||
else
|
||||
price = price * numtargets;
|
||||
else
|
||||
price = price * numtargets;
|
||||
}
|
||||
else
|
||||
{
|
||||
targets = [targets[choice]];
|
||||
numtargets = 1;
|
||||
}
|
||||
if (!promptForPayment(price, dialog))
|
||||
targets = 0;
|
||||
}
|
||||
|
||||
if (targets)
|
||||
{
|
||||
if (magicheal)
|
||||
{
|
||||
var spell = 0;
|
||||
//Try magic healing first
|
||||
if (reply == SERVICE_HEAL)
|
||||
{
|
||||
if (numtargets > 1 && ("Restoration" in healing_spells))
|
||||
service_healing_spell = "Restoration";
|
||||
else if ("Great heal" in healing_spells)
|
||||
service_healing_spell = "Great heal";
|
||||
}
|
||||
else if (reply == SERVICE_CURE)
|
||||
{
|
||||
if (numtargets > 1 && ("Mass cure" in healing_spells))
|
||||
service_healing_spell = "Mass cure";
|
||||
else if ("Cure" in healing_spells)
|
||||
service_healing_spell = "Cure";
|
||||
}
|
||||
else if (reply == SERVICE_RESURRECT)
|
||||
{
|
||||
if (numtargets > 1 && ("Mass resurrect" in healing_spells))
|
||||
//Should only happen for LB and Laurianna
|
||||
service_healing_spell = "Mass resurrect";
|
||||
else if ("Resurrect" in healing_spells)
|
||||
service_healing_spell = "Resurrect";
|
||||
}
|
||||
if (service_healing_spell)
|
||||
{
|
||||
//service_healing_targets = targets;
|
||||
//script item call serviceMultipleSpellHealing, SCRIPTED;
|
||||
//abort;
|
||||
}
|
||||
}
|
||||
//Normal healing. Magical healers fallback to it if they
|
||||
//don't know enough spells.
|
||||
if (reply == SERVICE_HEAL)
|
||||
{
|
||||
var verbs = [" dresses ", " tends to "];
|
||||
var msgs = ["'s wounds with bandages soaked in an infusion of Ginseng. The wounds heal quickly afterwards.@",
|
||||
"'s wounds and feeds the patient a yellow potion, which immediately closes the wounds.@",
|
||||
"'s wounds by applying a herbal unguent upon them. Not long afterwards, the wounds are fully healed.@"];
|
||||
while (numtargets)
|
||||
{
|
||||
var currtarget = targets[numtargets];
|
||||
say("@"+ get_npc_name() + verbs[UI_get_random(UI_get_array_size(verbs))] + currtarget->get_npc_name() + msgs[UI_get_random(UI_get_array_size(msgs))]);
|
||||
var str = currtarget->get_npc_prop(STRENGTH);
|
||||
var hps = currtarget->get_npc_prop(HEALTH);
|
||||
currtarget->set_npc_prop(HEALTH, str - hps);
|
||||
numtargets = numtargets - 1;
|
||||
}
|
||||
}
|
||||
else if (reply == SERVICE_CURE)
|
||||
{
|
||||
var verbs = [" feeds ", " gives "];
|
||||
var msgs = [" an infusion of Ginseng, which nullifies the potion after a while@",
|
||||
" a red potion, which cancels the poison almost immeditatelly.@",
|
||||
" a herbal antidote. After a while, the poison is gone.@"];
|
||||
while (numtargets)
|
||||
{
|
||||
var currtarget = targets[numtargets];
|
||||
say("@"+ get_npc_name() + verbs[UI_get_random(UI_get_array_size(verbs))] + currtarget->get_npc_name() + msgs[UI_get_random(UI_get_array_size(msgs))]);
|
||||
currtarget->clear_item_flag(POISONED);
|
||||
numtargets = numtargets - 1;
|
||||
}
|
||||
}
|
||||
else if (reply == SERVICE_RESURRECT)
|
||||
say("@This message should never appear. Warn the programmer: there is a bug with resurrection and normal healing.@");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
say(dialog[14]);
|
||||
UI_pop_answers();
|
||||
}
|
||||
542
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/shapes.uc
Executable file
542
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/shapes.uc
Executable file
@@ -0,0 +1,542 @@
|
||||
const int AVATAR_BAL = 0;
|
||||
|
||||
const int BRAWL_TIMER = 16; //sets Brawl timer if it's triggered outside of normal times (saying "rat" and so on). After 1 hour, will subside.
|
||||
|
||||
const int SPELL_POOF = 9;
|
||||
|
||||
const int SHAPE_LARGE_BODIES = 778; //0x30A
|
||||
const int FRAME_DRAGON_BODY = 7; //0x007
|
||||
const int SHAPE_BODIES_1 = 400; //0x190
|
||||
const int FRAME_MONK_BODY_1 = 5; //0x005
|
||||
const int SHAPE_BODIES_2 = 414; //0x19E
|
||||
const int FRAME_LBBODY2 = 13; //0x00D
|
||||
const int SHAPE_BODIES_3 = 762; //0x19E
|
||||
const int FRAME_MAGEBODY = 22; //0x00D
|
||||
const int SHAPE_BODIES_4 = 892; //0x19E
|
||||
const int SHAPE_BODIES_5 = 778; //0x19E
|
||||
|
||||
const int SHAPE_CHAOS_SWORD = 637; //from Drugeworth quest
|
||||
const int SHAPE_MYSTIC_ARMOUR = 1259; //solving QUenton quest
|
||||
|
||||
const int SHAPE_BEDROLL = 583;
|
||||
|
||||
|
||||
const int SHAPE_STORM_CLOAK = 1247;
|
||||
const int SHAPE_GUILD_BELT = 1138;
|
||||
const int SHAPE_MAGIC_SCROLL = 1147;
|
||||
|
||||
//quest item shapes
|
||||
const int SHAPE_VORTEX_CUBE = 1255;
|
||||
//const int SHAPE_HUMAN_LENS =
|
||||
const int SHAPE_CODEX = 1102;
|
||||
const int SHAPE_RED_MOONGATE = 779;
|
||||
|
||||
|
||||
const int SHAPE_HIGHWAYMAN = 485;
|
||||
|
||||
const int SHAPE_BELL = 1136;
|
||||
|
||||
const int SHAPE_FISHING_ROD = 662; //
|
||||
const int SHAPE_FISH = 509;
|
||||
|
||||
|
||||
const int SHAPE_GARGOYLE_WARRIOR = 274;
|
||||
const int SHAPE_WINGLESS_GARGOYLE = 883;
|
||||
|
||||
const int SHAPE_NEW_BODIES = 1140;
|
||||
|
||||
const int SHAPE_PACKED_BALLOON = 1232;
|
||||
|
||||
|
||||
const int SHAPE_GOLD = 644;
|
||||
const int SHAPE_GOLD_NUGGET = 645;
|
||||
|
||||
const int SHAPE_BOTTLE = 616;
|
||||
|
||||
const int SHAPE_REAGENT = 842;
|
||||
|
||||
////REAGENT FRAMES//////
|
||||
const int FRAME_BLACK_PEARL = 0;
|
||||
const int FRAME_BLOOD_MOSS = 1;
|
||||
const int FRAME_NIGHTSHADE = 2;
|
||||
const int FRAME_MANDRAKE_ROOT = 3;
|
||||
const int FRAME_GARLIC = 4;
|
||||
const int FRAME_GINSENG = 5;
|
||||
const int FRAME_SPIDER_SILK = 6;
|
||||
const int FRAME_SULFUR_ASH = 7;
|
||||
////////////
|
||||
|
||||
|
||||
const int SHAPE_SHOVEL = 625;
|
||||
const int SHAPE_FOOD = 377;
|
||||
const int SHAPE_HONEY = 772;
|
||||
const int SHAPE_SCROLL = 797;
|
||||
const int SHAPE_KEY = 641;
|
||||
const int SHAPE_SPELLBOOK = 761;
|
||||
const int SHAPE_YEW_LOG = 1168;
|
||||
const int SHAPE_THREAD = 654;
|
||||
const int SHAPE_RUNE = 877;
|
||||
const int SHAPE_CLOTH = 851;
|
||||
const int SHAPE_TORCH = 595;
|
||||
const int SHAPE_OIL = 782;
|
||||
const int SHAPE_GEMS = 760;
|
||||
const int SHAPE_GEM = 760;//same as above
|
||||
const int SHAPE_POWDER_KEG = 704;
|
||||
const int SHAPE_BACKPACK = 801;
|
||||
const int SHAPE_BAG = 802;
|
||||
const int SHAPE_CHEST = 800;
|
||||
const int SHAPE_VIRTUE_STONE = 330;
|
||||
|
||||
const int SHAPE_GOLDNUGGET = 645;
|
||||
const int SHAPE_GOLDBAR = 646;
|
||||
const int SHAPE_GOLD_BAR = 646;
|
||||
const int SHAPE_GRAIN = 677;
|
||||
const int SHAPE_DUCK = 1135;
|
||||
const int SHAPE_BOOKOFPROPHESIES = 1137;
|
||||
const int SHAPE_FORCEFIELD = 1152;
|
||||
const int SHAPE_EGG = 275;
|
||||
const int SHAPE_BODY2 = 275;
|
||||
const int SHAPE_BOOK = 642;
|
||||
const int SHAPE_MOONSTONE = 1139;
|
||||
const int SHAPE_ORB_OF_MOONS = 785;
|
||||
const int SHAPE_LEVER = 787;
|
||||
const int SHAPE_RED_MOONGATE_WANE = 779;
|
||||
const int SHAPE_HORSESHOES = 998;
|
||||
const int SHAPE_DRAGONS_EGG = 1106;
|
||||
const int SHAPE_TOP = 249;
|
||||
const int SHAPE_CAMPFIRE = 825;
|
||||
const int SHAPE_FRYINGPAN = 944;
|
||||
|
||||
const int SHAPE_LIT_LAMP = 1162;
|
||||
const int SHAPE_LAMP = 1161;
|
||||
const int SHAPE_PANPIPES = 1165;
|
||||
const int SHAPE_TREASURE_MAP = 1144;
|
||||
const int SHAPE_POCKETWATCH = 159;
|
||||
const int SHAPE_YEW_BOARD = 1169;
|
||||
const int SHAPE_CUP = 628;
|
||||
const int SHAPE_KITCHEN_ITEMS = 863;
|
||||
const int FRAME_FLOUR = 14;
|
||||
const int FRAME_UNOPENED_SACK = 13;
|
||||
|
||||
const int SHAPE_POTION = 340;
|
||||
|
||||
const int SHAPE_BASKET = 803;
|
||||
const int SHAPE_BUCKET = 810;
|
||||
const int FRAME_MILK_BUCKET = 7;
|
||||
|
||||
|
||||
const int SHAPE_BALLOON_BASKET = 1200;
|
||||
const int SHAPE_CAULDRON = 995;
|
||||
const int SHAPE_BALLOON_BAG = 1220;
|
||||
const int SHAPE_ROPE = 1134;
|
||||
|
||||
//RAW MEAT SHAPES FOR COOKING
|
||||
|
||||
const int SHAPE_RAW_BEEF = 1203;
|
||||
const int SHAPE_RAW_CHICKEN = 1204;
|
||||
const int SHAPE_RAW_HORSEMEAT = 1205;
|
||||
const int SHAPE_RAW_RIBS = 1206;
|
||||
const int SHAPE_RAW_VENISON = 1207;
|
||||
const int SHAPE_RAW_MUTTON = 1208;
|
||||
const int SHAPE_RAW_RABBIT = 1209;
|
||||
const int SHAPE_RAW_PORK = 1210;
|
||||
|
||||
const int SHAPE_KINDLING = 1211;
|
||||
|
||||
const int SHAPE_BEEHIVE = 1185;
|
||||
|
||||
const int SHAPE_PANTS = 738;
|
||||
|
||||
const int QUALITY_BALLOON_PLANS = 59;
|
||||
const int SHAPE_BALLOON = 1201;
|
||||
const int SHAPE_BURNER = 1231;
|
||||
|
||||
const int SHAPE_NEW_BALLOON = 1233;
|
||||
|
||||
|
||||
const int SHAPE_AMULET_SUBMISSION = 1234;
|
||||
|
||||
const int FRAME_GLASS = 0;
|
||||
|
||||
const int SHAPE_LOCKPICK = 627;
|
||||
const int SHAPE_DESK_ITEM = 675;
|
||||
const int FRAME_ABACUS = 11;
|
||||
|
||||
|
||||
|
||||
const int SHAPE_KIDNEY_BELT = 584;
|
||||
const int SHAPE_CLOAK = 285;
|
||||
const int SHAPE_PEDESTAL = 577;
|
||||
const int SHAPE_WOOL = 653;
|
||||
const int FRAME_BALE = 0;
|
||||
const int SHAPE_SEXTANT = 650;
|
||||
|
||||
const int SHAPE_LENS = 726;
|
||||
const int FRAME_HUMAN_LENS = 0;
|
||||
const int FRAME_GARGISH_LENS = 1;
|
||||
const int FRAME_BROKEN_LENS = 2;
|
||||
|
||||
const int SHAPE_CRYSTAL_BALL = 729;
|
||||
|
||||
const int SHAPE_SILVER_TABLET = 1142;
|
||||
const int FRAME_MARIAH = 1;
|
||||
const int FRAME_PIRATE = 0;
|
||||
|
||||
const int SHAPE_MAGIC_LOCKED_CHEST = 1187;
|
||||
const int SHAPE_UNLOCKED_CHEST = 800;
|
||||
const int SHAPE_GRAVE = 1190;
|
||||
|
||||
const int SHAPE_SILK_CLOTH = 1219;
|
||||
const int SHAPE_GARGOYLE_JEWELRY = 937;
|
||||
|
||||
const int SHAPE_URN = 1240;
|
||||
const int FRAME_CHUCKLES = 1;
|
||||
|
||||
//DESK ITEM FRAMES
|
||||
const int FRAME_MIRROR = 16;
|
||||
|
||||
enum door_shapes
|
||||
{
|
||||
SHAPE_DOOR_HORIZONTAL = 270,
|
||||
SHAPE_DOOR_VERTICAL = 376,
|
||||
SHAPE_DOOR2_HORIZONTAL = 432,
|
||||
SHAPE_DOOR2_VERTICAL = 433,
|
||||
|
||||
SHAPE_ABBEY_DOOR_LEFT_HORIZONTAL = 246,
|
||||
SHAPE_ABBEY_DOOR_RIGHT_HORIZONTAL = 225,
|
||||
|
||||
SHAPE_ABBEY_DOOR_LEFT_VERTICAL = 250,
|
||||
SHAPE_ABBEY_DOOR_RIGHT_VERICAL = 392 //Note: This is actually a copy of ABBEY_DOOR_LEFT_VERTICAL. Maybe they screwed up but never used them anyway.
|
||||
};
|
||||
|
||||
const int SHAPE_SILK_THREAD = 1218;
|
||||
|
||||
|
||||
const int SHAPE_PLANT = 999;
|
||||
const int FRAME_DAFFODIL = 2;
|
||||
|
||||
const int SHAPE_RAFT = 1241;
|
||||
|
||||
|
||||
const int SHAPE_LOCKED_CHEST = 522;
|
||||
|
||||
//TREASURE MAP FRAMES
|
||||
const int FRAME_MAP1 = 0;
|
||||
const int FRAME_MAP2 = 1;
|
||||
const int FRAME_MAP3 = 2;
|
||||
const int FRAME_MAP4 = 3;
|
||||
const int FRAME_MAP5 = 4;
|
||||
const int FRAME_MAP6 = 5;
|
||||
const int FRAME_MAP7 = 6;
|
||||
const int FRAME_MAP8 = 7;
|
||||
const int FRAME_MAP9 = 8;
|
||||
|
||||
//door shapes
|
||||
const int H_BROWN_DOOR = 270;
|
||||
const int V_BROWN_DOOR = 376; //frame one
|
||||
///
|
||||
//top frames
|
||||
const int FRAME_BROWN_DRESS = 1;
|
||||
const int FRAME_SHIRT = 0;
|
||||
const int FRAME_BLUE_DRESS = 0;
|
||||
|
||||
//BODY SHAPES
|
||||
const int SHAPE_BODY = 400;
|
||||
const int STRANGE_BODY = 414;
|
||||
const int MONSTER_BODY = 762;
|
||||
const int MONSTERNPC_BODY = 892;
|
||||
const int NEW_BODY = 1140;
|
||||
|
||||
//WEAPON SHAPES
|
||||
const int SHAPE_CLUB = 590;
|
||||
const int SHAPE_DAGGER = 594;
|
||||
const int SHAPE_SPEAR = 592;
|
||||
const int SHAPE_THROWING_AXE = 593;
|
||||
const int SHAPE_TWOHANDEDAXE = 601;
|
||||
const int SHAPE_2H_AXE = 601;
|
||||
const int SHAPE_TWOHANDEDHAMMER = 600;
|
||||
const int SHAPE_2H_HAMMER = 600;
|
||||
const int SHAPE_BOW = 597;
|
||||
const int SHAPE_CROSSBOW = 598;
|
||||
const int SHAPE_MAGIC_BOW = 606;
|
||||
const int SHAPE_TRIPLE_CROSSBOW = 647;
|
||||
const int SHAPE_SLING = 474;
|
||||
const int SHAPE_SWORD = 599;
|
||||
const int SHAPE_TWOHANDEDSWORD = 602;
|
||||
const int SHAPE_BOOTS = 587;
|
||||
const int SHAPE_MACE = 659;
|
||||
const int SHAPE_MAIN_GAUCHE = 591;
|
||||
const int SHAPE_MORNING_STAR = 596;
|
||||
const int SHAPE_GLASS_SWORD = 604;
|
||||
const int SHAPE_YEW_STAFF = 1163;
|
||||
const int SHAPE_YEW_STAFF_LIGHTNING = 1164;
|
||||
const int SHAPE_YEW_STAFF_FIREBOLT = 1260;
|
||||
const int SHAPE_YEW_STAFF_DEATHBOLT = 1261;
|
||||
const int SHAPE_YEW_STAFF_POISON = 1262;
|
||||
|
||||
const int SHAPE_RUSTY_CUTLASS = 561;
|
||||
const int SHAPE_MIRROR = 848;
|
||||
|
||||
const int SHAPE_HAMMER = 623;
|
||||
const int SHAPE_HALBERD = 603;
|
||||
const int SHAPE_SPIKED_SHIELD = 578;
|
||||
const int SHAPE_BOOMERANG = 605;
|
||||
|
||||
const int SHAPE_JAR = 681;
|
||||
const int FRAME_EMPTY = 0;
|
||||
const int FRAME_HONEY_JAR = 8;
|
||||
const int FRAME_TUNIC = 0;
|
||||
const int FRAME_PANTS = 1;
|
||||
const int FRAME_DRESS = 1;
|
||||
|
||||
//RED MOONGATE SHAPES
|
||||
|
||||
const int SHAPE_ORB_MOONGATE_HORIZONTAL = 779;
|
||||
const int SHAPE_ORB_MOONGATE_NW_SE = 1114;
|
||||
const int SHAPE_ORB_MOONGATE_NE_SW = 1113;
|
||||
const int SHAPE_ORB = 785;
|
||||
const int SHAPE_ORB_MOONGATE_VERTICAL = 157;
|
||||
const int SHAPE_STANDING_RED_MOONGATE = 776;
|
||||
const int SHAPE_STANDING_BLUE_MOONGATE = 776;
|
||||
|
||||
//SOUND FX
|
||||
const int SOUND_MOONGATE = 11;
|
||||
|
||||
//AMMO SHAPES
|
||||
|
||||
const int SHAPE_BOLT = 723;
|
||||
const int SHAPE_ARROW = 722;
|
||||
const int SHAPE_MAGIC_BOLTS = 417;
|
||||
const int SHAPE_MAGIC_ARROWS = 556;
|
||||
|
||||
//ARMOR SHAPES
|
||||
const int SHAPE_CRESTED_HELM = 542;
|
||||
const int SHAPE_LEATHER_ARMOR = 569;
|
||||
const int SHAPE_LEATHER_HELM = 1004;
|
||||
const int SHAPE_SCALE_MAIL = 570;
|
||||
const int SHAPE_SCALE_ARMOR = 570;
|
||||
const int SHAPE_SWAMP_BOOTS = 588;
|
||||
const int SHAPE_CHAIN_ARMOR = 571;
|
||||
const int SHAPE_PLATE_ARMOR = 573;
|
||||
const int SHAPE_CHAIN_LEGGINGS = 575;
|
||||
const int SHAPE_PLATE_HELM = 541;
|
||||
const int SHAPE_PLATE_LEGGINGS = 576;
|
||||
const int SHAPE_CURVED_HEATER = 545;
|
||||
const int SHAPE_HEATER_SHIELD = 545;
|
||||
const int SHAPE_WINGED_SHIELD = 1179;
|
||||
const int SHAPE_KITE_SHIELD = 609;
|
||||
const int SHAPE_GREAT_HELM = 541;
|
||||
const int SHAPE_SPIKED_HELM = 541; //TODO: change once real spiked helm is there
|
||||
const int SHAPE_WINGED_HELM = 1264;
|
||||
const int SHAPE_RING_MAIL = 1237; //
|
||||
|
||||
const int SHAPE_BUCKLER = 543;
|
||||
const int SHAPE_LEATHER_LEGGINGS = 574;
|
||||
const int SHAPE_MAGIC_HELM = 383;
|
||||
const int SHAPE_MAGIC_ARMOR = 666;
|
||||
const int SHAPE_MAGIC_LEGGINGS = 686;
|
||||
const int SHAPE_MAGIC_GAUNTLETS = 835;
|
||||
const int SHAPE_MAGIC_GORGET = 843;
|
||||
const int FRAME_MAGIC_BOOTS = 1;
|
||||
const int SHAPE_CHAIN_COIF = 539;
|
||||
const int SHAPE_CLOTH_ARMOR = 1172;
|
||||
const int SHAPE_CLOTH_LEGGINGS = 1173;
|
||||
const int SHAPE_MAGIC_SHIELD = 663;
|
||||
const int SHAPE_DOOR_SHIELD = 1178;
|
||||
const int SHAPE_WOODEN_SHIELD = 572;
|
||||
const int SHAPE_GARGOYLE_HELM = 1236;
|
||||
const int SHAPE_ANTIQUE_ARMOR = 836;
|
||||
const int SHAPE_PARALYZE = 408;
|
||||
|
||||
const int SHAPE_GHOST = 337;
|
||||
|
||||
//for baking.uc
|
||||
const int SHAPE_DOUGH = 658;
|
||||
const int SHAPE_HEARTH = 831;
|
||||
|
||||
//Added to SHAPE_DOUGH
|
||||
const int FRAME_DOUGH_PIE = 3; //flat dough + apples = pie dough (when baked in oven, this creates a pie)
|
||||
const int FRAME_DOUGH_CAKE = 4; //flour + egg = cake dough (when baked in oven, this creates a cake)
|
||||
|
||||
|
||||
const int SHAPE_LEATHER_COLLAR = 582;
|
||||
|
||||
const int SHAPE_ARROWS = 722;
|
||||
const int SHAPE_BOLTS = 723;
|
||||
|
||||
const int SHAPE_FLAMING_OIL = 782;
|
||||
|
||||
//FOOD FRAMES
|
||||
const int FRAME_WAYBREAD = 0;
|
||||
const int FRAME_BREAD = 1;
|
||||
const int FRAME_ROLLS = 2;
|
||||
const int FRAME_ROLL = 2;
|
||||
const int FRAME_SAUSAGE = 7;
|
||||
const int FRAME_GRAPES = 19;
|
||||
const int FRAME_RIBS = 23;
|
||||
const int FRAME_RATIONS = 15;
|
||||
const int FRAME_MUTTON = 8;
|
||||
const int FRAME_CAKE = 4;
|
||||
const int FRAME_CHEESESLICE = 27;
|
||||
const int FRAME_BRIE = 27;
|
||||
const int FRAME_CHEESEWHOLE = 26;
|
||||
const int FRAME_GREENCHEESE = 28;
|
||||
const int FRAME_PASTRY = 6;
|
||||
const int FRAME_EGG = 24;
|
||||
const int FRAME_HAM = 11;
|
||||
const int FRAME_TROUT = 12;
|
||||
const int FRAME_FLOUNDER = 13;
|
||||
const int FRAME_BEEF = 9;
|
||||
const int FRAME_CHICKEN = 10;
|
||||
const int FRAME_VENISON = 14;
|
||||
|
||||
const int SHAPE_HORSEFLESH = 1252;
|
||||
|
||||
const int SHAPE_RING_OF_INVISIBILITY = 296;
|
||||
|
||||
|
||||
//RUNE FRAMES
|
||||
const int FRAME_SACRIFICE = 0;
|
||||
const int FRAME_JUSTICE = 1;
|
||||
const int FRAME_HUMILITY = 2;
|
||||
const int FRAME_SPIRITUALITY = 3;
|
||||
const int FRAME_VALOR = 4;
|
||||
const int FRAME_COMPASSION = 5;
|
||||
const int FRAME_HONOR = 6;
|
||||
const int FRAME_HONESTY = 7;
|
||||
|
||||
|
||||
//BOTTLE FRAMES
|
||||
|
||||
const int FRAME_SKARA_RED = 11;
|
||||
const int FRAME_SKARA_WHITE = 4;
|
||||
const int FRAME_SKARA_DRY = 10;
|
||||
const int FRAME_RED = 12;
|
||||
const int FRAME_MEAD = 0;
|
||||
const int FRAME_WINE = 5;
|
||||
const int FRAME_ALE = 3;
|
||||
const int FRAME_MILK = 7;
|
||||
|
||||
const int SHAPE_OPEN_GRAVE = 1188;
|
||||
const int FRAME_EMPTY_GRAVE = 0;
|
||||
const int FRAME_GREY_COFFIN = 1;
|
||||
const int FRAME_BROWN_COFFIN = 2;
|
||||
|
||||
const int FRAME_SCROLL = 3;
|
||||
|
||||
|
||||
|
||||
//BOOKS
|
||||
const int QUALITY_OZ = 6;
|
||||
|
||||
//SCROLLS
|
||||
const int QUALITY_RINALDOWARRANT = 54;
|
||||
const int QUALITY_QUENTONLETTER = 52;
|
||||
const int QUALITY_LEAFLET = 53;
|
||||
|
||||
|
||||
|
||||
|
||||
const int SHAPE_EXPLOSION = 676;
|
||||
|
||||
|
||||
|
||||
//SPELLS
|
||||
|
||||
|
||||
//Linear
|
||||
const int AWAKEN = 0;
|
||||
const int WEATHER = 1;
|
||||
const int DOUSE = 2;
|
||||
const int FIREWORKS =3 ;
|
||||
const int GLIMMER = 4;
|
||||
const int HELP = 5;
|
||||
const int IGNITE = 6;
|
||||
const int THUNDER = 7;
|
||||
|
||||
//First circle
|
||||
const int CREATE_FOOD = 8;
|
||||
const int CURE = 9;
|
||||
const int DETECT_TRAP = 10;
|
||||
const int GREAT_DOUSE = 11;
|
||||
const int GREAT_IGNITE = 12;
|
||||
const int LIGHT = 13;
|
||||
const int LOCATE = 14;
|
||||
const int AWAKEN_ALL = 15;
|
||||
|
||||
|
||||
//Second circle
|
||||
|
||||
const int DESTROY_TRAP = 16;
|
||||
const int ENCHANT = 17;
|
||||
const int FIRE_BLAST = 18;
|
||||
const int GREAT_LIGHT = 19;
|
||||
const int MASS_CURE = 20;
|
||||
const int PROTECTION_SPELL = 21;
|
||||
const int TELEKINESIS = 22;
|
||||
const int WIZARD_EYE = 23;
|
||||
|
||||
//Third Circle
|
||||
const int CURSE = 24;
|
||||
const int HEAL = 25;
|
||||
const int SWARM = 26;
|
||||
const int PROTECT_ALL = 27;
|
||||
const int PARALYZE = 28;
|
||||
const int PEER_SPELL = 29;
|
||||
const int POISON = 30;
|
||||
const int SLEEP_SPELL = 31;
|
||||
|
||||
//Fourth Circle
|
||||
const int CONJURE = 32;
|
||||
const int LIGHTNING = 33;
|
||||
const int MARK = 34;
|
||||
const int MASS_CURSE = 35;
|
||||
const int RECALL = 36;
|
||||
const int REVEAL = 37;
|
||||
const int SEANCE = 38;
|
||||
const int UNLOCK_MAGIC = 39;
|
||||
|
||||
//Fifth Circle
|
||||
const int CHARM = 40;
|
||||
const int DANCE_SPELL = 41;
|
||||
const int DISPEL_FIELD = 42;
|
||||
const int EXPLOSION = 43;
|
||||
const int GREAT_HEAL = 44;
|
||||
const int INVISIBILITY = 45;
|
||||
const int FIRE_FIELD = 46;
|
||||
const int MASS_SLEEP = 47;
|
||||
|
||||
//Sixth Circle
|
||||
const int CAUSE_FEAR = 48;
|
||||
const int CLONE = 49;
|
||||
const int FIRE_RING = 50;
|
||||
const int FLAMESTRIKE = 51;
|
||||
const int MAGIC_STORM = 52;
|
||||
const int POISON_FIELD = 53;
|
||||
const int SLEEP_FIELD = 54;
|
||||
const int TREMOR = 55;
|
||||
|
||||
//Seventh Circle
|
||||
const int CREATE_GOLD = 56;
|
||||
const int DEATH_BOLT = 57;
|
||||
const int DELAYED_BLAST = 58;
|
||||
const int ENERGY_FIELD = 59;
|
||||
const int ENERGY_MIST = 60;
|
||||
const int MASS_CHARM = 61;
|
||||
const int MASS_MIGHT = 62;
|
||||
const int RESTORATION = 63;
|
||||
|
||||
//Eighth Circle
|
||||
const int ARMAGEDDON = 64;
|
||||
const int DEATH_VORTEX = 65;
|
||||
const int MASS_DEATH = 66;
|
||||
const int INVISIBLE_ALL = 67;
|
||||
const int RESURRECT = 68;
|
||||
const int SUMMON = 69;
|
||||
const int SWORDSTRIKE = 70;
|
||||
const int TIME_STOP = 71;
|
||||
|
||||
const int SHAPE_HORSE = 727;
|
||||
|
||||
const int QUALITY_LENORASLETTER = 52;
|
||||
|
||||
366
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/u6_npcs.uc
Executable file
366
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/headers/u6_npcs.uc
Executable file
@@ -0,0 +1,366 @@
|
||||
enum britain_npcs
|
||||
{
|
||||
ANYA = -37,
|
||||
ARIANA = -24, //gives you the rune
|
||||
ARTY = -40,
|
||||
CULLEN = -52,
|
||||
DAROS = -46,
|
||||
DAVER = -31,
|
||||
EFRAM = -38,
|
||||
FINN = -62,
|
||||
FYODOR = -29,
|
||||
GWENNETH = -22,
|
||||
KENNETH = -39,
|
||||
KYTYN = -17,
|
||||
LADY_NAN = -30,
|
||||
LAZEENA = -28,
|
||||
LINDA = -41,
|
||||
LYNN = -33,
|
||||
MATT = -23,
|
||||
MAX = -26,
|
||||
NEMA = -47,
|
||||
PEYTON = -25,
|
||||
RUFUS = -36,
|
||||
TERRI = -32,
|
||||
THOLDEN = -43, //gives you the mantra
|
||||
TIBERIUS = -42,
|
||||
WILBUR = -34
|
||||
};
|
||||
|
||||
enum castle_british_npcs
|
||||
{
|
||||
CHUCKLES = -55,
|
||||
GEOFFREY = -35,
|
||||
LORD_BRITISH = -148, //gives key, heals
|
||||
MALDRIC = -48,
|
||||
NYSTUL = -139,
|
||||
SHERRY = -6 //give her cheese, use her to get rune of Valor
|
||||
};
|
||||
|
||||
enum yew_npcs
|
||||
{
|
||||
ANDREA = -15,
|
||||
BEN = -116, //get the log from him
|
||||
BOSKIN = -21,
|
||||
LENARD = -245,
|
||||
LENORA = -18, //gives permission for the key
|
||||
NICODEMUS = -102,
|
||||
PRIDGARM = -19,
|
||||
RINALDO = -50,
|
||||
//ROWAN = -251, //pirate npc for Michael sidequest
|
||||
//SINJEN = //sinjen is an item not an npc technically
|
||||
UTOMO = -20
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
enum skara_npcs
|
||||
{
|
||||
DEZANA = -143,
|
||||
GIDEON = -140,
|
||||
HORANCE = -141,
|
||||
MARNEY = -75,
|
||||
MARTA = -144,
|
||||
MICHAEL = -76,
|
||||
QUENTON = -146,
|
||||
STIVIUS = -147,
|
||||
TRENTON = -142,
|
||||
YORL = -145
|
||||
|
||||
};
|
||||
|
||||
enum paws_npcs
|
||||
{
|
||||
ARBETH = -120,
|
||||
DORIN = -122,
|
||||
DR_CAT = -127,
|
||||
GRISON = -121,
|
||||
HENDLE = -124,
|
||||
MARISSA = -119,
|
||||
MERIDETH = -123,
|
||||
MORTUDE = -118,
|
||||
PATRICK = -115,
|
||||
THINDLE = -117,
|
||||
TIMOTHY = -126,
|
||||
UBERMON = -125
|
||||
};
|
||||
|
||||
enum party_npcs
|
||||
{
|
||||
PARTY = -357, //Used by several intrinsics (e.g. UI_count_objects) that would otherwise take a single NPC
|
||||
//Not supported by several other intrinsics that you'd really like it to (e.g. UI_get_cont_items)
|
||||
AVATAR = -356,
|
||||
BEHLEM = -191,
|
||||
BLAINE = -27,
|
||||
DUPRE = -4,
|
||||
GORN = -138,
|
||||
GWENNO = -87,
|
||||
IOLO = -1,
|
||||
JAANA = -5,
|
||||
JULIA = -8,
|
||||
KATRINA = -9,
|
||||
LEODON = -221,
|
||||
LEONNA = -223,
|
||||
SEGGALLION = -232,
|
||||
SENTRI = -7,
|
||||
SHAMINO = -3
|
||||
|
||||
};
|
||||
|
||||
enum trinsic_npcs
|
||||
{
|
||||
BRANDON = -83,
|
||||
HAROLD = -85,
|
||||
IMMANUELLE = -84,
|
||||
SANDY = -80,
|
||||
TOBATHA = -86,
|
||||
WHITSABER = -81,
|
||||
LAWRENCE = -82
|
||||
};
|
||||
|
||||
enum minoc_npcs
|
||||
{
|
||||
AARON = -91,
|
||||
DALE = -92,
|
||||
DORIS = -96,
|
||||
ISABELLA = -97,
|
||||
JAMES = -93,
|
||||
MICHELLE = -90,
|
||||
SELGANOR = -88,
|
||||
TARA = -89,
|
||||
TREBOR = -94,
|
||||
TROY = -95
|
||||
|
||||
};
|
||||
|
||||
enum new_magincia_npcs
|
||||
{
|
||||
ANTONIO = -134,
|
||||
AURENDIR = -135,
|
||||
CHARLOTTE = -133,
|
||||
CONOR = -136,
|
||||
DUNBAR = -130,
|
||||
WILLIAM = -137
|
||||
|
||||
};
|
||||
|
||||
enum serpents_hold_npcs
|
||||
{
|
||||
AMANDA = -240,
|
||||
CARADON = -239,
|
||||
DE_HUGH = -237,
|
||||
GHERICK = -242,
|
||||
KORANADA = -235,
|
||||
LADY_TESSA = -233,
|
||||
LOUBET = -236,
|
||||
MORCHELLA = -238,
|
||||
SEGALLION = -232,
|
||||
SHUBIN = -241,
|
||||
SIR_SIMON = -234
|
||||
|
||||
|
||||
};
|
||||
|
||||
enum gargoyle_npcs
|
||||
{
|
||||
BOLESH = -184,
|
||||
CARETAKER = -192,
|
||||
DRAXINUSOM = -180,
|
||||
FARMER_KRILL = -187,
|
||||
FARMER_NASH = -189,
|
||||
FOODMAKER = -185,
|
||||
GOODSCRAFTER = -186,
|
||||
GARG_HEALER = -183, //to avoid HEALER already declared
|
||||
LENSMAKER = -188,
|
||||
NAXATILOR = -182,
|
||||
SNAKECHARMER = -193,
|
||||
VALKADESH = -197,
|
||||
WEAPONSMITH = -190
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
enum cove_npcs
|
||||
{
|
||||
AHRMAAND = -77,
|
||||
ARTAGEL = -71,
|
||||
ED = -72,
|
||||
GERTAN = -78,
|
||||
GILRON = -73,
|
||||
RUDYOM = -74,
|
||||
SASHA = -79
|
||||
|
||||
};
|
||||
|
||||
enum empath_abbey_npcs
|
||||
{
|
||||
ECKHART = -114,
|
||||
FAREN = -106,
|
||||
GLEN = -14, //moved from -14 for testing purposes
|
||||
MOLE = -13, //moved from -100 which was kind of buggy
|
||||
SIONNACH = -11,
|
||||
STEPHANIE = -108,
|
||||
SYLAINA = -12,
|
||||
ZEKE = -112
|
||||
|
||||
};
|
||||
|
||||
enum jhelom_npcs
|
||||
{
|
||||
ARVIN = -58,
|
||||
CULHAM = -63,
|
||||
HEFTIMUS = -70,
|
||||
JERRIS = -59,
|
||||
LYSSANDRA = -65,
|
||||
NOMAAN = -68,
|
||||
PEER = -60,
|
||||
STELNAR = -67,
|
||||
VANKELLIAN = -66,
|
||||
ZELIVAN = -69,
|
||||
MARTIN = -61
|
||||
};
|
||||
|
||||
enum moonglow_npcs
|
||||
{
|
||||
AGANAR = -156,
|
||||
DARGOTH = -155,
|
||||
DERYDLUS = -154,
|
||||
EPHEMERIDES = -151,
|
||||
MANREL = -157,
|
||||
MARIAH = -153,
|
||||
PENUMBRA = -150,
|
||||
ROB = -152,
|
||||
THARIAND = -158,
|
||||
XIAO = -159
|
||||
};
|
||||
|
||||
enum bucs_den_npcs
|
||||
{
|
||||
BUDO = -229,
|
||||
CAPTAIN_ELAD = -226,
|
||||
CAPTAIN_FOX = -224,
|
||||
ENRIK = -230,
|
||||
FENTRISSA = -228,
|
||||
HOMER = -222,
|
||||
JOHANN = -227,
|
||||
PETROPH = -220,
|
||||
SHAWN = -225
|
||||
|
||||
|
||||
};
|
||||
|
||||
enum misc_npcs //loners, wanderers, oddities
|
||||
{
|
||||
ANDREAS = -54,
|
||||
ARTUROS = -53,
|
||||
BONN = -64,
|
||||
CAPTAIN_JOHNE = -110,
|
||||
SIN_VRAAL = -181,
|
||||
DOUG = -253,
|
||||
SMITH = -113,
|
||||
KADOR = -98,
|
||||
KARINA = -45,
|
||||
MANDRAKE = -104,
|
||||
GYPSYWOMAN = -100,
|
||||
MAMA = -111,
|
||||
MYLES = -109,
|
||||
PAPA = -107,
|
||||
TAYNITH = -56,
|
||||
SHRINE = -247, //Used for shrine face.
|
||||
//RENTHAR
|
||||
ROWAN = -251, //pirate in Michael quest
|
||||
SUTEK = -162,
|
||||
|
||||
WANDA = -49,
|
||||
YBARRA = -103,
|
||||
ZOLTAN = -44,
|
||||
HOLDERGUY = -250, //used to hold Avatar's inventory and stats for Sherry switch
|
||||
THUG1 = -259,
|
||||
THUG2 = -292,
|
||||
THUG3 = -289,
|
||||
THUG4 = -288,
|
||||
THUG5 = -280,
|
||||
THUG6 = -270,
|
||||
THUG7 = -254,
|
||||
GENERICSHRINE = -255,
|
||||
PALACE_GUARD1 = -16,
|
||||
BLORN = 208, //used for Sherry/Avatar switch to hold Avatar's defualt training points
|
||||
PALACE_GUARD2 = -51,
|
||||
CHANTU = -351, //no need for it really
|
||||
ELAD = -350, //used for services.uc, no need for them
|
||||
LEIGH = -349, //used for services.uc, no need for them
|
||||
INMANILEM = -348, //used for services.uc, no need for them
|
||||
LAURIANNA = 347, //used for services.uc, no need for them
|
||||
REYNA = -346, //used for services.uc, no need for them
|
||||
SPARK = -245,
|
||||
TEST1 = -131,
|
||||
TEST2 = -132,
|
||||
|
||||
HYTH_GUARD1 = -219, //Gatekeeper to Hythloth, has key. Moved once avatar learns from Sin Vraal about Hythloth
|
||||
HYTH_GUARD2 = -211,
|
||||
HYTH_GUARD3 = -214,
|
||||
PUSHMEPULLYU = -149, //two headed horse
|
||||
RENTHAR = -101, //reformed assassin
|
||||
|
||||
PARTYMEMBER6 = -300,
|
||||
PHOENIX = -128, //Thief under Britain
|
||||
|
||||
MORGOTH = -105, //Evil mage in Deciet
|
||||
|
||||
FRANKTHEFOX = 165 //used for Glen's crematorium. has DO NOT RENDER flag in the shop so you have to be there for Glen to do the cremation
|
||||
|
||||
};
|
||||
|
||||
enum intro_npcs
|
||||
{
|
||||
GARGTHUG1 = -264,
|
||||
GARGBYSTANDER1 = -299,
|
||||
GARGBYSTANDER2 = -300,
|
||||
GARGBYSTANDER3 = -301,
|
||||
GARGBYSTANDER4 = -302,
|
||||
GARGTHUG2 = -265,
|
||||
GARGTHUG3 = -266,
|
||||
GARGTHUG4 = -267,
|
||||
GARGPRIEST = -263,
|
||||
DEADGARG1 = -268,
|
||||
GARGTHUG5 = -278,
|
||||
GARGTHUG6 = -279,
|
||||
DEADGARG2 = -269
|
||||
};
|
||||
|
||||
//Not used but used as utility
|
||||
enum junk_npcs
|
||||
{
|
||||
KARMA1 = -246,
|
||||
SINGULARITY = -247,
|
||||
MOONSTONES = -248,
|
||||
KARMA4 = -249,
|
||||
WRONG = -272, //clone_alagner
|
||||
BLANKDUNGEON = -273,
|
||||
BALLOON_DOG = -271, //used to determine if balloon is over the void too far - if out of bounds, warning level is set (Balloon dog's ID)
|
||||
|
||||
//Used for Shrines:
|
||||
NPC_SACRIFICE = -250,
|
||||
NPC_JUSTICE = -251,
|
||||
NPC_HUMILITY = -252,
|
||||
NPC_SPIRITUALITY = -249,
|
||||
NPC_VALOR = -248,
|
||||
NPC_HONESTY = -254,
|
||||
NPC_COMPASSION = -255,
|
||||
NPC_HONOR = -253,
|
||||
|
||||
CHAIN_BOLT = -132, //used for "shots" of chain bolt
|
||||
|
||||
//NPC stand in for Drudgeworth
|
||||
DRUDGEWORTH = -172
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
enum amulet_events
|
||||
{
|
||||
EQUIP_AMULET = 1,
|
||||
EVENT_TEST = 2
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
void reEquipAmSub (var amulet)
|
||||
{
|
||||
UI_close_gumps2();
|
||||
|
||||
var shape = UI_get_item_shape(amulet);
|
||||
// UI_error_message("Shape of amulet is: " + shape + ". reEquipAmSub called");
|
||||
UI_error_message("Shape of amulet is: " + amulet + ". reEquipAmSub called");
|
||||
|
||||
|
||||
UI_error_message("reEquipAmSub called");
|
||||
|
||||
//set removed amulet as last created
|
||||
UI_set_last_created(amulet);
|
||||
|
||||
|
||||
//if (!amulet_of_submission)
|
||||
// UI_error_message("amulet not found, ERROR!");
|
||||
//else
|
||||
// UI_error_message("Amulet found: " + amulet_of_submission + "");
|
||||
|
||||
//check if Avatar is wearing something already
|
||||
//var is_wearing = UI_get_readied(AVATAR, BG_AMULET);
|
||||
var is_wearing = AVATAR->is_readied(22, SHAPE_ANY, FRAME_ANY);
|
||||
UI_error_message("Is wearing is: " + is_wearing);
|
||||
if (UI_is_readied(AVATAR, BG_AMULET, SHAPE_ANY, FRAME_ANY))
|
||||
{
|
||||
UI_error_message("Avatar is wearing something around the neck, transferring.");
|
||||
//if so, move it to Holderguy
|
||||
transferNeckItems(AVATAR, HOLDERGUY);
|
||||
|
||||
//give amulet back to Avatar
|
||||
UI_give_last_created(AVATAR);
|
||||
|
||||
|
||||
}
|
||||
else //nothing on Avatar's neck, force item back into his neck
|
||||
{
|
||||
UI_error_message("Nothing detected around Avatar's neck");
|
||||
UI_give_last_created(AVATAR);
|
||||
}
|
||||
|
||||
//Punish Avatar for trying to take it off!
|
||||
UI_apply_damage(5, 5, FIRE_DAMAGE, AVATAR);
|
||||
delayedBark(AVATAR, "Argh, it burns!", 2);
|
||||
|
||||
//extra cleanup: find any duplicates on screen and removed
|
||||
var stray_amulets = UI_find_nearby_avatar(SHAPE_AMULET_SUBMISSION);
|
||||
if (stray_amulets > 0)
|
||||
{
|
||||
UI_error_message("stray amulets detected, removing them now");
|
||||
for (amulets in stray_amulets)
|
||||
UI_remove_item(amulets);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void amuletOfSubmission shape#(1234)()
|
||||
{
|
||||
const int SPRITE_PURPLE_CIRCLES = 21;
|
||||
var amulet = UI_get_readied(AVATAR, BG_AMULET);
|
||||
|
||||
|
||||
|
||||
|
||||
if (amulet)
|
||||
UI_error_message("amuletOfSubmission recognizes an amulet");
|
||||
else
|
||||
UI_error_message("ERROR - amuletOfSubmission does NOT recognize an amulet");
|
||||
if (event == READIED)
|
||||
{
|
||||
gflags[WEARING_AMULET_SUBMISSION] = true;
|
||||
UI_error_message("AmSubmission READIED event called");
|
||||
if (amulet)
|
||||
UI_error_message("amuletOfSubmission recognizes an amulet");
|
||||
else
|
||||
UI_error_message("ERROR - amuletOfSubmission does NOT recognize an amulet");
|
||||
UI_obj_sprite_effect(AVATAR, SPRITE_PURPLE_CIRCLES, 0, 0, 0, 0, 0, -1);
|
||||
|
||||
}
|
||||
if (event == UNREADIED)
|
||||
{
|
||||
UI_error_message("AmSubmission UNREADIED event called");
|
||||
gflags[WEARING_AMULET_SUBMISSION] = false;
|
||||
|
||||
//set removed amulet as last created
|
||||
UI_set_last_created(item);
|
||||
|
||||
item->close_gumps2();
|
||||
UI_close_gumps2();
|
||||
|
||||
//UI_flash_mouse(CURSOR_X);
|
||||
|
||||
var amSub = UI_find_object(FIND_ON_SCREEN, SHAPE_AMULET_SUBMISSION, QUALITY_ANY, FRAME_ANY);
|
||||
UI_obj_sprite_effect(AVATAR, SPRITE_PURPLE_CIRCLES, 0, 0, 0, 0, 0, -1);
|
||||
UI_play_sound_effect(76);
|
||||
|
||||
|
||||
//submitted to draxinusom, can't take it off now!
|
||||
if (gflags[SUBMITTED_TO_DRAXINUSOM])
|
||||
{
|
||||
if (amulet)
|
||||
UI_error_message("amuletOfSubmission recognizes an amulet inside UNREADIED event");
|
||||
else
|
||||
UI_error_message("amuletOfSubmission DOES NOT recognize an amulet inside UNREADIED event.");
|
||||
|
||||
//set removed amulet as last created
|
||||
UI_set_last_created(item);
|
||||
// UI_give_last_created(AVATAR);
|
||||
|
||||
reEquipAmSub(item); //from amsub
|
||||
|
||||
}
|
||||
|
||||
|
||||
script item
|
||||
{
|
||||
call amuletOfSubmission, EQUIP_AMULET;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//Force amulet back on Avatar's neck
|
||||
if (event == EQUIP_AMULET)
|
||||
{
|
||||
UI_set_last_created(item);
|
||||
|
||||
//should prevent Avatar from moving / teleporting away
|
||||
UI_set_item_flag(AVATAR, BG_DONT_MOVE);
|
||||
UI_error_message("Event EQUIP_AMULET called");
|
||||
// UI_close_gumps2();
|
||||
|
||||
if (UI_get_readied(AVATAR, BG_AMULET))
|
||||
{
|
||||
|
||||
//transfer neck item Avatar is wearing to GROUND
|
||||
transferNeckItems(AVATAR, HOLDERGUY); //This actually now places item on ground
|
||||
|
||||
//add amulet of submission
|
||||
UI_give_last_created(AVATAR);
|
||||
|
||||
}
|
||||
else
|
||||
UI_give_last_created(AVATAR);//add amulet of submission
|
||||
UI_clear_item_flag(AVATAR, BG_DONT_MOVE);
|
||||
UI_obj_sprite_effect(AVATAR, SPRITE_PURPLE_CIRCLES, 0, 0, 0, 0, 0, -1);
|
||||
|
||||
|
||||
|
||||
//Punish Avatar for trying to take it off!
|
||||
UI_apply_damage(5, 5, FIRE_DAMAGE, AVATAR);
|
||||
delayedBark(AVATAR, "Argh, it burns!", 2);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
564
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/Ankh.uc
Executable file
564
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/Ankh.uc
Executable file
@@ -0,0 +1,564 @@
|
||||
|
||||
void Ankh shape#(955) () //used to test in game things like Karma and such
|
||||
{
|
||||
//var target = UI_click_on_item();
|
||||
var party = UI_get_party_list();
|
||||
var frame = UI_get_item_frame(item);
|
||||
//var flagnum = 800;
|
||||
var flagnum = 1000;
|
||||
var boat;
|
||||
var barge;
|
||||
var avatar_position = UI_get_object_position(AVATAR);
|
||||
|
||||
var timer = UI_get_timer(BRAWL_TIMER);
|
||||
|
||||
|
||||
var song = UI_get_music_track();
|
||||
|
||||
UI_error_message("Music track playing is " + song);
|
||||
|
||||
|
||||
UI_error_message("Brawl timer is currently " + timer);
|
||||
if (gflags[BRAWLING])
|
||||
UI_error_message("Brawling flag is set");
|
||||
else
|
||||
UI_error_message("Brawling flag is NOT set");
|
||||
|
||||
|
||||
//var water = UI_is_water([1178, 1385, 0]); //UI_is_water([avatar_position]);
|
||||
var water = UI_is_water(avatar_position);
|
||||
UI_error_message("Avatar on water = " + water);
|
||||
var av_X = avatar_position[X];
|
||||
var av_Y = avatar_position[Y];
|
||||
var av_Z = avatar_position[Z];
|
||||
|
||||
var map_num = UI_get_map_num(AVATAR);
|
||||
UI_error_message("Avatar is on map " + map_num + ", at pos " + av_X + ", " + av_Y + ", " + av_Z);
|
||||
|
||||
//if (UI_is_water([avatar_position[X], avatar_position[Y], 00]))
|
||||
if (UI_is_water(avatar_position))
|
||||
//if (water)
|
||||
UI_error_message("Avatar is on a water tile");
|
||||
else
|
||||
UI_error_message("Avatar is NOT on a water tile");
|
||||
|
||||
UI_error_message("Game day is: " + UI_game_day());
|
||||
|
||||
const int TEST_TIMER = 10;
|
||||
|
||||
if (gflags[TEST_TIMER] == true)
|
||||
{
|
||||
if (UI_get_timer(TEST_TIMER) > 1)
|
||||
{
|
||||
randomPartyBark("@Timer expired@");
|
||||
gflags[TEST_TIMER] = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
const int SHAPE_BARGE = 961;
|
||||
|
||||
//Flags we DON'T want to reset -
|
||||
//global flag # 61 (learned password) so the portullius works
|
||||
//global flag # 442 - quenton seance
|
||||
//global flag # 749 Set when the Magic Storm spell is cast:
|
||||
//const int MAGIC_STORM_SPELL = 0x02ED;
|
||||
//global flag # 30 Used the armageddon spell - const int CAST_ARMAGEDDON = 0x1E;
|
||||
|
||||
|
||||
|
||||
//var garg_npcs = [-180, -191, -182, -197]; //for gargoyles needing SI_ZOMBIE turned on, clearing flags will skip them and make sure they are "set"
|
||||
var npcnum = 300;
|
||||
//var companions = [-1, -2, -3, -4, -5];
|
||||
var npc;
|
||||
var avatar_level = getExpLevel(AVATAR); //should get avatar level for testing
|
||||
|
||||
var surf = [612, 613, 632, 699, 736, 737, 751, 806, 834, 875, 907, 911, 918];
|
||||
var bucs_den =[BUDO, CAPTAIN_ELAD, CAPTAIN_FOX, ENRIK, FENTRISSA, HOMER, JOHANN, PETROPH, SHAWN];
|
||||
var moonglow = [AGANAR, DARGOTH, DERYDLUS, EPHEMERIDES, MANREL, MARIAH, PENUMBRA, ROB, THARIAND, XIAO];
|
||||
var britain = [ANYA, ARIANA, ARTY, CULLEN, DAROS, DAVER, EFRAM, FINN, FYODOR, GWENNETH, KENNETH, KYTYN, LADY_NAN, LAZEENA, LINDA, MATT, MAX, NEMA, NYSTUL, PEYTON, RUFUS, TERRI, THOLDEN, TIBERIUS, WILBUR];
|
||||
var castle_british = [CHUCKLES, GEOFFREY, LORD_BRITISH, MALDRIC, NYSTUL, SHERRY];
|
||||
var yew = [ANDREA, BEN, BOSKIN, LENARD, LENORA, NICODEMUS, PRIDGARM, RINALDO, ROWAN, UTOMO];
|
||||
var skara_brae = [DEZANA, GIDEON, HORANCE, MARNEY, MARTA, MICHAEL, QUENTON, STIVIUS, TRENTON, YORL];
|
||||
var paws = [ARBETH, DORIN, DR_CAT, GRISON, HENDLE, MARISSA, MERIDETH, MORTUDE, PATRICK, THINDLE, TIMOTHY, UBERMON];
|
||||
var trinsic = [BRANDON, HAROLD, IMMANUELLE, SANDY, TOBATHA, WHITSABER, LAWRENCE];
|
||||
var minoc = [AARON, DALE, DORIS, ISABELLA, JAMES, MICHELLE, SELGANOR, TARA, TREBOR, TROY];
|
||||
var new_magincia = [ANTONIO, AURENDIR, CHARLOTTE, CONOR, DUNBAR, WILLIAM];
|
||||
var serpents_hold = [AMANDA, CARADON, DE_HUGH, GHERICK, KORANADA, LADY_TESSA, LOUBET, MORCHELLA, SEGALLION, SHUBIN, SIR_SIMON];
|
||||
var gargoyles = [BOLESH, CARETAKER, DRAXINUSOM, FARMER_KRILL, FARMER_NASH, FOODMAKER, GOODSCRAFTER, GARG_HEALER, LENSMAKER, NAXATILOR, SNAKECHARMER, VALKADESH, WEAPONSMITH];
|
||||
var cove = [AHRMAAND, ARTAGEL, ED, GERTAN, GILRON, RUDYOM, SASHA];
|
||||
var empath_abbey = [ECKHART, FAREN, GLEN, MOLE, SIONNACH, STEPHANIE, SYLAINA, ZEKE];
|
||||
var party_npcs = [BEHLEM, BLAINE, DUPRE, GORN, GWENNO, IOLO, JAANA, JULIA, KATRINA, LEODON, LEONNA, SEGGALLION, SENTRI, SHAMINO];
|
||||
var misc = [ANDREAS, ARTUROS, BONN, CAPTAIN_JOHNE, DOUG, KADOR, KARINA, TAYNITH, MAMA, MYLES, PAPA, ROWAN, SUTEK, WANDA, YBARRA, ZOLTAN, HOLDERGUY, SMITH];
|
||||
var jhelom = [ARVIN, CULHAM, HEFTIMUS, JERRIS, LYSSANDRA, MARTIN, NOMAAN, PEER, STELNAR, VANKELLIAN, ZELIVAN];
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
var karma = getKarma();
|
||||
// randomPartyBark("The Avatar's karma is " + karma + "");
|
||||
UI_close_gumps();
|
||||
// UI_halt_scheduled(AVATAR);
|
||||
var day = UI_game_day();
|
||||
var Mondays = [1, 8, 15, 22];
|
||||
|
||||
var test = day - ((day / 7) * 7);
|
||||
|
||||
UI_play_music(255, 0); //to stop annoying combat music
|
||||
UI_show_npc_face(291, 0);
|
||||
|
||||
|
||||
if (frame == 0)
|
||||
{
|
||||
if (gflags[PLAY_ORIGINAL_TRACKS])
|
||||
{
|
||||
item.say("@Random music track will currently play after conversations end. Turn it off?@");
|
||||
if(askYesNo())
|
||||
{
|
||||
item.say("@Random music track will NOT play after conversations end.@");
|
||||
gflags[PLAY_ORIGINAL_TRACKS] = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
item.say("@Random music track after conversations end is currently off. Turn it on?@");
|
||||
if(askYesNo())
|
||||
{
|
||||
item.say("@Random music track will play after conversations end.@");
|
||||
gflags[PLAY_ORIGINAL_TRACKS] = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ((frame == 7) || (gflags[DEBUG])) //glowy amulet frame from Isle of Fire OR flag 2047 is true
|
||||
{
|
||||
item.say("Welcome to the debugging menu.");
|
||||
|
||||
// if (!UI_find_nearby_avatar(surf)) randomPartyBark("@TEST - We are in deep water or on land@"); //used for s
|
||||
|
||||
|
||||
UI_show_npc_face(291, 0);
|
||||
item.say("Welcome to the debugging menu.");
|
||||
|
||||
var options = ["add reagents", "run endgame", "get day", "reset global flags", "halt all scripts", "start timer", "reset npc flags", "bye", "karma options", "start game"];
|
||||
var karmaoptions = ["nothing", "add karma", "subtract karma", "reset karma", "display karma", "add 5"];
|
||||
|
||||
//Start of regular conversation tree
|
||||
converse(options)
|
||||
{
|
||||
case "reset global flags":
|
||||
say("@Global flags reset@");
|
||||
//flagnum starts at 1000 so no crucial flags are tampered with
|
||||
while (flagnum <= 2047) //change higher if needed.
|
||||
{
|
||||
gflags[flagnum] = false;
|
||||
flagnum += 1;
|
||||
}
|
||||
|
||||
|
||||
case "create boat":
|
||||
item->createShip();
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case "start timer":
|
||||
UI_set_timer(TEST_TIMER);
|
||||
gflags[TEST_TIMER] = true;
|
||||
break;
|
||||
|
||||
// case "get day":
|
||||
|
||||
case "start game":
|
||||
item->teleportToCastle();
|
||||
|
||||
case "run endgame":
|
||||
UI_run_endgame(true);
|
||||
|
||||
case "move raft":
|
||||
barge = UI_find_nearby(AVATAR, SHAPE_BARGE, 30, MASK_EGG);
|
||||
boat->get_item_shape(barge);
|
||||
// UI_set_item_flag(AVATAR, BG_DONT_MOVE);
|
||||
|
||||
script barge
|
||||
{
|
||||
call freezeAvatar;
|
||||
repeat 5{
|
||||
step north;
|
||||
wait 2;
|
||||
step north;
|
||||
wait 2;
|
||||
step north;
|
||||
wait 2;
|
||||
};
|
||||
call centerOnAvatar;
|
||||
call unfreezeAvatar;
|
||||
}
|
||||
break;
|
||||
|
||||
case "transfer items":
|
||||
say("@Items transfered to HolderGuy npc num 250.@");
|
||||
transferAllItems(AVATAR, HOLDERGUY);
|
||||
|
||||
case "body":
|
||||
var body2 = UI_get_cont_items(PARTY, 414, QUALITY_ANY, FRAME_ANY);
|
||||
for (body in body2 with index to max)
|
||||
{
|
||||
var bodyshape = body->get_item_shape();
|
||||
var bodyframe = body->get_item_frame();
|
||||
UI_error_message("Body 2 shape found is, " + bodyshape);
|
||||
UI_error_message("Body 2 frame found is, " + bodyframe);
|
||||
|
||||
//if ((bodyframe != 24) && (bodyframe != 25))
|
||||
// bodies += 1;
|
||||
//index += 1;
|
||||
}
|
||||
|
||||
|
||||
case "reset npc flags":
|
||||
say("@NPC flags resetting.@");
|
||||
|
||||
for (npc in britain with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in castle_british with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in yew with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in paws with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in party_npcs with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in skara_brae with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in trinsic with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in minoc with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in new_magincia with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in serpents_hold with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
for (npc in gargoyles with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in cove with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in empath_abbey with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in misc with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
|
||||
for (npc in bucs_den with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in moonglow with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in skara_brae with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
for (npc in jhelom with index to max)
|
||||
{
|
||||
UI_clear_item_flag(npc, MET);
|
||||
UI_clear_item_flag(npc, PETRA);
|
||||
UI_clear_item_flag(npc, CONFUSED);
|
||||
UI_clear_item_flag(npc, NAKED);
|
||||
UI_clear_item_flag(npc, POLYMORPH);
|
||||
UI_clear_item_flag(npc, TATTOOED);
|
||||
UI_clear_item_flag(npc, READ);
|
||||
UI_clear_item_flag(npc, NO_SPELL_CASTING);
|
||||
UI_clear_item_flag(npc, SI_ZOMBIE);
|
||||
}
|
||||
|
||||
case "add reagents":
|
||||
say("25 of each reagent added.");
|
||||
var reagents = [FRAME_BLOOD_MOSS, FRAME_MANDRAKE_ROOT, FRAME_NIGHTSHADE, FRAME_GARLIC, FRAME_SPIDER_SILK, FRAME_SULFUR_ASH, FRAME_BLACK_PEARL, FRAME_GINSENG];
|
||||
var bag = UI_create_new_object(SHAPE_BAG);
|
||||
var idx = -1;
|
||||
|
||||
//give bag to Avatar
|
||||
UI_give_last_created(AVATAR);
|
||||
|
||||
//cycle through reagent array, give bag 25 of each
|
||||
for (regs in reagents)
|
||||
{
|
||||
UI_error_message("regs is " + regs);
|
||||
UI_add_cont_items(bag, 25, SHAPE_REAGENT, QUALITY_ANY, regs, false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
case "get current level":
|
||||
say("@Avatar's level is " + avatar_level + "@");
|
||||
|
||||
case "codex wall":
|
||||
{
|
||||
codexWall();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
case "open codex":
|
||||
{
|
||||
openCodex();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
case "karma options":
|
||||
{
|
||||
converse(karmaoptions)
|
||||
{
|
||||
case "nothing":
|
||||
break;
|
||||
|
||||
case "add karma":
|
||||
var addKarmaAmt = UI_input_numeric_value(0, 100, 1, 1);
|
||||
addKarma(addKarmaAmt);
|
||||
|
||||
|
||||
case "subtract karma":
|
||||
var subtractKarmaAmt = UI_input_numeric_value(0, 100, 1, 1);
|
||||
subtractKarma(subtractKarmaAmt);
|
||||
|
||||
case "reset karma":
|
||||
resetKarma();
|
||||
say("@Avatar karma is :@ " + getKarma());
|
||||
|
||||
case "add 5":
|
||||
addKarma(5);
|
||||
|
||||
case "display karma":
|
||||
say("@Avatar karma is :@ " + getKarma());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
case "halt all scripts":
|
||||
{
|
||||
if (UI_in_usecode(AVATAR))
|
||||
{
|
||||
say("Avatar currently running a script.");
|
||||
}
|
||||
else
|
||||
say("@Avatar currently not running a script.@");
|
||||
|
||||
UI_halt_scheduled(AVATAR);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
case "delete nearby Eggs":
|
||||
say("Eggs should be deleted.");
|
||||
deleteEggs();
|
||||
|
||||
|
||||
case "bye":
|
||||
say("@Goodbye.@");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
void CastleSched ()
|
||||
{
|
||||
var hour = UI_game_hour();
|
||||
var minute = UI_game_minute();
|
||||
|
||||
if (event == EGG)
|
||||
{
|
||||
if (hour == 11) //11am
|
||||
{
|
||||
CHUCKLES->move_object([0x3d2, 0x452, 0x0]);
|
||||
UI_set_schedule_type(CHUCKLES, EAT_AT_INN);
|
||||
}
|
||||
|
||||
if (hour == 12) //12pm
|
||||
{
|
||||
CHUCKLES->move_object([0x3a9, 0x426, 0x0]);
|
||||
UI_set_schedule_type(CHUCKLES, MAJOR_SIT);
|
||||
}
|
||||
|
||||
if (hour == 13) //1pm
|
||||
{
|
||||
CHUCKLES->move_object([0x3a8, 0x430, 0x0]);
|
||||
UI_set_schedule_type(CHUCKLES, DANCE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (hour == 14) //2pm
|
||||
{
|
||||
LORD_BRITISH->move_object([0x3a9, 0x426, 0x0]);
|
||||
UI_set_schedule_type(LORD_BRITISH, MAJOR_SIT);
|
||||
|
||||
GEOFFREY->move_object([0x3a7, 0x466, 0x0]);
|
||||
UI_set_schedule_type(GEOFFREY, LOITER);
|
||||
|
||||
}
|
||||
|
||||
if (hour == 16) //4pm
|
||||
{
|
||||
GEOFFREY->move_object([0x47e, 0x4f4, 0x0]);
|
||||
UI_set_schedule_type(GEOFFREY, MAJOR_SIT);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (hour == 19) //7pm
|
||||
{
|
||||
LORD_BRITISH->move_object([0x38d, 0x42f, 0x0]);
|
||||
UI_set_schedule_type(LORD_BRITISH, MAJOR_SIT);
|
||||
|
||||
SHERRY->move_object([0x38e, 0x430, 0x0]);
|
||||
UI_set_schedule_type(SHERRY, STANDTHERE);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
226
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/ChaosSword.uc
Executable file
226
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/ChaosSword.uc
Executable file
@@ -0,0 +1,226 @@
|
||||
//function to determine if someone in the party is charmed already
|
||||
var isCharmed(var npc)
|
||||
{
|
||||
if (UI_get_item_flag(npc, CHARMED))
|
||||
{
|
||||
UI_error_message("npc is charmed");
|
||||
return true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
UI_error_message("npc is NOT charmed");
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//the event which is called from equipping the Chaos sword
|
||||
void chaosSword object# () ()
|
||||
{
|
||||
var cont;
|
||||
|
||||
enum chaos_levels
|
||||
{
|
||||
CHAOS_LOOP = 1,
|
||||
CHAOS_POISON = 2,
|
||||
CHAOS_BURN = 3 //Karma is too high > 20
|
||||
|
||||
|
||||
};
|
||||
|
||||
UI_error_message("chaosSword called");
|
||||
|
||||
//prevents from calling it too much
|
||||
if (gflags[CHAOS_SWORD_EQUIPPED])
|
||||
{
|
||||
UI_error_message("Chaos sword loop activated via readied event");
|
||||
script item after 10 ticks
|
||||
{
|
||||
call chaosSword, CHAOS_LOOP;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
if (event == CHAOS_LOOP)
|
||||
{
|
||||
//randomPartyBark("Chaos loop initiated");
|
||||
UI_error_message("Chaos sword event called");
|
||||
//Get sword container:
|
||||
cont = get_container();
|
||||
|
||||
//Avatar's karma - can't be too high to wield the chaos sword.
|
||||
var avatar_karma = getKarma();
|
||||
|
||||
var is_charmed = false; //boolean to detrmine if someone is charmed already
|
||||
|
||||
var party = UI_get_party_list();
|
||||
var npc;
|
||||
var rand = UI_get_random(5);
|
||||
|
||||
//random chance wearer takes damage
|
||||
|
||||
//karma is too high, sword will do damage and kill the wearer. NPCs in the party will share the Avatar's karma of course.
|
||||
if (avatar_karma > 40 && rand == 3)
|
||||
{
|
||||
UI_error_message("Avatar karma is " + avatar_karma + ", take damage after 40!");
|
||||
if (cont->is_npc() && (item == cont->get_readied(BG_BOTH_HANDS) || item == cont->get_readied(BG_WEAPON_HAND))) //failsafe
|
||||
{
|
||||
|
||||
|
||||
|
||||
var current_health = UI_get_npc_prop(cont, HEALTH);
|
||||
|
||||
if (avatar_karma < 60)
|
||||
UI_item_say(cont, "Yeow! The chaos sword feels hot!");
|
||||
else if (avatar_karma > 60 && avatar_karma < 80)
|
||||
UI_item_say(cont, "The chaos sword is burning mine hand!");
|
||||
else if (avatar_karma > 80)
|
||||
{
|
||||
UI_item_say(cont, "The chaos sword feels very hot and unstable!");
|
||||
//earthquake effect
|
||||
UI_earthquake(3);
|
||||
|
||||
rand = UI_get_random(5);
|
||||
|
||||
if (rand == 1) //chaos sword erupts and explodes!
|
||||
{
|
||||
UI_obj_sprite_effect(cont, 5, 0,0, 0, 0, 0, -1); //small explosion on the wearer
|
||||
|
||||
if (avatar_karma / 6 < current_health > 0)
|
||||
UI_item_say(cont, "The chaos sword just exploded in mine hand!");
|
||||
else
|
||||
UI_item_say(cont, "Arrrgh!!");
|
||||
|
||||
//remove chaos sword
|
||||
UI_remove_item(item);
|
||||
|
||||
|
||||
|
||||
gflags[CHAOS_SWORD_EQUIPPED] = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//apply damage based on karma
|
||||
UI_apply_damage(1, avatar_karma / 6, LIGHTNING_DAMAGE, cont);
|
||||
UI_play_sound_effect(26);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (UI_in_combat())
|
||||
{
|
||||
if (cont->is_npc() && (item == cont->get_readied(BG_BOTH_HANDS) || item == cont->get_readied(BG_BOTH_HANDS))) //switch to weapon hand if not 2 handed
|
||||
//charm user:
|
||||
cont->set_item_flag(CURSED);
|
||||
|
||||
//check if anyone in the party is charmed, if not, set them as charmed
|
||||
|
||||
for (npc in party)
|
||||
{
|
||||
if (isCharmed(npc))
|
||||
{
|
||||
is_charmed = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//no one in the party is charmed, pick a random one and charm them
|
||||
if (!is_charmed)
|
||||
{
|
||||
var party_num = UI_get_array_size([party]);
|
||||
var rand = UI_get_random(party_num);
|
||||
var rand_npc = party[rand];
|
||||
|
||||
//set the random party member to CHARMED
|
||||
UI_set_item_flag(rand_npc, CHARMED);
|
||||
|
||||
//set alignment
|
||||
UI_set_alignment(rand_npc, CHAOTIC);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
if (UI_is_readied(cont, BG_WEAPON_HAND, SHAPE_CHAOS_SWORD, FRAME_ANY))
|
||||
{
|
||||
UI_error_message("Chaos loop called");
|
||||
script item after 30 ticks
|
||||
{
|
||||
call chaosSword, CHAOS_LOOP;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//karma is > 20, too high to wield the chaos sword.
|
||||
if (event == CHAOS_BURN)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ChaosSword shape#(637) () //
|
||||
{
|
||||
var party = UI_get_party_list();
|
||||
var cont;
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
item->chaosSword();
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (event == READIED)
|
||||
{
|
||||
UI_close_gumps();
|
||||
gflags[CHAOS_SWORD_EQUIPPED] = true;
|
||||
UI_error_message("Should call chaos sword object");
|
||||
item->chaosSword();
|
||||
}
|
||||
|
||||
if (event == UNREADIED)
|
||||
{
|
||||
|
||||
//Stop charmed:
|
||||
gflags[CHAOS_SWORD_EQUIPPED] = false;
|
||||
|
||||
//clear charmed effect
|
||||
for (npc in party)
|
||||
{
|
||||
//clear the random party member to CHARMED
|
||||
UI_clear_item_flag(npc, CHARMED);
|
||||
|
||||
//set alignment back to GOOD
|
||||
UI_set_alignment(npc, GOOD);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
72
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/Codex.uc
Executable file
72
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/Codex.uc
Executable file
@@ -0,0 +1,72 @@
|
||||
void Codex shape#(1102) ()
|
||||
{
|
||||
var player_name = getAvatarName();
|
||||
var qual = UI_get_item_quality(item);
|
||||
var msg;
|
||||
var sound;
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
// * denotes page break
|
||||
// ~ equals 'enter' for space
|
||||
if (qual == 0)
|
||||
{
|
||||
showBook();
|
||||
say("~~The Codex of Ultimate Wisdom~~*");
|
||||
|
||||
say("~As always, the Codex is open to the pages bearing exactly the information you need: *");
|
||||
if (!gflags[FINAL_QUEST_GIVEN])
|
||||
{
|
||||
say("~~Uh oh, looks like you've been a naughty Avatar! You've been caught red-handed, cheating of all things! What's wrong, the game too hard for you, Avatar?");
|
||||
say("~~Did you think I wouldn't find out? I'm da freakin' Codex! The Codex of Ultimate F'n Wisdom, son! You dare come here, teleport or use the F2 cheat, or somehow got past my defenses to land here on the balloon, and you have the balls to ask me for wisdom?!");
|
||||
say("~~I know all your secrets, Avatar! I know what you did last savegame, Avatar! Poor Chuckles... those poor civilians... poor Lord British.");
|
||||
say("~~And to think they trusted you as the Avatar!");
|
||||
say("~~Yes, that's right! I know all. I know you explode people with powder kegs, I know you kill everything that moves when you get bored....*");
|
||||
say(".....and I know what's in your browser history, Avatar!!! Seriously, you are one SICK individual! Did you think clearing your browser would hide it from The Codex?! Think again!*");
|
||||
say("What would your mother think?? She'd be sickened by you, that's what! At this point I think I'll banish myself to the void, just so I don't have to talk to your cheating ass anymore!");
|
||||
say("~~Goodbye Cheat-atar!!*");
|
||||
|
||||
say("PS---STOP CHEATING!");
|
||||
script item after 3 ticks
|
||||
{
|
||||
speech 21;
|
||||
|
||||
wait 10;
|
||||
|
||||
//music 203;
|
||||
}
|
||||
UI_obj_sprite_effect(item, 8, 0, 0, 0, 0, 0, -1);
|
||||
UI_remove_item(item);
|
||||
UI_armageddon();
|
||||
UI_earthquake(5);
|
||||
UI_set_weather(2); //rain
|
||||
|
||||
//UI_play_music(203);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
say("~~To return the Codex to the Vortex, place a convex lens exactly midway between the Codex and the Flame of Singularity, so that the light from the flame converges on the Codex. Place a concave lens between the Codex and the Flame of Infinity, so that its light diverges over the Codex. Then place the eight moonstones within the Vortex Cube. Set it on the ground in front of the Codex, and use it to return the Codex from whence it came.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
showBook();
|
||||
say("This is not a valid scroll QUAL attribute! Stop cheating!");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
void Shrines shape# (1245) ()
|
||||
{
|
||||
var quality = UI_get_item_quality(item);
|
||||
var frame = UI_get_item_frame(item);
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
var karma = UI_get_npc_id(AVATAR);
|
||||
var party_list = UI_get_party_list();
|
||||
var shrine;
|
||||
var virtue;
|
||||
var npc;
|
||||
|
||||
//get frame of Shrine
|
||||
if (frame == 0) { shrine = "Compassion"; virtue = "compassion"; }
|
||||
if (frame == 1) { shrine = "Valor"; virtue = "valor"; }
|
||||
if (frame == 2) { shrine = "Honesty"; virtue = "honesty"; }
|
||||
if (frame == 3) { shrine = "Justice"; virtue = "justice"; }
|
||||
if (frame == 4) { shrine = "Humility"; virtue = "humility"; }
|
||||
if (frame == 5) { shrine = "Sacrifice"; virtue = "sacrifice"; }
|
||||
if (frame == 6) { shrine = "Honor"; virtue = "honor"; }
|
||||
if (frame == 7) { shrine = "Spirituality"; virtue = "spirituality"; }
|
||||
if (frame > 8) return;
|
||||
|
||||
//Shrine is determined, call Meditate function for shrine and virtue
|
||||
if ((shrine == "Compassion") && (gflags[COMPASSION_FREED])) Meditate(shrine, virtue);
|
||||
if ((shrine == "Valor") && (gflags[VALOR_FREED])) Meditate(shrine, virtue);
|
||||
if ((shrine == "Honesty") && (gflags[HONESTY_FREED])) Meditate(shrine, virtue);
|
||||
if ((shrine == "Justice") && (gflags[JUSTICE_FREED])) Meditate(shrine, virtue);
|
||||
if ((shrine == "Humility") && (gflags[HUMILITY_FREED])) Meditate(shrine, virtue);
|
||||
if ((shrine == "Sacrifice") && (gflags[SACRIFICE_FREED])) Meditate(shrine, virtue);
|
||||
if ((shrine == "Honor") && (gflags[HONOR_FREED])) Meditate(shrine, virtue);
|
||||
if ((shrine == "Spirituality") && (gflags[SPIRITUALITY_FREED])) Meditate(shrine, virtue);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
void vortexCube shape#(786) ()
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
var count = 0;
|
||||
if (gflags[VORTEX_CUBE_FULL])
|
||||
{
|
||||
// AVATAR.say("@There are 8 moonstones inside the Vortex Cube.@");
|
||||
UI_close_gumps();
|
||||
var target = UI_click_on_item();
|
||||
var target_shape = UI_get_item_shape(target);
|
||||
if (target_shape != 1102) //codex
|
||||
UI_flash_mouse(CURSOR_X);
|
||||
else
|
||||
{
|
||||
if (gflags[HUMAN_LENS_PLACED] && gflags[GARG_LENS_PLACED])
|
||||
{
|
||||
SendCodexToVoid(); //initiate endgame sequence
|
||||
}
|
||||
else
|
||||
randomPartyBark("@The lenses aren't in place.@");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (gflags[MOONSTONE1])
|
||||
count += 1;
|
||||
if (gflags[MOONSTONE2])
|
||||
count += 1;
|
||||
if (gflags[MOONSTONE3])
|
||||
count += 1;
|
||||
if (gflags[MOONSTONE4])
|
||||
count += 1;
|
||||
if (gflags[MOONSTONE5])
|
||||
count += 1;
|
||||
if (gflags[MOONSTONE6])
|
||||
count += 1;
|
||||
if (gflags[MOONSTONE7])
|
||||
count += 1;
|
||||
if (gflags[MOONSTONE8])
|
||||
count += 1;
|
||||
if (count > 0)
|
||||
AVATAR.say("@There are " + count + " moonstones inside the Vortex Cube.@");
|
||||
else
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
void altarOfSingularity shape#(1239) ()
|
||||
{
|
||||
var karma = getKarma();
|
||||
var options;
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
var karma = getKarma();
|
||||
|
||||
UI_show_npc_face(256, 0);
|
||||
item.say("A finely-carved stone pyramid.");
|
||||
item.say("As you face the altar, a voice rings in your head. You understand it perfectly, but you can't recognize the language!");
|
||||
|
||||
if (gflags[FINAL_QUEST_GIVEN])
|
||||
{
|
||||
item.say("@There is no more wisdom for thee to acquire here, noble Avatar.@*");
|
||||
item.say("@Seek the Codex, and may nothing impede thy sacred quest!@");
|
||||
UI_obj_sprite_effect(item, 7, 20, 20, 0, 0, 0, -1);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (!gflags[MET_ALTAR_SINGULARITY]) //haven't "met" altar yet - (answered the correct question)
|
||||
{
|
||||
if (karma < 40)
|
||||
{
|
||||
item.say("@Thy deeds make thee unworthy of enlightenment.@*");
|
||||
item.say("@Return when thy path is more focused.@");
|
||||
return;
|
||||
}
|
||||
else if ((karma >= 40) && (karma < 81))
|
||||
item.say("@Thou hast far to travel and much to achieve, but thy inner fire will surely guide thy way.@");
|
||||
else
|
||||
{
|
||||
item.say("@Thou hast far to travel and much to achieve.@*");
|
||||
item.say("@May the wisdom imparted here help purify thy inner flame.@");
|
||||
}
|
||||
|
||||
item.say("@What do you seek, Avatar?@");
|
||||
options = ["Codex", "bye"];
|
||||
}
|
||||
else if (!gflags[FINAL_QUEST_GIVEN] && gflags[MET_ALTAR_SINGULARITY])
|
||||
{
|
||||
item.say("@Hast thou completed thy journey to the catacombs?@");
|
||||
if (askYesNo())
|
||||
{
|
||||
item.say("@What is the Mantra of Singularity?@");
|
||||
if (gflags[LEARNED_MANTRA_CONTROL] && gflags[LEARNED_MANTRA_PASSION] && gflags[LEARNED_MANTRA_DILIGENCE])
|
||||
{
|
||||
var mantra_options = chooseFromMenu(["un-us-or", "us-un-or", "un-or-us", "us-or-un", "or-us-un", "or-un-us"]);
|
||||
if (mantra_options == "un-or-us")
|
||||
{
|
||||
item.say("@Let the principle of control guide thy quest.@*");
|
||||
item.say("@Let the principle of passion drive thy quest.@*");
|
||||
item.say("@Let the principle of diligence maintain thy quest.@*");
|
||||
item.say("@Then wilt thou truly achieve the unified spirit and singularity of purpose that is necessary for success in all endeavors.@*");
|
||||
item.say("@This is the gargoyle way, let it be thy way as well.@*");
|
||||
item.say("The altar glows with a cold blue flame. You feel compelled to seek out the Codex.*");
|
||||
item.say("Your final quest has begun!");
|
||||
addKarma(10);
|
||||
gflags[FINAL_QUEST_GIVEN] = true;
|
||||
UI_obj_sprite_effect(item, 7, 20, 20, 0, 0, 0, -1);
|
||||
UI_play_music(34, 0);
|
||||
return;
|
||||
}
|
||||
else
|
||||
item.say("@You have not yet become familiar with the wisdom of the gargoyle race. Continue thy search.@");
|
||||
|
||||
}
|
||||
else //don't know, get the same answer
|
||||
{
|
||||
var mantras_known = ["I don't know"];
|
||||
if (gflags[LEARNED_MANTRA_CONTROL])
|
||||
mantras_known = mantras_known && "un";
|
||||
if (gflags[LEARNED_MANTRA_PASSION])
|
||||
mantras_known = mantras_known && "or";
|
||||
if (gflags[LEARNED_MANTRA_DILIGENCE])
|
||||
mantras_known = mantras_known && "us";
|
||||
var mantra_options = chooseFromMenu(mantras_known);
|
||||
|
||||
item.say("@You have not yet become familiar with the wisdom of the gargoyle race. Continue thy search.@");
|
||||
options = ["Control", "Passion", "Diligence", "bye"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
item.say("@Which catacomb dost thou seek?@");
|
||||
options = ["Control", "Passion", "Diligence", "bye"];
|
||||
|
||||
}
|
||||
|
||||
converse(options)
|
||||
{
|
||||
case "Codex"(remove):
|
||||
say("@Look deep inside thyself, Avatar, and answer this:@");
|
||||
say("@For whom dost thou truly seek the Codex?@*");
|
||||
var CodexChoice = chooseFromMenu(["humans", "gargoyles", "Lord British", "both races", "Draxinusom", "myself", "Beh Lem", "Naxalitor", "Bolesh", "Valkadesh"]);
|
||||
switch(CodexChoice)
|
||||
{
|
||||
case "both races":
|
||||
say("@Thy answer is wise.@*");
|
||||
say("@But how canst thou truly work for the good of a race whose ways thou dost not understand?@*");
|
||||
say("@Go thou into the Catacombs of Control, Passion and Diligence. In each wilt thou find the final resting place of the being who most exemplifies that principle.@");
|
||||
say("@Return when thou hast found these catacombs.@");
|
||||
|
||||
gflags[MET_ALTAR_SINGULARITY] = true; //Got right answer, "met" shrine
|
||||
add(["Control", "Passion", "Diligence"]);
|
||||
break;
|
||||
|
||||
case "humans":
|
||||
case "myself":
|
||||
case "Lord British":
|
||||
say("@Thy answer is foolish.@");
|
||||
say("@A journey made for selfish reasons can never be a sacred quest, regardless of its goal.@");
|
||||
break;
|
||||
|
||||
case "Valkadesh":
|
||||
case "Beh Lem":
|
||||
case "Naxalitor":
|
||||
case "Draxinusom":
|
||||
case "Bolesh":
|
||||
say("@Thy answer is foolish.@");
|
||||
say("@Thy compassion is acknowledged, but compassion is not the key to success.@");
|
||||
say("@The motive must be as one with the goal for a journey to become a sacred quest.@");
|
||||
break;
|
||||
|
||||
default:
|
||||
say("@Thy answer is foolish.@");
|
||||
say("@There is no nobility or honor in betraying one's own race for the sake of another.@");
|
||||
say("@Such a path can never be a sacred quest.@");
|
||||
}
|
||||
|
||||
|
||||
case "Control"(remove):
|
||||
say("@Control is one of the guiding principles of the gargoyle race.@");
|
||||
say("@Go thou into the Catacombs of Control, near the coast to the west of here.@");
|
||||
say("@There you will find the being who most exemplifies this principle.@");
|
||||
add("principles");
|
||||
|
||||
case "Passion"(remove):
|
||||
say("@Passion is one of the guiding principles of the gargoyle race.@");
|
||||
say("@Go thou into the Catacombs of Passion, near the coast to the east of here.@");
|
||||
say("@There you will find the being who most exemplifies this principle.@");
|
||||
add("principles");
|
||||
|
||||
case "Diligence"(remove):
|
||||
say("@Diligence is one of the guiding principles of the gargoyle race.@");
|
||||
say("@Go thou into the Catacombs of Diligence, near the coast to the south of here.@");
|
||||
say("@There you will find the being who most exemplifies this principle.@");
|
||||
add("principles");
|
||||
|
||||
case "principles"(remove):
|
||||
say("@The three principles of Control, Passion and Diligence form the basis of the gargoyle way of life.@");
|
||||
|
||||
|
||||
case "bye":
|
||||
say("The mystic voice falls silent, and you leave the altar.");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
146
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/baking.uc
Executable file
146
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/baking.uc
Executable file
@@ -0,0 +1,146 @@
|
||||
/* Egg used on baking hearths to cook dough that is placed upon it: Reimplemented to add in more dough recipes */
|
||||
void bakeBread object#(0x635)()
|
||||
{
|
||||
var dough;
|
||||
var dough_pos;
|
||||
var dough_frame;
|
||||
var hearth;
|
||||
var bread;
|
||||
var bread_frames;
|
||||
var bread_frame;
|
||||
var bread_name;
|
||||
var rand;
|
||||
|
||||
//added the bread frames here to make things easier
|
||||
enum bread_frames
|
||||
{
|
||||
FRAME_BREAD = 0,
|
||||
FRAME_ROLLS = 1,
|
||||
FRAME_BAGUETTE = 2,
|
||||
FRAME_BREAD_LONG = 2,
|
||||
FRAME_FRUITCAKE = 3,
|
||||
FRAME_CAKE = 4,
|
||||
FRAME_PIE = 5,
|
||||
FRAME_PASTRY = 6
|
||||
};
|
||||
enum dough_frames //used in baking.uc
|
||||
{
|
||||
FRAME_FLOUR = 0,
|
||||
FRAME_DOUGH_FLAT = 1, //this will now create a pastry when cooked in the oven
|
||||
FRAME_DOUGH_BALL = 2
|
||||
};
|
||||
|
||||
//egg called this function when dough was placed upon it
|
||||
if (event == EGG)
|
||||
{
|
||||
dough = UI_find_nearby(item, SHAPE_DOUGH, 0, 0);
|
||||
//Added: also checks that the dough isn't just raw flour (take that, you bastards)
|
||||
if (dough && UI_get_item_frame(dough) > 0)
|
||||
{
|
||||
//in 60 ticks, the dough itself will BakeBread in order to turn into bread
|
||||
script dough after 60 ticks { call bakeBread; }
|
||||
if (UI_get_random(2) == 1) randomPartyBark("@Do not overcook it!@");
|
||||
}
|
||||
}
|
||||
|
||||
//dough called function to turn into bread
|
||||
else if (event == SCRIPTED)
|
||||
{
|
||||
dough_pos = UI_get_object_position(item);
|
||||
hearth = UI_find_nearby(item, SHAPE_HEARTH, 2, 0);
|
||||
|
||||
//Who the hell wrote this?? Why not just check for the existence of a hearth?
|
||||
if(UI_get_array_size(hearth) > 0)
|
||||
{
|
||||
dough_frame = UI_get_item_frame(item);
|
||||
|
||||
UI_remove_item(item);
|
||||
bread = UI_create_new_object(SHAPE_FOOD);
|
||||
if (bread)
|
||||
{
|
||||
UI_set_item_flag(bread, TEMPORARY);
|
||||
|
||||
//This whole bit has been pulled apart and rewritten to support multiple kinds of bread
|
||||
|
||||
//Flat dough was used: this causes pastry to be born!
|
||||
if (dough_frame == FRAME_DOUGH_FLAT)
|
||||
{
|
||||
bread_frame = FRAME_PASTRY;
|
||||
bread_name = "pastry";
|
||||
}
|
||||
else if (dough_frame == FRAME_DOUGH_PIE)
|
||||
{
|
||||
bread_frame = FRAME_PIE;
|
||||
bread_name = "pie";
|
||||
}
|
||||
//Randomly decides between fruitcake and regular cake
|
||||
else if (dough_frame == FRAME_DOUGH_CAKE)
|
||||
{
|
||||
if (UI_get_random(3) == 1) bread_frame = FRAME_FRUITCAKE;
|
||||
else bread_frame = FRAME_CAKE;
|
||||
bread_name = "cake";
|
||||
}
|
||||
|
||||
//Ball dough was used: this makes some kind of regular bread
|
||||
//(weighted so that the small round loaves occur twice as often)
|
||||
else if (dough_frame == FRAME_DOUGH_BALL)
|
||||
{
|
||||
bread_name = "bread";
|
||||
rand = UI_get_random(4);
|
||||
|
||||
if (rand == 1) bread_frame = FRAME_BAGUETTE;
|
||||
else if (rand == 2) bread_frame = FRAME_ROLLS;
|
||||
else bread_frame = FRAME_BREAD;
|
||||
}
|
||||
|
||||
UI_set_item_frame(bread, bread_frame);
|
||||
|
||||
if (UI_update_last_created(dough_pos))
|
||||
{
|
||||
rand = UI_get_random(3);
|
||||
if (rand == 1) randomPartyBark("@I believe the " + bread_name + " is ready.@");
|
||||
else if (rand == 2) randomPartyBark("@Mmm... Smells good.@");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Reimplemented to offload doubleclick behaviour to BakeBread, since the silly sods who programmed it to start with duplicated the behaviour in two locations. */
|
||||
void Dough object#(0x658)()
|
||||
{
|
||||
var dough_frame;
|
||||
var target;
|
||||
var target_shape;
|
||||
var target_pos;
|
||||
|
||||
//this behaviour allows you to place bread upon a hearth without drag-dropping
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
dough_frame = UI_get_item_frame(item);
|
||||
if (UI_get_item_frame(item) > 0) //dough is not flour
|
||||
{
|
||||
target = UI_click_on_item();
|
||||
target_shape = UI_get_item_shape(target);
|
||||
if (target_shape == SHAPE_HEARTH)
|
||||
{
|
||||
if (UI_set_last_created(item))
|
||||
{
|
||||
target_pos = UI_get_object_position(target);
|
||||
//choose a random position somewhere along the hearth
|
||||
//tweaked to allow one more space for it...
|
||||
//...and then untweaked again, as it makes the dough too hard to see
|
||||
target_pos[X] = target_pos[X] - UI_die_roll(1, 2);
|
||||
target_pos[Z] = target_pos[Z] + 1;
|
||||
|
||||
//now place the dough there
|
||||
if (UI_update_last_created(target_pos))
|
||||
{
|
||||
script item after 60 ticks { call bakeBread; } //Changed to call BakeBread instead of Dough
|
||||
if (UI_get_random(2) == 1) randomPartyBark("@Do not overcook it!@");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
590
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/balloon.uc
Executable file
590
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/balloon.uc
Executable file
@@ -0,0 +1,590 @@
|
||||
|
||||
|
||||
|
||||
//used for balloon - renders party once the balloon has landed
|
||||
void renderParty object#() ()
|
||||
{
|
||||
UI_error_message("render party called");
|
||||
var party = UI_get_party_list();
|
||||
var balloon = UI_find_nearest(AVATAR, SHAPE_BALLOON, 31); //
|
||||
var npc;
|
||||
var warningLevel = UI_get_npc_id(BALLOON_DOG);
|
||||
|
||||
|
||||
//get barge Avatar is on then remove it
|
||||
var barge = UI_get_barge(AVATAR);
|
||||
UI_remove_item(barge);
|
||||
|
||||
//reworked for falling into the void.
|
||||
if (warningLevel > 2)
|
||||
{
|
||||
//kill Avatar
|
||||
UI_apply_damage(127, 127, ETHEREAL_DAMAGE, AVATAR);
|
||||
|
||||
//reset warning level
|
||||
UI_set_npc_id(BALLOON_DOG, 0);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
for (npc in party)
|
||||
{
|
||||
|
||||
UI_clear_item_flag(npc, DONT_RENDER);
|
||||
|
||||
}
|
||||
UI_clear_item_flag(AVATAR, DONT_RENDER);
|
||||
UI_clear_item_flag(AVATAR, POLYMORPH);
|
||||
|
||||
//re-center screen on the Avatar
|
||||
UI_center_view(AVATAR);
|
||||
|
||||
UI_set_item_frame(balloon, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//function that makes sure the Avatar doesn't fly off the gargoyle world too far...
|
||||
void checkVoid object#() ()
|
||||
{
|
||||
enum checkVoid_levels
|
||||
{
|
||||
CHECK_VOID = 1,
|
||||
CHECK_VOID2 = 2,
|
||||
BALLOON_SINKING = 3,
|
||||
LAND_BARGE = 4,
|
||||
ADD_BARGE = 5
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var warningLevel = UI_get_npc_id(BALLOON_DOG);
|
||||
var balloon = UI_find_nearby_avatar(SHAPE_NEW_BALLOON);
|
||||
//var balloon = UI_find_object(FIND_ON_SCREEN, SHAPE_NEW_BALLOON, QUALITY_ANY, FRAME_ANY);
|
||||
var barge = get_barge();
|
||||
|
||||
//if (balloon)
|
||||
// UI_error_message("Balloon found.");
|
||||
//else
|
||||
// UI_error_message("Balloon NOT found.");
|
||||
|
||||
//if (barge)
|
||||
// UI_error_message("Barge found.");
|
||||
//else
|
||||
// UI_error_message("Barge NOT found.");
|
||||
|
||||
//get current position and map
|
||||
var current_pos = UI_get_object_position(AVATAR);
|
||||
var currentX = current_pos[X];
|
||||
var currentY = current_pos[Y];
|
||||
var top_left = [0923, 0678, 0];
|
||||
var bottom_right = [2230, 2099, 0];
|
||||
var current_map = UI_get_map_num(AVATAR);
|
||||
|
||||
if (event == CHECK_VOID)
|
||||
{
|
||||
UI_error_message("Event CHECK_VOID is playing. Warning level is: " + warningLevel);
|
||||
|
||||
|
||||
if (warningLevel > 2) //have been warned several times already to go back to land
|
||||
{
|
||||
randomPartyBark("@The balloon is falling into the void!!@");
|
||||
UI_halt_scheduled(AVATAR);
|
||||
script AVATAR after 15 ticks
|
||||
{
|
||||
call checkVoid, BALLOON_SINKING;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//if map is not 3, do nothing
|
||||
if (current_map == 3)
|
||||
{
|
||||
if (currentX > top_left[X] && currentX < bottom_right[X] && currentY > top_left[Y] && currentY < bottom_right[Y]) //in bounds, do nothing
|
||||
UI_error_message("Balloon is in bounds of the gargoyle world");
|
||||
else
|
||||
{
|
||||
//balloon is out of bounds, give warning
|
||||
UI_error_message("Balloon OUT of bounds of the gargoyle world - warning level " + warningLevel);
|
||||
|
||||
//set ID level for balloon dog (holder for warning level)
|
||||
UI_set_npc_id(BALLOON_DOG, warningLevel + 1);
|
||||
|
||||
//give party warning
|
||||
randomPartySay("@We should probably turn back, it feels like the balloon is getting sucked into the void!@");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!gflags[BALLOON_IS_FLYING])
|
||||
{
|
||||
UI_error_message("Balloon is landed, call off the script");
|
||||
// UI_halt_scheduled(balloon);
|
||||
UI_set_npc_id(BALLOON_DOG, 0); // reset warning level
|
||||
}
|
||||
|
||||
script AVATAR after 30 ticks
|
||||
{
|
||||
call checkVoid, CHECK_VOID;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (event == CHECK_VOID2)
|
||||
{
|
||||
//randomPartyBark("@Event CHECK_VOID is playing@");
|
||||
UI_error_message("Event CHECK_VOID2 is playing");
|
||||
script AVATAR
|
||||
{
|
||||
call checkVoid, CHECK_VOID;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (event == LAND_BARGE)
|
||||
{
|
||||
var barge = UI_find_nearby(AVATAR, 961, 10, MASK_EGG); //hopefully find the barge before placing
|
||||
var party = UI_get_party_list();
|
||||
var quality = get_item_quality();
|
||||
var balloon = UI_find_nearest(AVATAR, SHAPE_BALLOON, 31); //
|
||||
|
||||
// Yes; so begin process of landing.
|
||||
// Flag 10 = 'on moving barge'
|
||||
barge->clear_item_flag(10);
|
||||
// Flag 26 = 'in motion'
|
||||
barge->clear_item_flag(26);
|
||||
|
||||
// Make barge descent until the ground.
|
||||
// Flag 10 = 'on moving barge'
|
||||
balloon->clear_item_flag(10);
|
||||
|
||||
// Flag 26 = 'in motion'
|
||||
balloon->clear_item_flag(26);
|
||||
|
||||
// Make barge descent until the ground.
|
||||
script barge
|
||||
{
|
||||
repeat 10
|
||||
{
|
||||
descent;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
script balloon
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
descent; //should lift item on z level 8
|
||||
};
|
||||
wait 3;
|
||||
|
||||
}
|
||||
|
||||
|
||||
script AVATAR
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
descent; //should lift item on z level 9
|
||||
};
|
||||
}
|
||||
|
||||
for (npc in party)
|
||||
{
|
||||
script npc
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
descent; //should lift item on z level 9
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UI_remove_item(barge);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (event == BALLOON_SINKING)
|
||||
{
|
||||
UI_error_message("Event BALLOON_SINKING called");
|
||||
const int SHAPE_BALLOON = 1201;
|
||||
var barge = get_barge();
|
||||
var party = UI_get_party_list();
|
||||
var balloon = UI_find_nearest(AVATAR, SHAPE_BALLOON, 31); //
|
||||
//var newballoon = UI_find_object(FIND_ON_SCREEN, SHAPE_NEW_BALLOON, QUALITY_ANY, FRAME_ANY);
|
||||
var newballoon = UI_find_object(FIND_ON_SCREEN, 1232, QUALITY_ANY, FRAME_ANY); //test
|
||||
var quality = UI_get_item_quality(item);
|
||||
var basket_pos = UI_get_object_position(item);
|
||||
|
||||
|
||||
if (item)
|
||||
UI_error_message("Balloon in BALLOON_SINKING event found");
|
||||
else
|
||||
UI_error_message("Balloon in BALLOON_SINKING event NOT found");
|
||||
|
||||
|
||||
|
||||
//UI_set_item_flag(AVATAR, BG_DONT_MOVE);
|
||||
|
||||
// Flag 10 = 'on moving barge'
|
||||
barge->clear_item_flag(10);
|
||||
|
||||
// Flag 26 = 'in motion'
|
||||
barge->clear_item_flag(26);
|
||||
|
||||
// Make carpet descent until the ground.
|
||||
// Flag 10 = 'on moving barge'
|
||||
item->clear_item_flag(10);
|
||||
|
||||
// Flag 26 = 'in motion'
|
||||
item->clear_item_flag(26);
|
||||
|
||||
// Flag 10 = 'on moving barge'
|
||||
AVATAR->clear_item_flag(10);
|
||||
|
||||
// Flag 26 = 'in motion'
|
||||
AVATAR->clear_item_flag(26);
|
||||
UI_clear_item_flag(AVATAR, SAILOR);
|
||||
|
||||
//sound effect
|
||||
UI_play_sound_effect(89);
|
||||
|
||||
//cut the music
|
||||
UI_play_music(255);
|
||||
|
||||
//may not be necessary:
|
||||
// UI_halt_scheduled(AVATAR);
|
||||
|
||||
script balloon //changed from balloon
|
||||
{
|
||||
|
||||
repeat 9
|
||||
{
|
||||
descent; //should lift item on z level 9
|
||||
};
|
||||
wait 5;
|
||||
|
||||
|
||||
}
|
||||
script barge after 20 ticks
|
||||
{
|
||||
call renderParty;
|
||||
|
||||
|
||||
}
|
||||
|
||||
script AVATAR
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
descent; //should lift item on z level 9
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (npc in party)
|
||||
{
|
||||
script npc
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
descent; //should lift item on z level 9
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//remove balloon
|
||||
//UI_remove_item(item);
|
||||
|
||||
gflags[BALLOON_IS_FLYING] = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void AddBarge object#() ()
|
||||
{
|
||||
|
||||
var party = UI_get_party_list();
|
||||
var basket_pos = UI_get_object_position(item);
|
||||
var quality = get_item_quality();
|
||||
var balloon = UI_find_nearest(AVATAR, SHAPE_BALLOON, 31); //
|
||||
|
||||
UI_create_barge_object(6, 6, NORTH);
|
||||
UI_update_last_created([basket_pos]);
|
||||
|
||||
UI_set_item_flag(AVATAR, SAILOR);
|
||||
UI_set_item_flag(AVATAR, ON_MOVING_BARGE);
|
||||
UI_set_item_flag(AVATAR, IN_MOTION);
|
||||
|
||||
script item
|
||||
{
|
||||
rise; //should lift item on z level 9
|
||||
};
|
||||
|
||||
UI_set_item_shape(item, SHAPE_NEW_BALLOON); //so the Avatar can double click the new shape to descend
|
||||
|
||||
//balloon is in the air, set flag
|
||||
gflags[BALLOON_IS_FLYING] = true;
|
||||
|
||||
//calls checkVoid event
|
||||
item->checkVoid();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void balloon shape#(1201) ()
|
||||
{
|
||||
|
||||
var barge = get_barge();
|
||||
var party = UI_get_party_list();
|
||||
var balloon = UI_find_nearest(AVATAR, SHAPE_BALLOON, 31); //
|
||||
var quality = UI_get_item_quality(item);
|
||||
var basket_pos = UI_get_object_position(item);
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_error_message("Balloon event called from Doubleclick from new_balloon.uc");
|
||||
if (UI_get_item_frame(item) == 0) //Balloon is freshly placed and ready to ride
|
||||
{
|
||||
var barge = UI_find_nearby(basket_pos, 961, 10, MASK_EGG); //hopefully find the barge before placing
|
||||
|
||||
if ((UI_get_container(item) == 0)) //checks if on the ground and not in container
|
||||
{
|
||||
if (!UI_is_pc_inside()) //checks if no roof above
|
||||
{
|
||||
if (!UI_find_nearby(basket_pos, 961, 10, MASK_EGG)) //will create barge if one not found
|
||||
{
|
||||
UI_create_barge_object(8, 8, NORTH); //changed from 7x7
|
||||
UI_update_last_created([basket_pos]);
|
||||
|
||||
}
|
||||
|
||||
if (UI_on_barge()) //everyone should be on barge
|
||||
{
|
||||
var barge = UI_find_nearby(basket_pos, 961, 10, MASK_EGG); //hopefully find the barge before placing
|
||||
|
||||
UI_remove_item(barge); //removes barge to create new one at proper z level
|
||||
UI_set_polymorph(AVATAR, 639); //death vortex
|
||||
|
||||
//attempt to put Avatar in the middle of the barge
|
||||
UI_si_path_run_usecode(AVATAR, [basket_pos[X] -1, basket_pos[Y] -1]);
|
||||
|
||||
|
||||
|
||||
script item
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
rise; //should lift item on z level 8
|
||||
//add sfx
|
||||
//sfx
|
||||
};
|
||||
|
||||
wait 3;
|
||||
call AddBarge;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
script AVATAR
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
rise; //should lift item on z level 9
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
for (npc in party)
|
||||
{
|
||||
script npc
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
rise; //should lift item on z level 9
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
UI_set_item_flag(npc, DONT_RENDER);
|
||||
UI_clear_item_flag(AVATAR, DONT_RENDER);
|
||||
|
||||
|
||||
}
|
||||
//carpet theme
|
||||
UI_play_music(25);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}//on barge
|
||||
else
|
||||
{ //UI_si_path_run_usecode(actor npc, int pos[], int event, object obj, function fun, bool flag)
|
||||
UI_si_path_run_usecode(AVATAR, [basket_pos[X] -1, basket_pos[Y] -1], DOUBLECLICK, item, balloon, false);
|
||||
//AVATAR->path_run_usecode([basket_pos[X] -1, basket_pos[Y] -1], balloon, item, DOUBLECLICK, false);
|
||||
UI_error_message("Avatar should walk to balloon and call doubldlick");
|
||||
for (npc in party)
|
||||
{
|
||||
UI_error_message("Attempting to move " + npc);
|
||||
|
||||
UI_si_path_run_usecode(npc, [basket_pos[X] -1, basket_pos[Y] -1], SCRIPTED, item, balloon, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else randomPartyBark("@The balloon can't be used here.@");
|
||||
}
|
||||
else randomPartyBark("@Place it on the ground first..@");
|
||||
|
||||
}
|
||||
else //packing the balloon
|
||||
{
|
||||
UI_set_item_frame(item, 0); //to make sure the packed balloon renders
|
||||
|
||||
var item_frame = UI_get_item_frame(item);
|
||||
//var location = UI_get_object_position(item);
|
||||
UI_set_item_shape(item, SHAPE_PACKED_BALLOON); //landed, packed balloon
|
||||
UI_set_item_frame(item, 0); //to correct the frame
|
||||
|
||||
|
||||
//UI_move_object(item, location, false);
|
||||
|
||||
var item_shape = UI_get_item_shape(item);
|
||||
UI_error_message("Balloon should be packed. Item frame is " + item_frame + " and item shape is now: " + item_shape);
|
||||
}
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
if (event == SCRIPTED)
|
||||
{
|
||||
|
||||
//balloon should not be in the air
|
||||
if (!gflags[BALLOON_IS_FLYING])
|
||||
{
|
||||
|
||||
|
||||
UI_error_message("Balloon event called from Scripted from new_balloon.uc");
|
||||
if (UI_on_barge()) //should wait til everyone is on barge before running the script
|
||||
{
|
||||
|
||||
script item
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
rise; //should lift item on z level 8
|
||||
//add sfx
|
||||
//sfx
|
||||
};
|
||||
|
||||
wait 3;
|
||||
call AddBarge;
|
||||
|
||||
}
|
||||
|
||||
script AVATAR
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
rise; //should lift item on z level 9
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
for (npc in party)
|
||||
{
|
||||
script npc
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
rise; //should lift item on z level 9
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
UI_set_item_flag(npc, DONT_RENDER);
|
||||
UI_clear_item_flag(AVATAR, DONT_RENDER);
|
||||
UI_set_polymorph(AVATAR, 639); //death vortex
|
||||
|
||||
}
|
||||
|
||||
//carpet theme
|
||||
UI_play_music(25);
|
||||
UI_error_message("Scripted event called on balloon");
|
||||
}
|
||||
}
|
||||
else //balloon is in the air, call the scripted function to determine if close to gargoyle island
|
||||
{
|
||||
|
||||
|
||||
if (!gflags[BALLOON_IS_FLYING])
|
||||
{
|
||||
UI_error_message("Balloon is landed, call off the script");
|
||||
UI_halt_scheduled(AVATAR);
|
||||
UI_set_npc_id(BALLOON_DOG, 0); // reset warning level
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
514
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/book.uc
Executable file
514
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/book.uc
Executable file
@@ -0,0 +1,514 @@
|
||||
void showBook2 ()
|
||||
{
|
||||
var SOUND_BOOK = 14;
|
||||
|
||||
//Play book sound:
|
||||
UI_play_sound_effect2(SOUND_BOOK, item);
|
||||
|
||||
|
||||
//Start book mode for current item:
|
||||
book_mode();
|
||||
|
||||
}
|
||||
|
||||
/***************
|
||||
* The list of in game books:
|
||||
|
||||
Quality/Title/(Writer/note):
|
||||
0 - Morgan's Guide to Unifinished Novels (by Morgan) --- Unifinished is spelled like that in-game. - REPLACED W/ U6 BOOK
|
||||
1 - "How Death Affects Those Who Work Around It With Regularity" - REPLACED W/ U6 BOOK
|
||||
2 - My Notebook (by Alagner) - REPLACED W/ U6 BOOK
|
||||
3 - Observations of Black Rock (by Rudyom The Mage) - REPLACED W/ U6 BOOK
|
||||
4 - Stranger in a Strange Land (by Robert Heinlein)
|
||||
5 - Chitty-Chitty-Bang-Bang (by Ian Fleming)
|
||||
6 - The Wizard of Oz (by Frank L. Baum)
|
||||
7 - Hubert's Hair-Raising Adventure (by Bill Peet)
|
||||
8 - Records of the High Court of Yew - REPLACED W/ U6 BOOK
|
||||
9 - Morfin of Paws, Ledger of Venom Sales - REPLACED W/ U6 BOOK
|
||||
10 - Ultima: The Avatar Adventures (by Rusel DeMaria and Caroline Spector) REPLACED W/ U6 BOOK
|
||||
11 - Everything An Avatar Should Know About Sex: --- Empty book, hahaha
|
||||
12 - Encyclopedia Britannia (Volume I. A - E.)
|
||||
13 - Encyclopedia Britannia (Volume II. F - L.)
|
||||
14 - Encyclopedia Britannia (Volume III. M - P.)
|
||||
15 - Encyclopedia Britannia (Volume IV. Q - U.)
|
||||
16 - Encyclopedia Britannia (Volume V. V - Z.)
|
||||
17 - Key to the Black Gate. --- Joke, supposedly a hint book - REPLACED W/ U6 BOOK
|
||||
18 - Collected Plays (by Raymundo) - REPLACED W/ U6 BOOK
|
||||
19 - No Time to Dance (by B.A. Morler.)
|
||||
20 - The Silence of Chastity (by I.M. Munk.)
|
||||
21 - Murder by Mongbat (by J. Dial.)
|
||||
22 - Dolphin in the Dunes (by Pietre Hueman.)
|
||||
23 - Mandibles (by Peter Munchley.)
|
||||
24 - The Book of the Fellowship (by Batlin of Britain.) - REPLACED W/ U6 BOOK
|
||||
25 - Lord British - The biography of Britannia's longtime ruler (by K.Bennos)
|
||||
26 - Gargoyle Like Me (by Darok.) - REPLACED W/ U6 BOOK
|
||||
27 - To be or not to be (by Wislem.)
|
||||
28 - Book of Prophecy (by Naxatilor the Seer)
|
||||
29 - The Book of Forgotten Mantras.
|
||||
30 - Struck Commander (by Gilberto) //REPLACED W/U6 BOOK
|
||||
31 - Gone With The Wisp (by Margareta Mitchellino.)
|
||||
32 - Karenna's Workout (by Karenna.)
|
||||
33 - Karenna's Pregnancy Workout (by Karenna.)
|
||||
34 - Karenna's Total Body Workout (by Karenna.)
|
||||
35 - The Five Stages of Lawn Care (by A.P. Berk.)
|
||||
36 - And Then There Was Karen... (by B. MacDae)
|
||||
37 - The Intrinsic Complexities of Investigating a new Species of Flora in the Land of Britannia (by Perrin)
|
||||
38 - Ringworld (by Larry Niven)
|
||||
39 - The Apothecary's Desk Reference (by Fetoau)
|
||||
40 - Magic and the Art of Horse-and-Wagon Maintenance
|
||||
41 - Jesse's Book of Performance Art (by Jesse.)
|
||||
42 - The Write Stuff (by Perrin)
|
||||
43 - That Beer Needs a Head on It! (by Yongi)
|
||||
44 - The Provisioner's Guide to Useful Equipment (by Dell)
|
||||
45 - The Accedens of Armoury (by Legh)
|
||||
46 - The Bioparaphysics of the Healing Arts (by Lady Leigh)
|
||||
47 - What Color is Thy Blade? (by Menion)
|
||||
48 - The Blacksmith's Handbook (by Christopher)
|
||||
49 - Thirteen Months in a Year (by Euralyn)
|
||||
50 - The Day it Didn't Work (by R. Allen G.)
|
||||
51 - No One Leaves (by R. Allen G.)
|
||||
52 - A Complete Guide to Britannian Minerals, Precious, and Semi-Precious Stones (by B. Ledbetter)
|
||||
53 - Trees, and then Some! (by Ben)
|
||||
54 - Bloodied Blades and Buxom Beauties (A.G. Fishmor)
|
||||
55 - The Hundred and Eleven Year, Three-Month, Seven-Day War (by Perrin)
|
||||
56 - Black Moon, Red Day (by Euralyn)
|
||||
57 - Two in the Fold (by Morian)
|
||||
58 - The Forest of Yew (by Taylor)
|
||||
59 - This Olde Ship (by Owen of Minoc)
|
||||
60 - The Carver Chronicles (by Morfin)
|
||||
61 - Hero Fertilizer (by Werdron)
|
||||
62 - What could be left but the Ashes (by N. Flaims)
|
||||
63 - The Summer of my Satisfaction (by Plexes)
|
||||
64 - Hither Comes The Rain (by Perrin)
|
||||
65 - White Rain (by Perrin)
|
||||
66 - Milord Conduct (by Aleina)
|
||||
67 - To The Death! (by Zaksam)
|
||||
68 - Blade of the Gryphon Barony (by Pebrogdy)
|
||||
69 - The Winning Number (by A.P. Berk)
|
||||
70 - The Scent of Valor (by Wetterson)
|
||||
71 - How The West Was (by Yuclydia)
|
||||
72 - Thy Message Received! (by For-Lem. Translated by Jillian)
|
||||
73 - Ribald Encounters (by Madden)
|
||||
74 - The Knight and the Thief (by Hobbs)
|
||||
75 - The Trio (by Leepeartson)
|
||||
76 - The Black Compendium (Written by Mondain, with annotations by the enchantress Minax and magical formulae by the hellspawn Exodus.)
|
||||
77 - No Way to Jump (by Desmonth)
|
||||
78 - Stealing the Wind (by Brianna)
|
||||
79 - Brommer's Flora (by Brommer)
|
||||
80 - Brommer's Fauna (by Brommer)
|
||||
81 - Brommer's Britannia (by Brommer) --- Shows a world map upon use
|
||||
82 - Up is Out (by Goodefellow)
|
||||
83 - Weaving (by Carlyn)
|
||||
84 - Follow the Stars (by Laurnen)
|
||||
85 - How to Conquer the World in Three Easy Steps (by Maximillian the Amazingly Mean)
|
||||
86 - Tren I, II, III, IV, . . . XVII
|
||||
87 - Sir Kilroy (Anonymous)
|
||||
88 - My Cup Runneth Over (by Marseine)
|
||||
89 - Spring Planting, Autumn Harvest
|
||||
90 - Shoot the Moon (by Oswauld)
|
||||
91 - Outpost (by Gasreth)
|
||||
92 - Landships (by Equinestra)
|
||||
93 - Landships of War (by Equinestra)
|
||||
94 - Why Good Mages Like Black Magic (by Magus)
|
||||
95 - When Starts The Adventure (by Sabra)
|
||||
96 - What a Fool Believes (by P. Nolan)
|
||||
97 - The Complete History of the Lute (by Devonaillion, with foreword by the Master Bard, Iolo)
|
||||
98 - Birds of Britannia (by Brother Wayne)
|
||||
99 - I am not a Dragon (by Thomson)
|
||||
100 - The Dragon Compendium (by Perrin)
|
||||
101 - The Journal of Garret Moore --- Found on Ambrosia
|
||||
102 - The Transitive Vampire, by Karen Elizabeth Gordon
|
||||
103 - The Tome of the Dead (by Suvol Shadowface)
|
||||
104 - Artifacts of Darkness (by Mordra Morgaelin)
|
||||
105 - The Light Until Dawn (by Drennal)
|
||||
106 - Codavar (by Nexa)
|
||||
107 - Ritual Magic (by Nicodemus)
|
||||
108 - Pathways of Planar Travel (by Nicodemus)
|
||||
109 - Enchanting Items for Household Use (by Nicodemus)
|
||||
110 - Miscellaneous Cantrips (Anonymous)
|
||||
111 - Modern Necromancy (by Horance)
|
||||
112 - The Symbology of Runes (by Smidgeon the Green)
|
||||
113 - The Bunk and Stool (Register)
|
||||
114 - The Modest Damsel (Register)
|
||||
115 - The Checquered Cork (Register)
|
||||
116 - The Honorable Hound (Register)
|
||||
117 - The Out'N'Inn (Register)
|
||||
118 - The Wayfarerer's Inn (Register)
|
||||
119 - The Fallen Virgin (Register)
|
||||
120 - Britannian Mining Company --- Mining log
|
||||
121 - The Salty Dog (Register)
|
||||
122 - A Guide to Childcare for the Rich and Famous (by Lady M)
|
||||
123 - Alagner's Book of Marvelous and Astonishing Things (by Alagner)
|
||||
124 - Baths - Profits --- Ledger
|
||||
125 - The History of Stonegate (by Shazle)
|
||||
126 - The Way of the Swallow (by Foiles)
|
||||
127 - Vetrons Guide to Weapons and Armour (Their effectiveness and value)
|
||||
128 - Vargaz's Stories of Legend (Reasons why one should never build doors facing north or west. --- Hahahahaha
|
||||
129 - One Hundred and One Ways to Cheat at Nim (by Dr. Cat)
|
||||
130 - Play Directing: Analysis, Communication and Style (by Francis Hodge)
|
||||
131 - On Acting (by Laurence Olivier)
|
||||
132 - Thou Art What Thee Eats (by Fordras)
|
||||
133 - Man Versus Fish: The Ultimate Conflict (by Aquastyr)
|
||||
134 - Knight's Bridge in a Nutshell (by Nicodemus)
|
||||
135 - Mempto Rays (A qualitative study in metaparaphilosophical radiation - by Mempto)
|
||||
136 - The Book of Circles (Translated from Gargish to Britannian by Jillian)
|
||||
137 - Chicken Raising (by Daheness Gon)
|
||||
138 - The Art of Field Dressing (by Creston - Forward by Lady Leigh)
|
||||
139 - Water on the Cat (by Mowze)
|
||||
140 - A Short Treatise on Britannian Society (by Clayton)
|
||||
141 - A Baker's Handbook (by Settlar)
|
||||
142 - Logbook (Astelleron) --- Isle of Fire, test of love
|
||||
143 - Golems: From Clay to Stone (by Castadon)
|
||||
144 - The Stone of Castambre (by MacCuth)
|
||||
145 - --- second part of 144
|
||||
146 - The Dark Core of Exodus (by Erethian)
|
||||
147 - Ethical Hedonism (by R. Allen G.)
|
||||
148 - Converting Moongates to Thine Own Use (by Erethian)
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void original_book shape#(642) ()
|
||||
{
|
||||
var player_name = getAvatarName();
|
||||
var qual = UI_get_item_quality(item);
|
||||
var msg;
|
||||
var sound;
|
||||
|
||||
// using * is new page.
|
||||
// using ~ is a line break.
|
||||
// 31/32 chars each line?
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
// * denotes page break
|
||||
// ~ equals 'enter' for new line
|
||||
// 18 lines per page
|
||||
|
||||
if (qual == 1)
|
||||
{
|
||||
showBook();
|
||||
|
||||
say("~~ ~~Captain's log - The Empire~~");
|
||||
|
||||
say("~~by Ventara~~*");
|
||||
|
||||
say("~~Day 1-~~ I, Ventara, now Captain of the Empire in the post-Hawkins era, set sail with a new crew in search of Hawkins' treasure without the aid of the complete map. The others have retired, and will ne'er expect that I'll keep looking! I'll keep it all to meself!*");
|
||||
|
||||
say("~~Day 10 ~~ The crew be still in good spirits. My former shipmates proberly don't even know I slipped out o' the 'Den yet with the Empire, too drunk in celebration over Hawkins' demise. I be too calculating for them scumbags. The blood o' Hawkins didn't even dry on the timbers of the Empire before I plotted my next move!*");
|
||||
|
||||
say("~~Day 14 ~~ Narrowly evaded the Royal Navy. The Empire still be a grand vessel, and with Ventara as Captain, we'll ne'er be caught. Will stop soon on a nearby island to patch a hole from the cannonball that grazed the ship. Blasted Lord British and his Navy!*");
|
||||
|
||||
say("~~Day 23 ~~ After a few false leads, I am confident that this next island be the one that Hawkins buried his swag. We'll reach it by sundown. The crew eagerly awaits the treasure... the greedy bastards.*");
|
||||
|
||||
say("~~Day 24 ~~ So I was wrong. No treasure here. Slight miscalculation, blasted sextant! Damn Hawkins' wretched soul!*");
|
||||
|
||||
say("~~Day 30 ~~ They were eying me again today. Those rats don't think I know, but I know. 'Twas the same look we gave Hawkins before we gutted him. But they'll not get Captain Ventara, oh no. I knows their plots. The promise of treasure will only negate their bloodlust for so long, but I feel I am close to the treasure...*");
|
||||
|
||||
say("~~Day 33 ~~ Sent me first mate to a watery grave as an example to anyone thinking any idears. I'll not share my treasure with these dogs. I will use them long enough to get to the location where the treasure is buried. I believe I can lose them along the way, I'll remember where our traps were set. I'll retire a very rich man.*");
|
||||
|
||||
say("~~Day 45 ~~ Damn the storms.. visibility is low. The past several days the waters have been rough due to the earthquakes. The crew begs me to abandon the expedition. I'll have none o'that! They'll not keep me from the treasure! Through the storm, I can see the monolith that marks the spot! This is it!*");
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 2)
|
||||
{
|
||||
|
||||
showBook();
|
||||
|
||||
say("~~ A CITY DWELLER GUIDE TO THE COUNTRYSIDE ~~ ",
|
||||
|
||||
"~~by LaFey~~~~*");
|
||||
|
||||
say("~~ Within this volume the author, an inhabitant of Britain, describes his countryside strolls with particular emphasis on the inns, taprooms and patrons therein.~~~");
|
||||
|
||||
say("...and when I reached Paws the light was already fading and a cold breeze was blowing from the east. The quaint village inn beckoned me inside invitingly. It was only a matter of wiping my dusty boots and before long I sat with the local folk, sipping from ceramic mugs and discussing threads, fabrics or local gossip. The ale was sufferable and the cost a trifle. After I had opened my pouch to buy a third round the conversation shifted from the affairs of weavers to the affairs of the court...");
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 3)
|
||||
{
|
||||
|
||||
showBook();
|
||||
|
||||
|
||||
say("~~ DAEMON DREAM ~~ ",
|
||||
|
||||
"~~by Dom~~~~*");
|
||||
|
||||
say("~~Once I spent some time far away in the north. A legendary country in which the ancient druids are said to have celebrated their secret rites. But these dark ages are long gone, as I thought. I stayed with some old friends of the family in a small town. At this time I didn´t feel too well. The world didn´t seem very attractive to me. In my sleep my dreams were troublesome and when I was awake I didn´t feel in tune with the flow of everyday life. At daytime I longed for a dreamful night and at night I dreaded the coming long cruel day. So I decided to take some time and as you will read the events proved me right.~");
|
||||
|
||||
say("As I had nothing else to do I often went for long walks exploring the country. One day I strolled through the woods though I knew better as the villagers had repeatedly warned me against it. They claimed that the forest was haunted. Strange lights and noises have been seen and heard. Inhuman creatures were said to live there. The stories of inexplicable things happening were plenty. But I sneered at all this superstitious nonsense. We live in a modern age so why heed such foolish warnings. At least I thought them foolish.~~");
|
||||
|
||||
say("After hours of nature´s beauty I came upon an odd circular clearing where everything seemed peaceful and quiet. It was a nice day and I was a little exhausted so I decided to rest some time. I lay down in the opening and the afternoon sun. It didn´t take me long and my eyelids felt heavy and I couldn´t stay awake anymore. Before I was lost in a dreamless sleep it briefly struck me that the clearing lay in a perfect ring of odd-shaped stones and toadstools. But then my thoughts were already too confused to make anything of it...~~");
|
||||
|
||||
say("Hours later I woke up and it was already dark. I looked up at the sky. The moon was full. I began to feel uncomfortable as I had to think about the superstitious locals who´d told me repeatedly that strange things used to happen in these so-called mystical woods. Then I remembered that I was standing in a circle of stones and toadstools and isn´t there a story to those rings? I decided that it was high time to take a fast exit and get out of this forest. But as soon as I got near the edge of the circle the stones emitted a strange green light and I could hear a faint chanting. I had to slap myself to see if I was by chance still asleep and only dreaming, but the pain only stung and the light just shone brighter.~~");
|
||||
|
||||
say("Suddenly, there were small dark spots in the light which drew closer to me. I could make out that these were some kind of creatures which looked like faerïes. Faerïes??!! You know, very small naked people with wings who are often mentioned in old tales, songs and legends. I always thought they were just that - legends. Obviously they were real - or me just a nutcase. They flew gracefully around me and I overheard them speaking about me in their delicate thin voices. I was astonished and just stood there watching these beautiful entities.~~");
|
||||
|
||||
say("They then disappeared, all but one. She was obviously a female specimen and quite a beauty. She seemed slightly bigger as the others and she had an air about her that demanded unshared attention. She hovered on eye-level with me and began to speak :~~");
|
||||
|
||||
say("@Human fool! How dare you intrude our peaceful forest? Aren´t you satisfied destroying the world outside? Must you bring your human destructiveness even here? Are you willing to take this place as well?@~~");
|
||||
|
||||
say("@I ... I didn´t mean to disturb you and I regret deeply what my people did to our home. In trying to escape and to find a little peace I came here. I humbly apologize my intruding. There was no ill intended.@ I replied.~~");
|
||||
|
||||
say("@Mortal, I know you very well and this was just a little test. To see if you changed in these past ages.@~~");
|
||||
|
||||
say("@Now wait a minute! Do I have this right? You know me? Ages? May I ask you what you are talking about?@~~");
|
||||
|
||||
say("@Listen! Know that I´m the Queen of the faerïes and thus knew a long time ago that you would eventually be lead to this place again. In ancient times it was decided to grant you a wish if you are able to answer a simple question.@~~");
|
||||
|
||||
say("@Again?@ I questioned. @Never before in my life was I here. How do I deserve a wish? I´m no one special, just a ...@~~");
|
||||
|
||||
say("@You are far more. You always were. A friend of my people. In every life you helped us with your magic and now we are going to give you what your heart desires.@~~");
|
||||
|
||||
say("@Magic? I know nothing of magic and I certainly don´t believe in reincarnation ... But I also don´t believe in faerïes. and now I´m standing here in green light, arguing with the very Queen of the faerïes. It´s more probable that I drank to much in the tavern and I just dream this.@~~");
|
||||
|
||||
say("@´Tis no dream and let me assure you in former life, you were quite a magician. But now enough of this foolish talk. I know you, rest assured. Never could I mistake your bright burning light for someone else´s. Listen! I´ll ask you now a question that will change your life. Name the five elements ancient mages knew to master.@~~");
|
||||
|
||||
say("I answered, @That´s easy. It´s fire, water, earth. air and...@ A fifth element? I never before heard of another element. What the ... was she talking about anyway. Me a magician! Ha! Who was the crazy person here? What element...@ I thought.");
|
||||
|
||||
say("As I strenuously thought about magic and a fifth element something deep in me stirred. Ancient knowledge flooded my consciousness but it was gone before I could really grasp it. But I could then clearly see the truth in her words and most importantly, I knew the answer to her little quiz.~~");
|
||||
|
||||
say("@It´s ether!@, I exclaimed.~~");
|
||||
|
||||
say("@Congratulations@ said the faerie. @I had my doubts you could remember these very old lessons but you did it. Now, think of your deepest desire. Name it and your wish shall be granted.@~~");
|
||||
|
||||
say("@You know, I have this dream that haunts me. At first it was quite harmless but now it´s very disturbing and everybody I tell this dream thinks me mad. I will tell you the whole story. Years ago, in one of my dreams I came upon a big wall. The height of it you can´t even begin to imagine. I became curious what would lie behind this wall and I spent many a night looking for a way to the other side.@");
|
||||
|
||||
say("@One night dreaming I found a big, wooden, ancient-looking door. I was happy but that lasted only for a moment as I found the door locked. Desperation overwhelmed me. I hammered against it but naturally it wouldn´t budge. ´T was far too massive. I tried looking through the keyhole but all I could see was darkness. After this failure I tried to forget about that wall. But often in my dreams I found myself standing before this door trying to open it. So eventually I started looking for a key. Years passed in real life and in my dreams I kept on looking for the key. I found many but none ever fitted.@");
|
||||
|
||||
say("@Finally one day I discovered what I did wrong. I only searched in my dreams but wasn´t it possible that it´s actually a real, solid key? So I started to spend my waking hours searching as well. and at least I found it. Ironically it was in possession of my very family. My great-grandfather got it as an gift from a gypsy he saved from drowning. He passed it on to his son when he died and so did my grandfather. and when my father died I was the one to get it. The key was very old looking and solid gold and from the first moment I held it in my hand I knew it to be the very key. So the next night I went to bed with the key hanging around my neck. and in my dream I found myself still wearing it. What is there left to say. It did open the door. But after all these years I hesitated to step through it. Then with all my courage I did it. I took a deep breath and the last steps.@");
|
||||
|
||||
say("@And what joy. I seemed to be standing in another reality. It was like waking up, though it wasn´t the world I knew. The air smelled fresh of nature, strong scents of blossoming flowers and everything was green. I know this sounds stupid but you of all people should be able to understand it.@");
|
||||
|
||||
say("@There was no one in sight , at first. Then I saw a dark spot in the sky. It seemed to be moving and soon I recognized it to be a winged creature. But don´t think this being looked anything like you as when it drew nearer it frightenly looked more and more like a creature out of the Abyss. As big as me with black leathery wings. Her skin black as the night she looked as if she came straight from hell. Then she landed right before me and suddenly she didn´t frighten me anymore. Quite the opposite. She was gorgeous. This fallen angel. Love at first sight.@~~");
|
||||
|
||||
say("@She was a dark-dweller no use denying it but her beauty enchanted me. With an inhuman grace she came very close to me. Her red hair was in beautiful contrast to her black wings. She looked me straight in the eyes. Impossible to describe this pair. Their colour was purple with golden spots but that is really an insufficient description of their fineness. Without saying one word this She-devil kissed and embraced me.@");
|
||||
|
||||
say("@Our bodies unconsciously swayed to the shrill, faint piping of the oldest music, a rhythm of wind and water. A tune so very deep and intimate. I felt like I never felt before. I knew at once that with her I´m whole, complete. No one but her...@");
|
||||
|
||||
say("@And just as I thought this moment would last forever, the rooster crowed and I was forced through the ominous door and woke up. This is how it usually goes. In some dreams I can´t even find my way to the door but when I find it sooner or later meet her as well. I always have to wake up and the time with her always seems much too short, and there´s my wish. Let me sleep here protected by the stones and toadstools and never ever let me wake up again. I´d rather spend my life in this dream with my fair dark-dweller than here in this gray world in which everyday is just an endless struggle to survive.@~~");
|
||||
|
||||
say("After I finished telling the faerie of my reoccuring dreams, she responded:~~");
|
||||
|
||||
say("@You spoke like I expected you to. Thy wish shall be granted. Protected in this magic circle you´ll sleep eternally ´till Armageddon wipes everything away.@ She motioned me to lie down and as I did she made some gestures and chanted words I never herd before. Almost at once I was standing in front of the door to the mysterious land. Without hesitation I stepped through into a new life...");
|
||||
|
||||
}
|
||||
else if (qual == 8)
|
||||
{
|
||||
|
||||
showBook();
|
||||
|
||||
|
||||
say("~~THE ARCHER’S LAMENT ~~ ",
|
||||
|
||||
"~~by Fenwick the bard~~~~*");
|
||||
|
||||
say("~ Dear reader, sit and let me tell you a tale of a young ranger by the name of Larson, greatest hunter in a village long since forgotten by time. This man was betrothed to wed a young lass by the name of Sigourney and all was happy in his life… until invaders from beyond the Sea of Sand came and burned his village. Though Larson fought bravely, Sigourney was kidnapped and taken to the distant city of Goratesh.~*");
|
||||
|
||||
say(" Larson, being a brave sort, took up his bow and arrows and set out after his love. On his journey he saved Anisha, proud warrior princess of the Mesa Haran and sworn enemy of the men who came from the Sea of Sands. Through the great cities of the Hruntir Coast, down through the Belly of the Great Golem Aranoth and out past Gecko’s Marsh they adventured, saving village and town as they went until, finally, the Sea of Sand stretched before them.~~");
|
||||
|
||||
say(" 'If I cannot choose, then I shall have my arrow choose for me, as it is my skill with a bow that has saved one and impressed another.' Larson finally decided. 'I shall blindfold myself shoot an arrow into yonder grove of palm trees. Should the arrow hit a tree, I will marry Sigourney. If it misses, Anisha shall be my bride.'~~");
|
||||
|
||||
say(" With these words, both Sigourney and Anisha realized that the man they thought they loved was naught more than a woodsy dolt of a ranger and crept off while Larson was blindfolded. Both lived happy, fruitful lives while Larson went back to his village and grew old alone.~~");
|
||||
|
||||
say(" And the moral of this story, dear reader? When given a choice, never leave it up to fate, lest you lose it all through indecision...");
|
||||
}
|
||||
|
||||
else if (qual == 9)
|
||||
{
|
||||
showBook();
|
||||
|
||||
|
||||
say("~~LADY SILVERLEAVES ~~ ",
|
||||
|
||||
"~~by Keltias~~~~*");
|
||||
|
||||
say("~Oh fair Lady Silverleaves,");
|
||||
say("Thy heart didst belong among thine trees,");
|
||||
say("For ever and more thy spirit shall sing,");
|
||||
say("Among sandy shores and mossy things.~~");
|
||||
|
||||
say("In misty land by southern sea,");
|
||||
say("Of shrouded shadow, and mystery,");
|
||||
say("Thy example shone, thy virtues bright,");
|
||||
say("And banished back all forces of night.~~*");
|
||||
|
||||
say("Oh fair Lady Silverleaves,");
|
||||
say("Thy courage hath art, some few didst see,");
|
||||
say("Thou wispered them, of nature's need,");
|
||||
say("Thou shared thy secrets, and thy creed~~*");
|
||||
|
||||
say("As mountains solid, erode to sand,");
|
||||
say("Thy body rests, thy will yet stands");
|
||||
say("For we remember, even as we grieve,");
|
||||
say("We carry thy strength, fair Lady Silverleaves~");
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 10)
|
||||
{
|
||||
showBook();
|
||||
|
||||
say("~~My research on Windemere~~ ",
|
||||
|
||||
"~~by Brion the scribe~~~~*");
|
||||
|
||||
say("~ The isle of Windemere was a stronghold for the Oppression, long since abandoned. Upon the return of our liege Lord British, and the banishment of Blackthorn, Windemere proved to be a stubborn holdout of the Oppression.~~");
|
||||
say("~ The Royal Navy layed siege to the mountain stronghold for nearly a week, bombarding the place with cannon shot. Eventually the island stronghold fell and it's inhibants captured or slain. Rumors abound that Thrud and Elistaria hath sold their souls to Blackthorn and bound themselves to the stronghold and the Oppression.~~");
|
||||
say("~ My research hath brought me here to live amongst the ruins in search of their restless spirits to prove or disprove them...~");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
else if (qual == 17)
|
||||
{
|
||||
showBook();
|
||||
|
||||
say("~~The Empire ~~ ",
|
||||
|
||||
"~~by Captain Hawkins~~~~*");
|
||||
|
||||
say("~This book appears to be the log of a ship called 'The Empire.' The last entry speaks of the burying of a great treasure, and of the growing discontentment of the crew. There's a hastily scrawled note at the end, in different handwriting, that says 'Captain Hawkins won't be makin' no more log entries.'");
|
||||
|
||||
}
|
||||
|
||||
|
||||
else if (qual == 18)
|
||||
{
|
||||
|
||||
showBook();
|
||||
|
||||
|
||||
say("~~Gargopology Vol. 1 ~~ ",
|
||||
|
||||
"~~Study by Melinus~~~~*");
|
||||
|
||||
say("~Herein this tome are detailed sketches and diagrams of gargoyle skulls, both winged and wingless, and a compilation of what information was gleaned from them.");
|
||||
|
||||
say("~'..I noticed that winged gargoyles and unwinged gargoyles are probably different species. My recent studies regarding some gargoyle skulls obtained from felled corpses on the battlefields suggest some interesting features about them.~
|
||||
|
||||
Winged gargoyle skulls are extremely dolicocephalic and somewhat thin compared to their smaller unwinged counterparts and while this could have served to enhance their aerodinamicity, it also widened their cranial vault and subsequently their brain size.~
|
||||
|
||||
Unwinged gargoyle skulls are a lot more brachicephalic and with a thicker skull. Their mandibles are also a bit bigger compared to those of winged gargoyles and they've got 24 teeth (4 more than their relatives). Their nasal cavities are also bigger and this could mean they're more capable of perceiving odors. I've got no evidence to prove that these are olfactive cavities though as they may be a strange sort of ear.~
|
||||
|
||||
Sadly, I still haven't got enough gargoyle samples to know more about these fascinating species, as they have proved to be an extremely difficult foe. A future study of their costumes may be the key to a faithful reconstruction of their prehistory...'.");
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 24)
|
||||
{
|
||||
showBook();
|
||||
|
||||
say("~~Snilwit's Big Book of Boardgame Strategy ~~ ",
|
||||
|
||||
"~~ by Snilwit~~~~*");
|
||||
|
||||
say("~~Chess: Try to control the middle of the board with your knights, bishops and pawns. ~~* ");
|
||||
|
||||
say("~~Nine Men's Morris: Don't let any of your pieces get trapped in the corners. ~~*");
|
||||
|
||||
say("~~Draughts: Keep your pieces along the sides of the board, where they can't be captured.");
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 26)
|
||||
{
|
||||
if (!gflags[LEARNED_MANTRA_SPIRITUALITY])
|
||||
{
|
||||
gflags[LEARNED_MANTRA_SPIRITUALITY] = true;
|
||||
}
|
||||
showBook();
|
||||
say("~~The Book of Spirituality~~*");
|
||||
|
||||
say("~~In your travels through life, remember always that Spirituality embodies the sum of all virtues. Chant the mantra 'om' as you meditate on Spirituality, and all will become clear to you...~~");
|
||||
}
|
||||
|
||||
|
||||
else if (qual == 27) //Drudgeworth's manifesto
|
||||
{
|
||||
|
||||
showBook();
|
||||
say("~~Manifesto of Drudgeworth the Mad~~*");
|
||||
|
||||
say("~~ I awoke yesterday, lying face down in the sands upon a strange shore, feeling the waves lightly breaking over me up to my waist before gently receding. ~");
|
||||
say("~ I surveyed my personal self... My head pounded and I appeared to be quite bloody and battered... Aye surveyed my immediate surroundings and suddenly came to the realization that not only did I have no idea where I was; but I had no memory of the events that unfolded. My ship 'The Barnacle', I painfully observed, had been run completely aground into a rocky crag, utterly wrecked beyond repair! Too exhausted to do much other than drag myself out of the surf and sleep this night..*~");
|
||||
say("11/2/137 ~~ Aye rummaged through the wreck of the Barnacle today, I saw what became of me mates. We were barely two days sail out of Buccaneers Den, attempting to move along the northern coast of the mainland bearing due east.. On the eve of the second day we swiftly approached what looked to be an brightly lit unarmed merchant ship ripe for plundering. I gave the order to load the cannon's and approach 'er with all due caution... Instead we were taken quite by surprise as we were ambushed during the approach by no less than two well armed frigates! It was a ruse!~~");
|
||||
say("We never got off even a shot as we were boarded by the second frigate. During the ensuing fight that raged onboard I was knocked nearly unconscious.. I remember being thrown overboard.. Mine ship was lit afire and ultimately ran aground. Me Mates, the pur bastards, all died in the inferno.. I should 'ave died with em!! By Mondain's Skull; I shall avenge their deaths! This aye swear!~");
|
||||
say("The only things I found salvageable from the wreck were a rusty cutlass, plenty of charcoal from among the charred deck planking, a half filled jug of fresh water, and much to my surprise, this empty journal. My captain's log is charred almost beyond recognition. This coal seems to work well enough though to scrawl in this book... I said a final farewell to me mates and left the ship for the last time. All the food stores were lost in the wreck. I'd give mine right arm for a bottle of rum and a simple bit of food!*");
|
||||
say("11/16/137~~ Been wanderin for days in the swamp, found meself back to the wreck of the Barnacle. The bloated bodies of me shipmates are still here... Gulls pecking at their eyeballs! A revolting sight to be sure. Sorry lads, I never thought it would come to this, but I had to have somethin to eat...");
|
||||
say("11/24/137~~ Headed west from the shipwreck, reached the midpoint of the plains today as near as I can tell. The plains be terrifying at night.. I saw a foul spectre that did wail at me as it floated by! I struck at it several times with mine cutlass, yet it did not fall!~ The full moon is high in the sky and I hear what sounds to be a thousand swordsmen all fighting some terrible battle all around me. Hideous guttural sounds of animals dying and the tortured screams of hundreds of men; the likes of which I've ne'er heard in all mine life. Yet peering through the thick haze I see absolutely nothing! The ground under mine feet is now literally running with blood.. this cannot be happening.. I must be going mad!!");
|
||||
say("12/20/137~~ Today I woke up in a bed, with no recollection of how I got here.. my journal on the stand with a fresh inkwell and quill, a blank page dated with today's date. My cutlass hath gone missing. Several other beds nearby with patients. I must have been rescued by someone or something in my sickness whilst in the swamps. I've been unconscious for the better part of a month if this date is to be believed! My strength is slowly coming back to me and my wounds are healing, I will have to leave here soon...*");
|
||||
say("12/24/137~~Fortunately I recorded the disasters that happened to me during the midnight hours of the 23rd after leaving the confines of Minoc. My memory was still fresh of the events; ~I was gently shaken awake by a woman who identified herself as Regina the healer, and her assistant Sahra. Regina told me that they had found me wanderin around the swamps, starving, barely conscious and delierious from the effects of eating nightshade mushrooms, lucky to be found alive by Blackthorn's knights. I inquired of my effects, and she told me they were upstairs in a footlocker.");
|
||||
say("Knights of Blackthorn? I spared them no detail of mine hatred for both him and Lord British's laws. Sahra seemed to be taken back by mine disdain for Blackthorn...~");
|
||||
say("As I was retrieving my effects from the footlocker, without warning a violent shudder suddenly passed through the core of my being, causing me to fall to mine knees for several minutes.. When I recovered; rage filled me beyond belief. I descended the ladder to find Regina and Sahra conspiring together. They approached me with an evil grin, and a foul smelling potion in hand. They demanded 500 crowns for my treatment right then and there, even though they said it twas free nary ten minutes ago! We scuffled, and I wrestled the potion out of Sahra's hands and forced it down her throat. She began to make gurgling noises and foaming at the mouth, and collapsed. Her body started turning a grey ashen color as she convulsed. As I made my escape, I noticed several of the patients dead with the same color and foaming at the mouth...~");
|
||||
say("~As I exited and closed the door behind me my gaze fixed on an extremely ominous figure dressed in a black cloak. Blacker than the shadows of the night itself this apparition was.! A wave of utter fear ran down my spine as it stared in my direction.. This night, I ran to the gate and out of town terrified into the woods..*");
|
||||
say("1/25/138~~ Since my strange experience in Minoc, I have found some fortune at last. I met up with a lass by the name of Lucy at the poorhouse. I told 'er stories of mine travels, and told 'er I'd make her a rich woman if she comes with me. Her beauty will fetch a fair price..*");
|
||||
say("3/5/138 ~~ Arrived here in Britain weeks ago with Lucy, living a luxurious life. The gold be pouring in like wine, Lucy has caught the eye of many lusty nobleman.. even Lord British's jester. The stories Lucy tells me of that lunatic's depravity makes me shudder.. but he promises to pay extra crowns for her exclusivity...*");
|
||||
say("3/25/138 ~~ Chuckles is late on reconciling the 'tab' he has run up on Lucy. The bloody foole thinks that because his Liege is gone, he is above the morality of paying one's debts.. We'll see about that!");
|
||||
say("4/2/138 ~~ Aye put the plan in motion.. but something went wrong. The green concotion t'werent supposed to kill her..only put her into a deep sleep.. but Chuckles depravity sent her over the edge. The foole came to me in a panic, wantin me to help hide er body until his liege returned. Said he'd meet me at the Royal Mint tonight and arrange for the guards to be absent, to settle his debt and then some. Should be able to retire a very rich man after this is over, but I must no longer tarry in Britain after this day...");
|
||||
|
||||
|
||||
if (!gflags[MET_DRUDGEWORTH] && UI_find_nearby_avatar(1266)) //drudgeworth mirror
|
||||
delayedBark(AVATAR, "I saw a figure standing in that mirror!", 3);
|
||||
|
||||
}
|
||||
else if (qual == 30)
|
||||
{
|
||||
showBook();
|
||||
say("-------------------------test*");
|
||||
|
||||
say("000000000000000000000 ~ test*");
|
||||
say("111111111111111111111111111111122");
|
||||
}
|
||||
|
||||
|
||||
else if (qual == 32)
|
||||
{
|
||||
showBook();
|
||||
|
||||
say("~~~~TITLE"); //should be line 5
|
||||
say("~~~~by AUTHOR*"); //line 9 and includes page break.
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 33)
|
||||
{
|
||||
showBook();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 34)
|
||||
{
|
||||
showBook();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
original_book.original();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
312
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/books.uc
Executable file
312
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/books.uc
Executable file
@@ -0,0 +1,312 @@
|
||||
void showBook1 ()
|
||||
|
||||
{
|
||||
var SOUND_BOOK = 14;
|
||||
//Play book sound:
|
||||
|
||||
UI_play_sound_effect2(SOUND_BOOK, item);
|
||||
|
||||
|
||||
//Start book mode for current item:
|
||||
|
||||
book_mode();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void book shape#(1171) ()
|
||||
{
|
||||
var player_name = getAvatarName();
|
||||
var qual = UI_get_item_quality(item);
|
||||
var msg;
|
||||
var sound;
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
// * denotes page break
|
||||
// ~ equals 'enter' for space
|
||||
if (qual == 0)
|
||||
{
|
||||
showBook();
|
||||
|
||||
|
||||
say("~~ ~~Captain's log - The Empire~~",
|
||||
|
||||
"~~by Ventara~~",
|
||||
|
||||
"~~Day 1- I, Ventara, now Captain of the Empire in the post-Hawkins era, set sail with a new crew in search of Hawkins' treasure without the aid of the complete map. The others have retired, and will ne'er expect that I'll keep looking! I'll keep it all to meself!*");
|
||||
|
||||
say("~~Day 10 ~~The crew be still in good spirits. My former shipmates proberly don't even know I slipped out o' the 'Den yet with the Empire, too drunk in celebration over Hawkins' demise. I be too calculating for them scumbags. The blood o' Hawkins didn't even dry on the timbers of the Empire before I plotted my next move!*");
|
||||
|
||||
say("~~Day 14 ~~Narrowly evaded the Royal Navy. The Empire still be a grand vessel, and with Ventara as Captain, we'll ne'er be caught. Will stop soon on a nearby island to patch a hole from the cannonball that grazed the ship. Blasted Lord British and his Navy!*");
|
||||
|
||||
say("~~Day 23 ~~After a few false leads, I am confident that this next island be the one that Hawkins buried his swag. We'll reach it by sundown. The crew eagerly awaits the treasure... the greedy bastards.*");
|
||||
|
||||
say("~~Day 24 ~~So I was wrong. No treasure here. Slight miscalculation, blasted sextant! Damn Hawkins' wretched soul!*");
|
||||
|
||||
say("~~Day 30 ~~They were eying me again today. Those rats don't think I know, but I know. 'Twas the same look we gave Hawkins before we gutted him. But they'll not get Captain Ventara, oh no. I knows their plots. The promise of treasure will only negate their bloodlust for so long, but I feel I am close to the treasure...*");
|
||||
|
||||
say("~~Day 33 ~~Sent me first mate to a watery grave as an example to anyone thinking any idears. I'll not share my treasure with these dogs. I will use them long enough to get to the location where the treasure is buried. I believe I can lose them along the way, I'll remember where our traps were set. I'll retire a very rich man.*");
|
||||
|
||||
say("~~Day 45 ~~Damn the storms.. visibility is low. The past several days the waters have been rough due to the earthquakes. The crew begs me to abandon the expedition. I'll have none o'that! They'll not keep me from the treasure! Through the storm, I can see the monolith that marks the spot! This is it!*");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 1)
|
||||
{
|
||||
|
||||
showBook();
|
||||
|
||||
say("~~ A CITY DWELLER GUIDE TO THE COUNTRYSIDE ~~ ",
|
||||
|
||||
"~~by LaFey~~~~*");
|
||||
|
||||
say("~~Within this volume the author, an inhabitant of Britain, describes his countryside strolls with particular emphasis on the inns, taprooms and patrons therein.~~~");
|
||||
|
||||
say("...and when I reached Paws the light was already fading and a cold breeze was blowing from the east. The quaint village inn beckoned me inside invitingly. It was only a matter of wiping my dusty boots and before long I sat with the local folk, sipping from ceramic mugs and discussing threads, fabrics or local gossip. The ale was sufferable and the cost a trifle. After I had opened my pouch to buy a third round the conversation shifted from the affairs of weavers to the affairs of the court...");
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 2)
|
||||
{
|
||||
|
||||
showBook();
|
||||
|
||||
|
||||
say("~~ DAEMON DREAM ~~ ",
|
||||
|
||||
"~~by Dom~~~~*");
|
||||
|
||||
say("~~Once I spent some time far away in the north. A legendary country in which the ancient druids are said to have celebrated their secret rites. But these dark ages are long gone, as I thought. I stayed with some old friends of the family in a small town. At this time I didn<64>t feel too well. The world didn<64>t seem very attractive to me. In my sleep my dreams were troublesome and when I was awake I didn<64>t feel in tune with the flow of everyday life. At daytime I longed for a dreamful night and at night I dreaded the coming long cruel day. So I decided to take some time and as you will read the events proved me right.~");
|
||||
|
||||
say("As I had nothing else to do I often went for long walks exploring the country. One day I strolled through the woods though I knew better as the villagers had repeatedly warned me against it. They claimed that the forest was haunted. Strange lights and noises have been seen and heard. Inhuman creatures were said to live there. The stories of inexplicable things happening were plenty. But I sneered at all this superstitious nonsense. We live in a modern age so why heed such foolish warnings. At least I thought them foolish.~~");
|
||||
|
||||
say("After hours of nature<72>s beauty I came upon an odd circular clearing where everything seemed peaceful and quiet. It was a nice day and I was a little exhausted so I decided to rest some time. I lay down in the opening and the afternoon sun. It didn<64>t take me long and my eyelids felt heavy and I couldn<64>t stay awake anymore. Before I was lost in a dreamless sleep it briefly struck me that the clearing lay in a perfect ring of odd-shaped stones and toadstools. But then my thoughts were already too confused to make anything of it...~~");
|
||||
|
||||
say("Hours later I woke up and it was already dark. I looked up at the sky. The moon was full. I began to feel uncomfortable as I had to think about the superstitious locals who<68>d told me repeatedly that strange things used to happen in these so-called mystical woods. Then I remembered that I was standing in a circle of stones and toadstools and isn<73>t there a story to those rings? I decided that it was high time to take a fast exit and get out of this forest. But as soon as I got near the edge of the circle the stones emitted a strange green light and I could hear a faint chanting. I had to slap myself to see if I was by chance still asleep and only dreaming, but the pain only stung and the light just shone brighter.~~");
|
||||
|
||||
say("Suddenly, there were small dark spots in the light which drew closer to me. I could make out that these were some kind of creatures which looked like faer<65>es. Faer<65>es??!! You know, very small naked people with wings who are often mentioned in old tales, songs and legends. I always thought they were just that - legends. Obviously they were real - or me just a nutcase. They flew gracefully around me and I overheard them speaking about me in their delicate thin voices. I was astonished and just stood there watching these beautiful entities.~~");
|
||||
|
||||
say("They then disappeared, all but one. She was obviously a female specimen and quite a beauty. She seemed slightly bigger as the others and she had an air about her that demanded unshared attention. She hovered on eye-level with me and began to speak :~~");
|
||||
|
||||
say("@Human fool! How dare you intrude our peaceful forest? Aren<65>t you satisfied destroying the world outside? Must you bring your human destructiveness even here? Are you willing to take this place as well?@~~");
|
||||
|
||||
say("@I ... I didn<64>t mean to disturb you and I regret deeply what my people did to our home. In trying to escape and to find a little peace I came here. I humbly apologize my intruding. There was no ill intended.@ I replied.~~");
|
||||
|
||||
say("@Mortal, I know you very well and this was just a little test. To see if you changed in these past ages.@~~");
|
||||
|
||||
say("@Now wait a minute! Do I have this right? You know me? Ages? May I ask you what you are talking about?@~~");
|
||||
|
||||
say("@Listen! Know that I<>m the Queen of the faer<65>es and thus knew a long time ago that you would eventually be lead to this place again. In ancient times it was decided to grant you a wish if you are able to answer a simple question.@~~");
|
||||
|
||||
say("@Again?@ I questioned. @Never before in my life was I here. How do I deserve a wish? I<>m no one special, just a ...@~~");
|
||||
|
||||
say("@You are far more. You always were. A friend of my people. In every life you helped us with your magic and now we are going to give you what your heart desires.@~~");
|
||||
|
||||
say("@Magic? I know nothing of magic and I certainly don<6F>t believe in reincarnation ... But I also don<6F>t believe in faer<65>es. and now I<>m standing here in green light, arguing with the very Queen of the faer<65>es. It<49>s more probable that I drank to much in the tavern and I just dream this.@~~");
|
||||
|
||||
say("@<40>Tis no dream and let me assure you in former life, you were quite a magician. But now enough of this foolish talk. I know you, rest assured. Never could I mistake your bright burning light for someone else<73>s. Listen! I<>ll ask you now a question that will change your life. Name the five elements ancient mages knew to master.@~~");
|
||||
|
||||
say("I answered, @That<61>s easy. It<49>s fire, water, earth. air and...@ A fifth element? I never before heard of another element. What the ... was she talking about anyway. Me a magician! Ha! Who was the crazy person here? What element...@ I thought.");
|
||||
|
||||
say("As I strenuously thought about magic and a fifth element something deep in me stirred. Ancient knowledge flooded my consciousness but it was gone before I could really grasp it. But I could then clearly see the truth in her words and most importantly, I knew the answer to her little quiz.~~");
|
||||
|
||||
say("@It<49>s ether!@, I exclaimed.~~");
|
||||
|
||||
say("@Congratulations@ said the faerie. @I had my doubts you could remember these very old lessons but you did it. Now, think of your deepest desire. Name it and your wish shall be granted.@~~");
|
||||
|
||||
say("@You know, I have this dream that haunts me. At first it was quite harmless but now it<69>s very disturbing and everybody I tell this dream thinks me mad. I will tell you the whole story. Years ago, in one of my dreams I came upon a big wall. The height of it you can<61>t even begin to imagine. I became curious what would lie behind this wall and I spent many a night looking for a way to the other side.@");
|
||||
|
||||
say("@One night dreaming I found a big, wooden, ancient-looking door. I was happy but that lasted only for a moment as I found the door locked. Desperation overwhelmed me. I hammered against it but naturally it wouldn<64>t budge. <20>T was far too massive. I tried looking through the keyhole but all I could see was darkness. After this failure I tried to forget about that wall. But often in my dreams I found myself standing before this door trying to open it. So eventually I started looking for a key. Years passed in real life and in my dreams I kept on looking for the key. I found many but none ever fitted.@");
|
||||
|
||||
say("@Finally one day I discovered what I did wrong. I only searched in my dreams but wasn<73>t it possible that it<69>s actually a real, solid key? So I started to spend my waking hours searching as well. and at least I found it. Ironically it was in possession of my very family. My great-grandfather got it as an gift from a gypsy he saved from drowning. He passed it on to his son when he died and so did my grandfather. and when my father died I was the one to get it. The key was very old looking and solid gold and from the first moment I held it in my hand I knew it to be the very key. So the next night I went to bed with the key hanging around my neck. and in my dream I found myself still wearing it. What is there left to say. It did open the door. But after all these years I hesitated to step through it. Then with all my courage I did it. I took a deep breath and the last steps.@");
|
||||
|
||||
say("@And what joy. I seemed to be standing in another reality. It was like waking up, though it wasn<73>t the world I knew. The air smelled fresh of nature, strong scents of blossoming flowers and everything was green. I know this sounds stupid but you of all people should be able to understand it.@");
|
||||
|
||||
say("@There was no one in sight , at first. Then I saw a dark spot in the sky. It seemed to be moving and soon I recognized it to be a winged creature. But don<6F>t think this being looked anything like you as when it drew nearer it frightenly looked more and more like a creature out of the Abyss. As big as me with black leathery wings. Her skin black as the night she looked as if she came straight from hell. Then she landed right before me and suddenly she didn<64>t frighten me anymore. Quite the opposite. She was gorgeous. This fallen angel. Love at first sight.@~~");
|
||||
|
||||
say("@She was a dark-dweller no use denying it but her beauty enchanted me. With an inhuman grace she came very close to me. Her red hair was in beautiful contrast to her black wings. She looked me straight in the eyes. Impossible to describe this pair. Their colour was purple with golden spots but that is really an insufficient description of their fineness. Without saying one word this She-devil kissed and embraced me.@");
|
||||
|
||||
say("@Our bodies unconsciously swayed to the shrill, faint piping of the oldest music, a rhythm of wind and water. A tune so very deep and intimate. I felt like I never felt before. I knew at once that with her I<>m whole, complete. No one but her...@");
|
||||
|
||||
say("@And just as I thought this moment would last forever, the rooster crowed and I was forced through the ominous door and woke up. This is how it usually goes. In some dreams I can<61>t even find my way to the door but when I find it sooner or later meet her as well. I always have to wake up and the time with her always seems much too short, and there<72>s my wish. Let me sleep here protected by the stones and toadstools and never ever let me wake up again. I<>d rather spend my life in this dream with my fair dark-dweller than here in this gray world in which everyday is just an endless struggle to survive.@~~");
|
||||
|
||||
say("After I finished telling the faerie of my reoccuring dreams, she responded:~~");
|
||||
|
||||
say("@You spoke like I expected you to. Thy wish shall be granted. Protected in this magic circle you<6F>ll sleep eternally <20>till Armageddon wipes everything away.@ She motioned me to lie down and as I did she made some gestures and chanted words I never herd before. Almost at once I was standing in front of the door to the mysterious land. Without hesitation I stepped through into a new life...");
|
||||
|
||||
}
|
||||
else if (qual == 3)
|
||||
{
|
||||
|
||||
showBook();
|
||||
|
||||
|
||||
say("~~THE ARCHER<45>S LAMENT ~~ ",
|
||||
|
||||
"~~by Fenwick the bard~~~~*");
|
||||
|
||||
say("~Dear reader, sit and let me tell you a tale of a young ranger by the name of Larson, greatest hunter in a village long since forgotten by time. This man was betrothed to wed a young lass by the name of Sigourney and all was happy in his life<66> until invaders from beyond the Sea of Sand came and burned his village. Though Larson fought bravely, Sigourney was kidnapped and taken to the distant city of Goratesh.~*");
|
||||
|
||||
say("Larson, being a brave sort, took up his bow and arrows and set out after his love. On his journey he saved Anisha, proud warrior princess of the Mesa Haran and sworn enemy of the men who came from the Sea of Sands. Through the great cities of the Hruntir Coast, down through the Belly of the Great Golem Aranoth and out past Gecko<6B>s Marsh they adventured, saving village and town as they went until, finally, the Sea of Sand stretched before them.~~");
|
||||
|
||||
say("'If I cannot choose, then I shall have my arrow choose for me, as it is my skill with a bow that has saved one and impressed another.' Larson finally decided. 'I shall blindfold myself shoot an arrow into yonder grove of palm trees. Should the arrow hit a tree, I will marry Sigourney. If it misses, Anisha shall be my bride.'~~");
|
||||
|
||||
say("With these words, both Sigourney and Anisha realized that the man they thought they loved was naught more than a woodsy dolt of a ranger and crept off while Larson was blindfolded. Both lived happy, fruitful lives while Larson went back to his village and grew old alone.~~");
|
||||
|
||||
say("And the moral of this story, dear reader? When given a choice, never leave it up to fate, lest you lose it all through indecision...");
|
||||
}
|
||||
|
||||
else if (qual == 4)
|
||||
{
|
||||
showBook();
|
||||
|
||||
|
||||
say("~~LADY SILVERLEAVES ~~ ",
|
||||
|
||||
"~~by Keltias~~~~*");
|
||||
|
||||
say("~Oh fair Lady Silverleaves,");
|
||||
say("Thy heart didst belong among thine trees,");
|
||||
say("For ever and more thy spirit shall sing,");
|
||||
say("Among sandy shores and mossy things.~~");
|
||||
|
||||
say("In misty land by southern sea,");
|
||||
say("Of shrouded shadow, and mystery,");
|
||||
say("Thy example shone, thy virtues bright,");
|
||||
say("And banished back all forces of night.~~*");
|
||||
|
||||
say("Oh fair Lady Silverleaves,");
|
||||
say("Thy courage hath art, some few didst see,");
|
||||
say("Thou wispered them, of nature's need,");
|
||||
say("Thou shared thy secrets, and thy creed~~*");
|
||||
|
||||
say("As mountains solid, erode to sand,");
|
||||
say("Thy body rests, thy will yet stands");
|
||||
say("For we remember, even as we grieve,");
|
||||
say("We carry thy strength, fair Lady Silverleaves~");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
else if (qual == 5)
|
||||
{
|
||||
showBook();
|
||||
|
||||
say("~~The Empire ~~ ",
|
||||
|
||||
"~~by Captain Hawkins~~~~*");
|
||||
|
||||
say("~This book appears to be the log of a ship called 'The Empire.' The last entry speaks of the burying of a great treasure, and of the growing discontentment of the crew. There's a hastily scrawled note at the end, in different handwriting, that says 'Captain Hawkins won't be makin' no more log entries.'");
|
||||
|
||||
}
|
||||
|
||||
|
||||
else if (qual == 6)
|
||||
{
|
||||
|
||||
showBook();
|
||||
|
||||
|
||||
say("~~Gargopology Vol. 1 ~~ ",
|
||||
|
||||
"~~Study by Melinus~~~~*");
|
||||
|
||||
say("~Herein this tome are detailed sketches and diagrams of gargoyle skulls, both winged and wingless, and a compilation of what information was gleaned from them.");
|
||||
|
||||
say("~'..I noticed that winged gargoyles and unwinged gargoyles are probably different species.
|
||||
My recent studies regarding some gargoyle skulls obtained from felled corpses on the battlefields suggest some interesting features about them.~
|
||||
|
||||
Winged gargoyle skulls are extremely dolicocephalic and somewhat thin compared to their smaller unwinged counterparts and while this could have served to enhance their aerodinamicity, it also widened their cranial vault and subsequently their brain size.~
|
||||
|
||||
Unwinged gargoyle skulls are a lot more brachicephalic and with a thicker skull. Their mandibles are also a bit bigger compared to those of winged gargoyles and they've got 24 teeth (4 more than their relatives). Their nasal cavities are also bigger and this could mean they're more capable of perceiving odors. I've got no evidence to prove that these are olfactive cavities though as they may be a strange sort of ear.~
|
||||
|
||||
Sadly, I still haven't got enough gargoyle samples to know more about these fascinating species, as they have proved to be an extremely difficult foe. A future study of their costumes may be the key to a faithful reconstruction of their prehistory...'.");
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 7)
|
||||
{
|
||||
showBook();
|
||||
|
||||
say("~~Snilwit's Big Book of Boardgame Strategy ~~ ",
|
||||
|
||||
"~~ by Snilwit~~~~*");
|
||||
|
||||
say("~~Chess: Try to control the middle of the board with your knights, bishops and pawns. ~~* ");
|
||||
|
||||
say("~~Nine Men's Morris: Don't let any of your pieces get trapped in the corners. ~~*");
|
||||
|
||||
say("~~Draughts: Keep your pieces along the sides of the board, where they can't be captured.");
|
||||
|
||||
}
|
||||
else if (qual == 8)
|
||||
{
|
||||
if (!gflags[LEARNED_MANTRA_SPIRITUALITY])
|
||||
{
|
||||
gflags[LEARNED_MANTRA_SPIRITUALITY] = true;
|
||||
}
|
||||
showBook();
|
||||
say("~~The Book of Spirituality~~*");
|
||||
|
||||
say("~~In your travels through life, remember always that Spirituality embodies the sum of all virtues. Chant the mantra 'om' as you meditate on Spirituality, and all will become clear to you...~~");
|
||||
}
|
||||
/*
|
||||
else if (qual == 9)
|
||||
{
|
||||
// if (gflags[READ_GARGISH_SCROLL])
|
||||
// {
|
||||
showBook();
|
||||
say("~~The Book of Ritual~~");
|
||||
say("~~by Naxatilor the Seer~~");
|
||||
say("~~Heed well as I, Naxatilor, write of how I brought the Codex to our land and thereby ushered in the time of prosperity:*
|
||||
With the help of the Lensmaker I crafted the Vortex Lens, by which I could see the Codex where it originally rested.*
|
||||
I created the Vortex Cube to focus the power of the Moonstones and draw the Vortex down to the world.*
|
||||
Then I used the lens to form an image of the Codex upon the cube.*
|
||||
The Vortex touched our plane, the image became solid, and the Codex was brought down to be used properly by our race!");
|
||||
if (!READ_BOOK_RITUAL)
|
||||
gflags[READ_BOOK_RITUAL] = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// showBook();
|
||||
// say("~~Kodeks rit~~*");
|
||||
|
||||
// say("~~vervid ben kua i, naksatilor, skri kuo i porle kodeks uide terreg ew estade kalle ante tim benommani: ku auks lorrelinlem i beninle vorteks lorrel, o kua i le vid kodeks kuater lem terinit anporle. i inle vorteks kuad re inbet grav ok orblap ew trakpor vorteks destrak termur. estatim i perle lorrel re inuislor kodeks ad kuad. vorteks tanle uide terailem, uislor inle ailemde, ew kodeks porle des re perle bende pa uide zenmur.~~");
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
showBook();
|
||||
say("This is not a valid scroll QUAL attribute! Stop cheating!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
98
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/bottle.uc
Executable file
98
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/bottle.uc
Executable file
@@ -0,0 +1,98 @@
|
||||
void Bottle shape#(616) ()
|
||||
{
|
||||
var target = UI_click_on_item();
|
||||
var AvatarFoodLevel = UI_get_npc_prop(UI_get_avatar_ref(), FOODLEVEL);
|
||||
var party = UI_get_party_list();
|
||||
var target_coords = getClickPosition(item);
|
||||
var rand = UI_die_roll(1, 10);
|
||||
|
||||
const int SOUND_DRINK = 90;
|
||||
const int BOTTLE_NUTRITION = 1;
|
||||
|
||||
var CURRENT_AVATAR_BAL = UI_get_npc_id(LORD_BRITISH); //used because Avatar ID is for Karma
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
|
||||
|
||||
if (target == UI_get_npc_object(AVATAR))
|
||||
{
|
||||
if (AvatarFoodLevel < 31)
|
||||
{
|
||||
|
||||
addAvatarBAL(2); //should add it by '1'
|
||||
|
||||
UI_set_npc_prop(AVATAR, FOODLEVEL, 1); //adds 1 to avatar's food levl
|
||||
//addPartyBAL(1); //testing - add later
|
||||
UI_play_sound_effect(SOUND_DRINK);
|
||||
UI_remove_item(item);
|
||||
|
||||
|
||||
|
||||
//maybe add if statement about Flag 40
|
||||
|
||||
script item after rand ticks
|
||||
{
|
||||
call drunkEventsAvatar;
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
UI_item_say(target, "No thanks.");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//for (target in party)
|
||||
|
||||
else
|
||||
if (target in party)
|
||||
{
|
||||
var hunger = UI_get_npc_prop(target, FOODLEVEL);
|
||||
var partyBAL = UI_get_npc_id(target);
|
||||
|
||||
if (hunger >=30)
|
||||
{
|
||||
UI_item_say(target, "I'm not thirsty");
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
UI_set_npc_prop(target, FOODLEVEL, 1); //food level up one
|
||||
UI_play_sound_effect(SOUND_DRINK); //move
|
||||
UI_remove_item(item);
|
||||
|
||||
//assessBAL(target);
|
||||
|
||||
|
||||
//for testing
|
||||
|
||||
//stumble(target);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
//Crystal ball. Additional frame added for special ones like Nystul's crystal ball that shows quest locations.
|
||||
|
||||
void crystal_ball shape# (0x2d9)()
|
||||
{
|
||||
var frame = UI_get_item_frame(item);
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
if (frame == 1)
|
||||
{
|
||||
var rand = UI_get_random(5);
|
||||
|
||||
//add 'bzzt' buzzing the Avatar for clicking too much as in original
|
||||
if (rand == 3)
|
||||
{
|
||||
//play sound
|
||||
UI_play_sound_effect(82);
|
||||
delayedBark(AVATAR, "Yeow!!", 1);
|
||||
UI_apply_damage(1, 1, MAGIC_DAMAGE, AVATAR);
|
||||
|
||||
}
|
||||
else
|
||||
UI_display_area([1576, 1324, 0, 3]); //The Slab
|
||||
|
||||
//add random locations for other crystal balls (Nicodemus?)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
//Nystul's crystal ball that hones in on quest locations
|
||||
if (frame == 1)
|
||||
{
|
||||
//Locations - SHRINES:
|
||||
var honesty_shrine;
|
||||
var justice_shrine;
|
||||
var honor_humility;
|
||||
var humility_shrine;
|
||||
var sacrifice_shrine;
|
||||
var spirituality_shrine;
|
||||
var compassion_shrine;
|
||||
var valor_shrine;
|
||||
|
||||
//Locations - RUNES:
|
||||
var honesty_rune;
|
||||
var justice_rune;
|
||||
var honor_humility;
|
||||
var humility_rune;
|
||||
var sacrifice_rune;
|
||||
var spirituality_rune;
|
||||
var compassion_rune;
|
||||
var valor_rune;
|
||||
|
||||
var act_one_flags = [SACRIFICE_FREED, COMPASSION_FREED, VALOR_FREED, JUSTICE_FREED, SPIRITUALITY_FREED, HONOR_FREED, HUMILITY_FREED, HONESTY_FREED];
|
||||
|
||||
|
||||
|
||||
//RUNE //SHRINE //MANTRA
|
||||
var honesty = [[2343,2966,0,1], [2847,2813],
|
||||
|
||||
|
||||
|
||||
|
||||
//First act - Virtues: Honesty Valor Justice Humility Spirituality Honor Sacrifice Compassion
|
||||
var mantra_locations = [];
|
||||
var shrine_locations = [];
|
||||
var rune_locations = [];
|
||||
|
||||
|
||||
//First act of the quest: Find mantras, find runes, free the shrines.
|
||||
|
||||
|
||||
//Second act - get pirate maps
|
||||
|
||||
// 3rd act - get both lenses, vortex cube, gargoyle mantras, sacred quest
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//}
|
||||
28
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/dagger.uc
Executable file
28
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/dagger.uc
Executable file
@@ -0,0 +1,28 @@
|
||||
void dagger shape#(594) ()
|
||||
{
|
||||
const int SHAPE_TREE1 = 631;
|
||||
const int SHAPE_TREE2 = 670;
|
||||
const int SHAPE_TREE3 = 674;
|
||||
const int SHAPE_TREE4 = 683;
|
||||
const int SHAPE_TREE5 = 783;
|
||||
const int SHAPE_TREE6 = 453;
|
||||
const int SHAPE_TREE7 = 306;
|
||||
const int SHAPE_KINDLING = 1024;
|
||||
|
||||
var target;
|
||||
var target_shape;
|
||||
|
||||
var tree_shapes = [SHAPE_TREE1, SHAPE_TREE2, SHAPE_TREE3, SHAPE_TREE4, SHAPE_TREE5, SHAPE_TREE6, SHAPE_TREE7];
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
target = UI_click_on_item();
|
||||
target_shape = UI_get_item_shape(target);
|
||||
|
||||
if (target_shape in tree_shapes)
|
||||
{
|
||||
UI_add_party_items(1, SHAPE_KINDLING, QUALITY_ANY, FRAME_ANY);
|
||||
}
|
||||
else randomPartyBark("@You can't use the dagger on that..@");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
void desk_item shape#(675) ()
|
||||
{
|
||||
const int SHAPE_PARROT = 1263;
|
||||
const int FRAME_GLASS = 15;
|
||||
const int SHAPE_BROKEN_DISH = 546;
|
||||
const int FRAME_NYSTUL = 1;
|
||||
|
||||
var frame = UI_get_item_frame(item);
|
||||
var target_shape;
|
||||
var target_frame;
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
if (frame == 0) //gavel
|
||||
{
|
||||
var target = UI_click_on_item();
|
||||
var targetframe = UI_get_item_frame(target);
|
||||
target_shape = UI_get_item_shape(target);
|
||||
UI_error_message("targetframe is " + targetframe);
|
||||
|
||||
if (targetframe == 10) //parrot
|
||||
{
|
||||
//parrot is hit, flies off perch. Bad Avatar!
|
||||
UI_play_sound_effect(15);
|
||||
UI_set_item_frame(target, 21);//set item to empty perch
|
||||
|
||||
//create parrot at perch
|
||||
var position = UI_get_object_position(target);
|
||||
|
||||
//create Shape
|
||||
var parrot = UI_create_new_object2(SHAPE_PARROT, position);
|
||||
|
||||
|
||||
UI_item_say(parrot, "Squawk! You'll pay for that!");
|
||||
|
||||
//set parrot in combat mode
|
||||
UI_set_alignment(parrot, EVIL);
|
||||
UI_set_schedule_type(parrot, IN_COMBAT);
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (target_shape == SHAPE_CRYSTAL_BALL && targetframe == 1) //Nystul's crystal ball
|
||||
{
|
||||
UI_error_message("Hitting crystal ball with hammer");
|
||||
UI_close_gumps2();
|
||||
|
||||
var crystal_ball = UI_find_nearest(AVATAR, SHAPE_CRYSTAL_BALL, QUALITY_ANY, FRAME_NYSTUL);
|
||||
UI_set_item_shape(crystal_ball, SHAPE_BROKEN_DISH);
|
||||
UI_set_item_frame(crystal_ball, FRAME_GLASS);
|
||||
UI_play_sound_effect(37);
|
||||
script AVATAR after 6 ticks
|
||||
{
|
||||
call teleportToCheatRoom;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
desk_item.original();
|
||||
|
||||
}
|
||||
else
|
||||
desk_item.original();
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
desk_item.original();
|
||||
}
|
||||
1469
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/eggs.uc
Executable file
1469
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/eggs.uc
Executable file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,144 @@
|
||||
void humanLens 3048()
|
||||
{
|
||||
var blueLightBeam;
|
||||
var blueLightBeam2;
|
||||
var pinkLightBeam;
|
||||
var pinkLightBeam2;
|
||||
const int FRAME_HUMAN = 0;
|
||||
var lens = UI_find_nearby(item, SHAPE_LENS, 1, MASK_NONE);
|
||||
|
||||
AVATAR->close_gumps2(); //doesn't work either
|
||||
|
||||
if (event == EGG)
|
||||
{
|
||||
AVATAR->close_gumps2();
|
||||
var lens = UI_find_nearby(item, SHAPE_LENS, 1, MASK_NONE);
|
||||
var lens_type = UI_get_item_frame(lens);
|
||||
//if correct lens is found
|
||||
if (lens > 0)
|
||||
{
|
||||
var egg_pos = UI_get_object_position(item);
|
||||
UI_close_gumps();
|
||||
|
||||
if (lens_type == FRAME_HUMAN)
|
||||
{
|
||||
UI_move_object(lens, egg_pos); //moves lens into position
|
||||
gflags[HUMAN_LENS_PLACED] = true;
|
||||
UI_obj_sprite_effect(lens, 13, 0, 0, 0, 0, 0, -1);
|
||||
|
||||
//place beam of light - first part
|
||||
blueLightBeam = UI_create_new_object2(168, [2802, 2589, 1]);
|
||||
UI_set_item_frame(blueLightBeam, 24); //change to straight beam
|
||||
|
||||
//place second part
|
||||
blueLightBeam2 = UI_create_new_object2(168, [2807, 2590, 3]);
|
||||
UI_set_item_frame(blueLightBeam2, 22); //change to straight beam
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//Shenanigans detected, deletes beams of light if lens is removed
|
||||
blueLightBeam = UI_find_object(FIND_ON_SCREEN, 168, QUALITY_ANY, 22);
|
||||
UI_remove_item(blueLightBeam);
|
||||
blueLightBeam2 = UI_find_object(FIND_ON_SCREEN, 168, QUALITY_ANY, 24);
|
||||
UI_remove_item(blueLightBeam2);
|
||||
gflags[HUMAN_LENS_PLACED] = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void gargoyleLens 3049()
|
||||
{
|
||||
var pinkLightBeam;
|
||||
var pinkLightBeam2;
|
||||
const int FRAME_GARGOYLE = 1;
|
||||
var lens = UI_find_nearby(item, SHAPE_LENS, 1, MASK_NONE);
|
||||
UI_close_gumps();
|
||||
|
||||
if (event == EGG)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var lens = UI_find_nearby(item, SHAPE_LENS, 1, MASK_NONE);
|
||||
var lens_type = UI_get_item_frame(lens);
|
||||
//if correct lens is found
|
||||
if (lens > 0)
|
||||
{
|
||||
var egg_pos = UI_get_object_position(item);
|
||||
|
||||
|
||||
if (lens_type == FRAME_GARGOYLE)
|
||||
{
|
||||
UI_move_object(lens, egg_pos); //moves lens into position
|
||||
gflags[GARG_LENS_PLACED] = true;
|
||||
UI_obj_sprite_effect(lens, 13, 0, 0, 0, 0, 0, -1);
|
||||
|
||||
//place beam of light - first part
|
||||
pinkLightBeam = UI_create_new_object2(168, [2817, 2591, 5]);
|
||||
UI_set_item_frame(pinkLightBeam, 20); //change to straight beam
|
||||
|
||||
//place second part
|
||||
pinkLightBeam2 = UI_create_new_object2(168, [2811, 2590, 3]);
|
||||
UI_set_item_frame(pinkLightBeam2, 21); //change to straight beam
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//Shenanigans detected, deletes beams of light if lens is removed
|
||||
pinkLightBeam = UI_find_object(FIND_ON_SCREEN, 168, QUALITY_ANY, 20);
|
||||
UI_remove_item(pinkLightBeam);
|
||||
pinkLightBeam2 = UI_find_object(FIND_ON_SCREEN, 168, QUALITY_ANY, 21);
|
||||
UI_remove_item(pinkLightBeam2);
|
||||
gflags[GARG_LENS_PLACED] = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void placeVortexCube 3051()
|
||||
{
|
||||
if (event == EGG)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var vortexcube = UI_find_nearest(item, SHAPE_VORTEX_CUBE, 2);
|
||||
if (vortexcube)
|
||||
{
|
||||
|
||||
//run a check to make sure the cube has all the stones in it first
|
||||
var IsCubeFull = isCubeFull();
|
||||
if (IsCubeFull == true)
|
||||
{
|
||||
UI_error_message("Cube is full");
|
||||
if (gflags[HUMAN_LENS_PLACED] && gflags[GARG_LENS_PLACED])
|
||||
{
|
||||
|
||||
AVATAR->set_item_flag(BG_DONT_MOVE);
|
||||
UI_error_message("ENdgame initiated via placeVortexCube egg");
|
||||
//1->SendCodexToVoid(); //initiate endgame sequence
|
||||
startEndgame();
|
||||
}
|
||||
else
|
||||
randomPartyBark("@The lenses aren't in place.@");
|
||||
|
||||
}
|
||||
else{
|
||||
randomPartyBark("I think we are missing some moonstones..");
|
||||
UI_obj_sprite_effect(vortexcube, 9, 4, 4, 0, 0, 0, -1);
|
||||
UI_play_sound_effect(69); //spell fizzle
|
||||
}
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
225
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/fishingrod.uc
Executable file
225
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/fishingrod.uc
Executable file
@@ -0,0 +1,225 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 Alun Bestor/The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Author: Marzo Junior (reorganizing/updating code by Alun Bestor)
|
||||
* Last Modified: 2022 agentorangeguy
|
||||
*/
|
||||
|
||||
const int FRAME_FRESHFISH = 31; //added by DB - quality is iffy and won't stay sometimes
|
||||
|
||||
const int QUALITY_FRESHFISH = 1; //the quality of freshly-caught fish
|
||||
//(this will expire to 0 at EXPIRY_RATE)
|
||||
const int FISH_EXPIRY_RATE = 50; //the quality will be decremented by one
|
||||
//every EXPIRY_RATE ticks
|
||||
//These factors are not currently used: sleeping will not decrement quality properly.
|
||||
|
||||
const int BASE_CATCH_CHANCE = 30; //% base chance of catching a fish, if any are about
|
||||
const int CHANCE_PER_FISH = 10; //% extra catch chance per nearby fish
|
||||
|
||||
const int SOUND_LANDEDFISH = 40; //played when you catch a fish
|
||||
const int SOUND_FISHING = 103; //the plop of bait entering the water
|
||||
|
||||
//Reconstituted from original function, with some extra bits added
|
||||
//(more advice to the player, tweaked catch chance). Also extended
|
||||
//animation considerably, and increased catch chance to compensate
|
||||
//for the delay
|
||||
void FishingRod shape#(662) ()
|
||||
{
|
||||
//Rod was doubleclicked on: start fishing
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
//make sure the fishing rod is readied first
|
||||
if (!AVATAR->is_readied(BG_WEAPON_HAND, SHAPE_FISHING_ROD, FRAME_ANY))
|
||||
{
|
||||
randomPartySay("@Thou must have the rod in thy hand.@");
|
||||
return;
|
||||
}
|
||||
|
||||
UI_close_gumps();
|
||||
var target = UI_click_on_item();
|
||||
|
||||
if (!(UI_is_water([target[2], target[3], target[4]]) || target->get_item_shape() == SHAPE_FISH))
|
||||
{
|
||||
UI_flash_mouse(0);
|
||||
|
||||
//only make this 1 in 4, to stop irritating the player
|
||||
if (UI_get_random(4) == 1)
|
||||
{
|
||||
//Spark is the resident angling expert
|
||||
if (inParty(SPARK))
|
||||
SPARK.say("@Thou shouldst cast thy line into the water, Avatar!@ He grins cheekily.");
|
||||
else
|
||||
randomPartySay("@Last I heard, fish doth not live upon dry land. Thou shouldst try thy rod in the water!@");
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
//determine which way the avatar should be facing
|
||||
var direction = directionFromAvatar(target);
|
||||
//fishing animation
|
||||
script AVATAR
|
||||
{
|
||||
nohalt;
|
||||
call GenericFreeze;
|
||||
face direction;
|
||||
actor frame reach_2h;
|
||||
actor frame strike_2h;
|
||||
sfx SOUND_FISHING;
|
||||
|
||||
//prevents the animation 'timing out' and reverting to standing
|
||||
repeat 2 { actor frame strike_2h; wait 5; };
|
||||
|
||||
//call this function again, as event SCRIPTED, to determine
|
||||
//if fish were caught
|
||||
call FishingRod;
|
||||
actor frame ready;
|
||||
actor frame standing;
|
||||
call GenericUnfreeze;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (event == SCRIPTED)
|
||||
{
|
||||
var nearby_fish = AVATAR->find_nearby(SHAPE_FISH, 15, 0);
|
||||
var num_fish_nearby = UI_get_array_size(nearby_fish);
|
||||
var fish_caught = false;
|
||||
var rand;
|
||||
|
||||
//Adjusted fish-catching chance: now it is a base chance +
|
||||
//an adjustable chance per fish
|
||||
if (num_fish_nearby > 0)
|
||||
{
|
||||
var catch_chance = BASE_CATCH_CHANCE + (num_fish_nearby * CHANCE_PER_FISH);
|
||||
if (UI_get_random(100) <= catch_chance)
|
||||
fish_caught = true;
|
||||
}
|
||||
|
||||
//Hooray, we got one!
|
||||
if (fish_caught)
|
||||
{
|
||||
var fish = SHAPE_FOOD->create_new_object();
|
||||
if (!fish) return;
|
||||
|
||||
fish->set_item_frame(FRAME_FRESHFISH);
|
||||
//Added to stop fish sticking around indefinitely
|
||||
fish->set_item_flag(TEMPORARY);
|
||||
|
||||
//put it near the avatar's feet
|
||||
var avatar_pos = AVATAR->get_object_position();
|
||||
avatar_pos[X] = avatar_pos[X] + 1;
|
||||
UI_update_last_created(avatar_pos);
|
||||
|
||||
UI_play_sound_effect(SOUND_LANDEDFISH);
|
||||
|
||||
//Added: indicates that the fish is fresh (for sale to Gordon)
|
||||
//Note: this required a new tfa.dat, to change the class of the
|
||||
//Food shape from Quality Flags to Quality.
|
||||
fish->set_item_quality(QUALITY_FRESHFISH);
|
||||
|
||||
//Added: start the fish quality decrementing
|
||||
//Removed: disabled for now, as it doesn't count sleep at all
|
||||
//script fish after FISH_EXPIRY_RATE ticks { call 0xB40; }
|
||||
|
||||
/* Disabled as it is not correctly implemented
|
||||
//Added: remove a fish from the water
|
||||
var caught_fish;
|
||||
if (target->get_item_shape() == SHAPE_FISH)
|
||||
//Player clicked on a particular fish - grab that one
|
||||
caught_fish = target;
|
||||
else
|
||||
//otherwise, grab one of the nearby fishies at random
|
||||
caught_fish = nearby_fish[UI_get_random(num_fish_nearby)];
|
||||
caught_fish->remove_item();
|
||||
*/
|
||||
|
||||
//Make one of the party members comment on the catch
|
||||
rand = UI_get_random(3);
|
||||
if (rand == 1)
|
||||
{
|
||||
randomPartyBark("@Indeed, a whopper!@");
|
||||
if (SPARK->npc_nearby())
|
||||
delayedBark(SPARK, "@I have seen bigger.@", 16);
|
||||
}
|
||||
else if (rand == 2)
|
||||
randomPartyBark("@What a meal!@");
|
||||
else if (rand == 3)
|
||||
randomPartyBark(["@That fish does not", "look right.@"]);
|
||||
}
|
||||
|
||||
//changed barks to reflect that there's no fish (better player guidance)
|
||||
else if (num_fish_nearby == 0)
|
||||
{
|
||||
rand = UI_get_random(3);
|
||||
if (rand == 1)
|
||||
{
|
||||
//Spark, butting his head in as usual
|
||||
if (inParty(SPARK) && canTalk(SPARK))
|
||||
SPARK.say("@The fish doth not seem to be biting, thou shouldst try somewhere else!",
|
||||
"~@My father took me fishing sometimes -- thou canst find good spots near bridges, where thou canst see the fishes beneath the water.@");
|
||||
else
|
||||
randomPartySay("@Methinks there are no fish in these waters. Let us try in a better spot!@");
|
||||
}
|
||||
else if (rand == 2)
|
||||
delayedBark(AVATAR, "@Not even a bite!@", 0);
|
||||
else if (rand == 3)
|
||||
delayedBark(AVATAR, "@I've lost my bait.@", 0);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
rand = UI_get_random(4);
|
||||
|
||||
if (rand == 1)
|
||||
delayedBark(AVATAR, "@Not even a bite!@", 0);
|
||||
else if (rand == 2)
|
||||
{
|
||||
delayedBark(AVATAR, "@It got away!@", 1);
|
||||
if (IOLO->npc_nearby())
|
||||
delayedBark(IOLO, "@It was the Big One!@", 16);
|
||||
}
|
||||
else if (rand == 3)
|
||||
delayedBark(AVATAR, "@I've lost my bait.@", 0);
|
||||
else if (rand == 4)
|
||||
delayedBark(AVATAR, "@I felt a nibble.@", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
//This function is responsible for making fish go bad after a certain
|
||||
//length of time.
|
||||
//Not used: sleeping will not advance the script queue.
|
||||
expireFish ()
|
||||
{
|
||||
var reduced_quality = get_item_quality() - 1;
|
||||
set_item_quality(reduced_quality);
|
||||
|
||||
if (reduced_quality == 0)
|
||||
{
|
||||
halt_scheduled(); //stop the countdown
|
||||
avatarBark("Fish now rotten!");
|
||||
}
|
||||
else
|
||||
{
|
||||
avatarBark("Fish now at " + reduced_quality + " quality");
|
||||
script item after FISH_EXPIRY_RATE ticks call 0x600;
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -0,0 +1,45 @@
|
||||
void fryingpan shape#(944) ()
|
||||
{
|
||||
var target_frame = item->get_item_frame();
|
||||
var quality = get_item_quality();
|
||||
var framenum;
|
||||
var pos;
|
||||
var campfire;
|
||||
var campfire_pos;
|
||||
var fryingpan;
|
||||
var fryingpan_pos;
|
||||
var campfire_dist;
|
||||
|
||||
campfire = UI_find_nearby_avatar(SHAPE_CAMPFIRE);
|
||||
campfire_pos = UI_get_object_position(campfire);
|
||||
|
||||
framenum = UI_get_item_frame(item);
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
AVATAR.say("@What should we cook?@");
|
||||
|
||||
var options = ["nothing"];
|
||||
|
||||
if (UI_count_objects(PARTY, SHAPE_FOOD, QUALITY_ANY, 28) >= 1) if (item in party) options = options & "raw mutton";
|
||||
|
||||
converse(options)
|
||||
{
|
||||
case "nothing" (remove):
|
||||
break;
|
||||
|
||||
case "raw mutton"
|
||||
if (!UI_find_nearby_avatar(SHAPE_CAMPFIRE))
|
||||
{
|
||||
AVATAR.say("@We need to start a campfire in order to cook meat.@");
|
||||
break;
|
||||
}
|
||||
else script AVATAR
|
||||
{
|
||||
nohalt;
|
||||
//gotoObject(campfire, 0, 1, 0);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
170
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/garg_signs.uc
Executable file
170
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/garg_signs.uc
Executable file
@@ -0,0 +1,170 @@
|
||||
void garg_plaque shape# (1230)()
|
||||
{
|
||||
|
||||
//TH = (
|
||||
//NG = *
|
||||
//EA = +
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var msg;
|
||||
var quality = get_item_quality();
|
||||
|
||||
if (quality == 0)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["librum", "klau"];
|
||||
else
|
||||
msg = ["librum", "chamber"];
|
||||
}
|
||||
else if (quality == 1)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["kodeks ultim", "uis"];
|
||||
else
|
||||
msg = ["Codex of", "Ultimate Wisdom"];
|
||||
}
|
||||
else if (quality == 2)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["vorteks klau", "ni canportas"];
|
||||
else
|
||||
msg = ["Vortex Chamber", "No Admittance"];
|
||||
}
|
||||
|
||||
else if (quality == 3)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["hiuman klau"];
|
||||
else
|
||||
msg = ["Human Chamber"];
|
||||
}
|
||||
else if (quality == 4)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["naksatilor", "vidlem"];
|
||||
else
|
||||
msg = ["Naxatilor", "the seer"];
|
||||
}
|
||||
else if (quality == 5)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["prilem", "draksinusom"];
|
||||
else
|
||||
msg = ["Lord", "Draxinusom"];
|
||||
}
|
||||
|
||||
else if (quality == 6)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["inmanilem"];
|
||||
else
|
||||
msg = ["Healer"];
|
||||
}
|
||||
|
||||
else if (quality == 7)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["beninlem"];
|
||||
else
|
||||
msg = ["Goodscrafter"];
|
||||
}
|
||||
|
||||
else if (quality == 8)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["kansinlem"];
|
||||
else
|
||||
msg = ["Foodmaker"];
|
||||
}
|
||||
|
||||
else if (quality == 9)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["agracarinlem"];
|
||||
else
|
||||
msg = ["Weaponsmith"];
|
||||
}
|
||||
|
||||
else if (quality == 10)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["atri skitas"];
|
||||
else
|
||||
msg = ["The Hall", "Of", "Knowledge"];
|
||||
}
|
||||
else if (quality == 11)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["kahmanizende", "tablap"];
|
||||
else
|
||||
msg = ["The", "Sacrificial", "Slab"];
|
||||
}
|
||||
else if (quality == 12)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["teresta sit", "summle", "manchar", "lemmur kahle"];
|
||||
else
|
||||
msg = ["Here lie the", "honored remains", "of those", "who have", "been sacrificed"];
|
||||
}
|
||||
else if (quality == 13)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["kuante esta", "klau anpor", "os", "prilemmur"];
|
||||
else
|
||||
msg = ["Within this", "chamber rests", "the bones", "of kings."];
|
||||
}
|
||||
else if (quality == 14)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["teresta sit", "lem antende", "nom"];
|
||||
else
|
||||
msg = ["Here lie", "those that", "had no", "names"];
|
||||
}
|
||||
|
||||
else if (quality == 15)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["vorteks", "lorrel"];
|
||||
else
|
||||
msg = ["The", "Vortex", "Lens"];
|
||||
}
|
||||
|
||||
else if (quality == 16)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["vorteks", "kuad"];
|
||||
else
|
||||
msg = ["The", "Vortex", "Cube"];
|
||||
}
|
||||
else if (quality == 17)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["ara pritas"];
|
||||
else
|
||||
msg = ["The Altar", "Of", "Singularity"];
|
||||
}
|
||||
else if (quality == 18)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["kodeks kir"];
|
||||
else
|
||||
msg = ["The Book", "Of", "Circles"];
|
||||
}
|
||||
else if (quality == 19)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["kodeks balsil"];
|
||||
else
|
||||
msg = ["The Book", "Of", "Prophesies"];
|
||||
}
|
||||
|
||||
|
||||
else msg = ["Stop Cheating!"];
|
||||
|
||||
UI_display_runes(49, msg);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
void gargish_plaque shape# (1230)()
|
||||
{
|
||||
var quality = get_item_quality();
|
||||
|
||||
|
||||
//TH = (
|
||||
//NG = *
|
||||
//EA = +
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var msg;
|
||||
var quality = get_item_quality();
|
||||
|
||||
if (quality == 0)
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
{
|
||||
msg = ["librum", "klau"];
|
||||
}
|
||||
else msg = ["librum", "chamber"];
|
||||
|
||||
else if (quality == 2)
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
{
|
||||
msg = ["vorteks klau", "ni canportas"];
|
||||
}
|
||||
else msg = ["Vortex Chamber", "No", "Admittance"];
|
||||
|
||||
else if (quality == 3)
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
{
|
||||
msg = ["naksatilor vidlem"];
|
||||
}
|
||||
else msg = ["Naxatilor", "The Seer"];
|
||||
|
||||
|
||||
else if (quality == 3)
|
||||
|
||||
msg = ["Kafiristan Pass"];
|
||||
|
||||
else if (quality == 4)
|
||||
|
||||
msg = ["For Sale"];
|
||||
|
||||
|
||||
else if (quality == 5)
|
||||
|
||||
msg = ["The crypt", "of", "Cantrell"];
|
||||
|
||||
|
||||
else if (quality == 6)
|
||||
|
||||
msg = ["The crypt", "of", "Spector"];
|
||||
|
||||
else if (quality == 7)
|
||||
|
||||
msg = ["The crypt", "of", "Beyvin"];
|
||||
|
||||
|
||||
else if (quality == 8)
|
||||
|
||||
msg = ["The crypt", "of", "Malone"];
|
||||
|
||||
else if (quality == 9)
|
||||
|
||||
msg = ["The crypt", "of", "Bourbonnais"];
|
||||
|
||||
else if (quality == 10)
|
||||
|
||||
msg = ["The crypt", "of", "Jannati"];
|
||||
|
||||
else if (quality == 11)
|
||||
|
||||
msg = ["The crypt", "of", "Romero"];
|
||||
|
||||
else if (quality == 12)
|
||||
|
||||
msg = ["The crypt", "of", "Dwyer"];
|
||||
|
||||
else if (quality == 13)
|
||||
|
||||
msg = ["The crypt", "of", "Gabriella"];
|
||||
|
||||
else if (quality == 14)
|
||||
|
||||
msg = ["The", "Blue", "Bottle"];
|
||||
|
||||
else if (quality == 15)
|
||||
|
||||
msg = ["Fool's Pair", "o'", "Dice"];
|
||||
|
||||
else if (quality == 16)
|
||||
|
||||
msg = ["Avatar Lane"];
|
||||
|
||||
|
||||
else if (quality == 17)
|
||||
|
||||
msg = ["Bellringer Lane"];
|
||||
|
||||
else if (quality == 18)
|
||||
|
||||
msg = ["Serpents Loop"];
|
||||
|
||||
else if (quality == 19)
|
||||
|
||||
msg = ["Keep Out!"];
|
||||
|
||||
else if (quality == 20)
|
||||
|
||||
msg = ["This way"];
|
||||
|
||||
|
||||
else if (quality == 21)
|
||||
|
||||
msg = ["That way"];
|
||||
|
||||
else if (quality == 22)
|
||||
|
||||
msg = ["Drop to", "your death!"];
|
||||
|
||||
else if (quality == 23)
|
||||
|
||||
msg = ["This way"];
|
||||
|
||||
else if (quality == 24)
|
||||
|
||||
msg = ["That way"];
|
||||
|
||||
else if (quality == 25)
|
||||
|
||||
msg = ["The Maze", "Of death!"];
|
||||
|
||||
else if (quality == 26)
|
||||
|
||||
msg = ["Off Limits!"];
|
||||
|
||||
else msg = ["Stop Cheating!"];
|
||||
|
||||
|
||||
UI_display_runes(49, msg);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
|
||||
|
||||
void gargbook shape#(1251) ()
|
||||
{
|
||||
var player_name = getAvatarName();
|
||||
var quality = UI_get_item_quality(item);
|
||||
var msg;
|
||||
var sound;
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
// * denotes page break
|
||||
// ~ equals 'enter' for space
|
||||
if (quality == 0)
|
||||
{
|
||||
showBook();
|
||||
|
||||
|
||||
if (gflags[READ_GARGISH_SCROLL])
|
||||
{
|
||||
showBook();
|
||||
say("~~The Book of Ritual~~");
|
||||
say(" ~~by Naxatilor the Seer~~*");
|
||||
say("~Heed well as I, Naxatilor, write of how I brought the Codex to our land and thereby ushered in the time of prosperity: ");
|
||||
say("~~With the help of the Lensmaker I crafted the Vortex Lens, by which I could see the Codex where it originally rested.");
|
||||
say("~~I created the Vortex Cube to focus the power of the Moonstones and draw the Vortex down to the world. Then I used the lens to form an image of the Codex upon the cube.");
|
||||
say("~~The Vortex touched our plane, the image became solid, and the Codex was brought down to be used properly by our race!");
|
||||
gflags[READ_BOOK_RITUAL] = true;
|
||||
|
||||
if (!gflags[TOLD_ABOUT_CUBE])
|
||||
gflags[TOLD_ABOUT_CUBE] = true; //allows you to ask about cellar with Cyclops
|
||||
}
|
||||
else
|
||||
{
|
||||
showBook();
|
||||
say(" ~~Kodeks rit~~");
|
||||
say(" ~~naksatilor vidlem~~*");
|
||||
|
||||
say("~~vervid ben kua i, naksatilor, skri kuo i porle kodeks uide terreg ew estade kalle ante tim benommani: ku auks lorrelinlem i beninle vorteks lorrel, o kua i le vid kodeks kuater lem terinit anporle. ~~i inle vorteks kuad re inbet grav ok orblap ew trakpor vorteks destrak termur. estatim i perle lorrel re inuislor kodeks ad kuad. vorteks tanle uide terailem, uislor inle ailemde, ew kodeks porle des re perle bende pa uide zenmur.~~");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (quality == 1)
|
||||
{
|
||||
|
||||
if (gflags[READ_GARGISH_SCROLL])
|
||||
{
|
||||
showBook();
|
||||
say(" ~~The Book of Administration~~*");
|
||||
|
||||
say("~For countless ages, we winged ones have led the wingless ones. This is right and proper.");
|
||||
say("~But we must always remember that they are no less valuable than we.*");
|
||||
say("~A body with no head cannot move. But neither can a body with no legs. All must function in unity if anything is to be achieved.");
|
||||
say("~So guide the wingless ones, and keep them from paths of error. But guide them with respect..");
|
||||
}
|
||||
else
|
||||
{
|
||||
showBook();
|
||||
say("~~kodeks benmontas~~*");
|
||||
|
||||
say("~~dur anmurde vastim ui volde lem monte anvolde lem. ista ver ew behde.~");
|
||||
say("~~a ui nes tutim reski lem an min persa de ui. zentu ku an uiscar ansa por. a ni sa zentu ku an porcar.~~");
|
||||
say("~~tu nes per te pri si kui re leinle. er duk anvolde lem, ew ark lem de via feltas. a duk lem ku lentas ew vervid.~");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 2)
|
||||
{
|
||||
|
||||
if (gflags[READ_GARGISH_SCROLL])
|
||||
{
|
||||
showBook();
|
||||
say(" ~~The Book of The Underworld~~*");
|
||||
|
||||
say("~Deep below the land there is another land. In that land live many strange creatures. The most interesting of these creatures look something like our wingless ones. These daemons, however, are pale and soft.");
|
||||
say("~Some say that these daemons from the underworld can speak. And, to be sure, they make sounds that are similar to our language.*");
|
||||
say("~But as everyone knows, no creature without wings is truly intelligent. Fables of talking daemons must be discredited...");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
showBook();
|
||||
say("~~kodeks destermur~~*");
|
||||
|
||||
say("~~alt desde terreg ai ali terreg. ante esta terreg manite mur aniw zen. plu tri de ista zen vid zaw ve uide anvolde lem.~");
|
||||
say("~~ista daemon ade pal ew delsa. kualem lokte ista daemon de destermur sa lok. ew kerde, lem inte son esta misve uide liy..~~");
|
||||
say("~~ a kua lemmur uiste, an zen anku vol verde uis. feluis de lokde daemon nes ankredle...~");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (quality == 3)
|
||||
{
|
||||
|
||||
if (gflags[READ_GARGISH_SCROLL])
|
||||
{
|
||||
showBook();
|
||||
say(" ~~The Book of Prosperity~~*");
|
||||
|
||||
say("~Long ago, the great seer Naxatilor summoned the Codex into the world. Thus began the great time of prosperity. The Codex was placed within the Temple of Singularity, there to be viewed by those requiring its knowledge.~");
|
||||
say("~The seers of the land, led by Naxatilor, protected the Codex with a forcefield. Only those upon sacred quests for wisdom are allowed to reach and read the Codex.~");
|
||||
say("~Within the Codex is written the one right and true answer to any problem. One has but to reach the Codex, read it, and interpret its advice properly. With perfect wisdom and infallible knowledge, all that remains is to have the control, passion and diligence required to follow the proper course. These are the underpinnings of our society, and so our race is able to use the Codex wisely and well.~");
|
||||
say("~This is the reason why the Codex exists: to lead the gargoyle race to ultimate prosperity...~");
|
||||
}
|
||||
else
|
||||
{
|
||||
showBook();
|
||||
say("~~kodeks benommani~~*");
|
||||
|
||||
say("~~vas praetim, vas vidlem naksatilor kalle kodeks ante termur. ita rele vastim benommani.~");
|
||||
say("~~kodeks terle ante terort pritas, teresta re vidle pa lem nesde vasuis. vidlem terreg, monle pa naksatilor, juksarkle kodeks ku saeykt grav.~~");
|
||||
say("~~sol lem ad omde vestas trak uis canle terpor ew leg kodeks. ante kodeks skrile pri ben ew ver res kui kuae. lem nes sol terpor kodeks, leg lem, ew inuislok lemde monuis aptade. ku verinde uis ew ankadsa ski, tu mante est ten un, or, ew us nesle re pos apta via. ista est desintas uide murom, ew ita uide zenmur sa per kodeks uisde ew bende. ista est kuauis kodeks est: re mon gar{ zenmur trak ultim benommani~");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 4)
|
||||
{
|
||||
|
||||
if (gflags[READ_GARGISH_SCROLL])
|
||||
{
|
||||
showBook();
|
||||
say(" ~~The Book of Family~~*");
|
||||
|
||||
say("~When a child hatches from his egg, he is born without wings. But even from birth one can tell whether a child will grow up to be a winged or a wingless one. The wingless ones cannot speak, and lack the intelligence of the winged ones. They must be guided.");
|
||||
say("~The winged ones are few, but they are entrusted with the intelligence and wisdom of the race. They must guide.");
|
||||
say("Both winged and wingless ones spring from the same eggs, and both belong to the same family. All function as a single whole, to better maintain the struggle for survival in our world.");
|
||||
}
|
||||
else
|
||||
{
|
||||
showBook();
|
||||
say("~~kodeks xen~~*");
|
||||
|
||||
say("~kuatim betlem grespor de ov, lem inzenle anku vol. a vel de inzen lem sa ski si betlem re invas est volde au anvolde lem.");
|
||||
say("~anvolde lem ansa lok, ew anten skitas de volde lem. lem nes dukle.~");
|
||||
say("~volde lem anmur, a lem kredonle ku skitas ew uis de zenmur. lem nes dukte. sek volde ew anvolde lem sal de mis ov, ew sek dete de mis xen. tu per ve pride tutas, re plu ben inten agratas trak temanitas ante uide termur");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
showBook();
|
||||
say("This is not a valid scroll QUAL attribute! Stop cheating!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
13
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/gems.uc
Executable file
13
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/gems.uc
Executable file
@@ -0,0 +1,13 @@
|
||||
void gems shape#(760) ()
|
||||
{
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
randomPartySay("@Those are beautiful. I am sure they would fetch a high price at the glassblower in Minoc.@");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
52
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/horn.uc
Executable file
52
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/horn.uc
Executable file
@@ -0,0 +1,52 @@
|
||||
void Horn object#(0x378) ()
|
||||
{
|
||||
var horn_x = 1457;
|
||||
var horn_y = 1631;
|
||||
|
||||
const int SHAPE_SILVER_SERPENT = 1226;
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
var rand = UI_die_roll(1, 10);
|
||||
|
||||
UI_play_sound_effect(109); //horn sound
|
||||
//UI_obj_sprite_effect(object obj, int sprite, int rel_x, int rel_y, int vel_x, int vel_y, int frnum, int reps)
|
||||
UI_obj_sprite_effect(item, 24, -1, 1, -1, -1, 0, -1);
|
||||
|
||||
// silver serpent not summoned
|
||||
if (rand > 8)
|
||||
randomPartyBark("@Nothing happened..@");
|
||||
|
||||
// silver serpent summoned at random distance from horn
|
||||
else
|
||||
{
|
||||
|
||||
var rand_x = UI_die_roll(5, 25);
|
||||
var rand_y = UI_die_roll(5, 25);
|
||||
var serpent;
|
||||
|
||||
|
||||
//determine how many serpents are summoned
|
||||
rand = UI_die_roll(1, 3);
|
||||
|
||||
//create serpent and set its alignment
|
||||
serpent = UI_create_new_object2(SHAPE_SILVER_SERPENT, [horn_x + rand_x, horn_y + rand_y]);
|
||||
UI_set_item_flag(serpent, TEMPORARY);
|
||||
UI_set_schedule_type(serpent, IN_COMBAT);
|
||||
UI_set_alignment(serpent, EVIL);
|
||||
UI_set_attack_mode(serpent, BERSERK);
|
||||
randomPartyBark("@Watch out!@");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
void shapeHorseflesh shape#(1252) ()
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
//hunger value of 16 given to it
|
||||
var horseflesh_hunger_level = 16;
|
||||
var rand;
|
||||
|
||||
var target = UI_click_on_item();
|
||||
var target_shape = UI_get_item_shape(target);
|
||||
var not_hungry_response;
|
||||
var eaten_bark;
|
||||
|
||||
// if (!(!target))
|
||||
// abort;
|
||||
|
||||
if (!UI_is_npc(target))
|
||||
abort;
|
||||
|
||||
if (!UI_get_item_flag(target, IN_PARTY))
|
||||
abort;
|
||||
|
||||
//If Iolo has found out he's eating a horse, he refuses
|
||||
if ((target_shape == 465) && (gflags[IOLO_HATES_HORSEFLESH]))
|
||||
{
|
||||
delayedBark(IOLO, "@No thank thee..@", 0);
|
||||
delayedBark(IOLO, "@I cannot in good conscience..@", 4);
|
||||
delayedBark(IOLO, "@..eat horse meat.@", 8);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (UI_get_npc_prop(target, FOODLEVEL) > 24)
|
||||
{
|
||||
not_hungry_response = UI_die_roll(1, 5);
|
||||
UI_clear_item_say(target);
|
||||
|
||||
if ((not_hungry_response == 1) || (not_hungry_response == 2))
|
||||
delayedBark(target, "@No thank thee.@", 0);
|
||||
|
||||
else if ((not_hungry_response == 3) || (not_hungry_response == 4))
|
||||
delayedBark(target, "@I am quite full.@", 0);
|
||||
|
||||
else if (not_hungry_response == 5)
|
||||
delayedBark(target, "@I hunger not.@", 0);
|
||||
|
||||
abort;
|
||||
}
|
||||
else
|
||||
{
|
||||
UI_set_npc_prop(target, FOODLEVEL, horseflesh_hunger_level);
|
||||
UI_remove_item(item);
|
||||
UI_play_sound_effect(91);
|
||||
|
||||
//Add some barks for flavor
|
||||
rand = UI_get_random(5);
|
||||
if (rand == 1)
|
||||
eaten_bark = "@Mmmm..@";
|
||||
else if (rand == 2)
|
||||
eaten_bark = "@Interesting flavor..@";
|
||||
else if (rand == 3)
|
||||
eaten_bark = "@Tastes like chicken..@";
|
||||
else
|
||||
eaten_bark = "@Tasty!@";
|
||||
delayedBark(target, eaten_bark, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
void burnOut object#() ()
|
||||
{
|
||||
UI_set_item_shape(item, 224);//scorch mark
|
||||
UI_set_item_flag(item, TEMPORARY);
|
||||
}
|
||||
|
||||
|
||||
void kindling shape#(1212) () //of course, replace the shape number with whatever it will be in your shapes file
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
var item_in_pack = UI_get_container(item);
|
||||
|
||||
if (item_in_pack == 0)
|
||||
{
|
||||
UI_close_gumps();
|
||||
UI_set_item_shape(item, 825);//campfire
|
||||
|
||||
script item after 6 ticks
|
||||
{
|
||||
frame 1; wait 3;
|
||||
frame 2; wait 3;
|
||||
frame 3; wait 3;
|
||||
frame 4; wait 900;
|
||||
frame 3; wait 30;
|
||||
frame 2; wait 30;
|
||||
frame 1; wait 30;
|
||||
frame 0; wait 30;
|
||||
call burnOut;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
UI_flash_mouse(CURSOR_X);
|
||||
UI_close_gumps();
|
||||
randomPartyBark("@Place it on the ground first.@");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
18
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/lamp.uc
Executable file
18
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/lamp.uc
Executable file
@@ -0,0 +1,18 @@
|
||||
void Lamp shape#(1161) ()
|
||||
{
|
||||
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
item->set_item_shape(SHAPE_LIT_LAMP);
|
||||
UI_play_sound_effect(17);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
99
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/lever.uc
Executable file
99
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/lever.uc
Executable file
@@ -0,0 +1,99 @@
|
||||
const int SHAPE_LEVER_2 = 1143; //shape of added lever in my shapes.vga
|
||||
|
||||
//0x6da is BG usecode egg that opens portc. doors
|
||||
|
||||
|
||||
//Dungeon lever control npcs - junk npcs for item flag purposes
|
||||
|
||||
|
||||
//WRONG = -272, //clone_alagner
|
||||
//BLANKDUNGEON = -273
|
||||
|
||||
|
||||
|
||||
|
||||
void switchLever object#() () //switches levers from correct thrown/pulled position
|
||||
{
|
||||
var lever = UI_find_nearest(AVATAR, SHAPE_LEVER_2, 3); //finds lever 2 tiles away, since 'item' doesn't work here
|
||||
var lever_qual = UI_get_item_quality(lever);
|
||||
var lever_frame = UI_get_item_frame(lever);
|
||||
|
||||
if (lever_frame == 0) UI_set_item_frame(lever, 1); //set up frames correctly
|
||||
else
|
||||
if (lever_frame == 1) UI_set_item_frame(lever, 0); //set up frames correctly
|
||||
else
|
||||
if (lever_frame == 2) UI_set_item_frame(lever, 3); //set up frames correctly
|
||||
else
|
||||
if (lever_frame == 3) UI_set_item_frame(lever, 2); //set up frames correctly
|
||||
|
||||
|
||||
//used for actual functionality of levers (opening doors via usecode eggs out of range)
|
||||
//Set npc with item flag then set usecode egg with it
|
||||
|
||||
if (lever_qual == 0) return; //do nothing
|
||||
else
|
||||
|
||||
if ((lever_qual == 1) && (lever_frame == 3)) //throws switch and sets item flag 'Naked'
|
||||
{
|
||||
UI_set_item_flag(WRONG, NAKED);
|
||||
}
|
||||
else UI_clear_item_flag(WRONG, NAKED); //when switch is thrown again to 'default' frame 4 (horizontal switch), flag clears
|
||||
////////////
|
||||
|
||||
if ((lever_qual == 2) && (lever_frame == 3)) //throws switch and sets item flag 'Naked'
|
||||
{
|
||||
UI_set_item_flag(WRONG, PETRA);
|
||||
}
|
||||
else UI_clear_item_flag(WRONG, PETRA); //when switch is thrown again to 'default' frame 4 (horizontal switch), flag clears
|
||||
///////////
|
||||
|
||||
//
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void pullLever object#() () //motions and sfx for pulling/throwing lever.
|
||||
{
|
||||
|
||||
script AVATAR after 3 ticks
|
||||
{
|
||||
wait 1;
|
||||
actor frame standing; face north;
|
||||
actor frame bowing;
|
||||
wait 1;
|
||||
actor frame standing; face north;
|
||||
sfx 28; //lever sound
|
||||
call switchLever;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void lever shape#(1143) () //main lever code
|
||||
{
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
|
||||
|
||||
var lever_pos = UI_get_object_position(item);
|
||||
var direction = AVATAR->find_direction(item);
|
||||
var lever_frame = UI_get_item_frame(lever);
|
||||
|
||||
var lever_pos_x = (lever_pos[X]); //changed from -2
|
||||
var lever_pos_y = (lever_pos[Y] + 2);
|
||||
|
||||
UI_si_path_run_usecode(AVATAR, [lever_pos_x, lever_pos_y], false, item, pullLever, false);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
void lionStatue shape#(1267) () //
|
||||
{
|
||||
var frame = UI_get_item_frame(item);
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
if (frame == 1)
|
||||
{
|
||||
randomPartyBark("A scroll!");
|
||||
var scroll = UI_create_new_object2(SHAPE_SCROLL, [0923, 1115, 0]);
|
||||
scroll->set_item_quality(73);
|
||||
|
||||
//change statue back to frame 0 so new scrolls cant be generated
|
||||
item->set_item_frame(0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
void LitLamp shape#(1162) ()
|
||||
{
|
||||
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
item->set_item_shape(SHAPE_LAMP);
|
||||
UI_play_sound_effect(18);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
void magic_quill shape#(1256) ()
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
randomizeBooks();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
void moonstone shape#(1139) ()
|
||||
{
|
||||
var frame = UI_get_item_frame(item);
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
var target = UI_click_on_item();
|
||||
var target_shape = UI_get_item_shape(target);
|
||||
if (target_shape == SHAPE_VORTEX_CUBE)
|
||||
{
|
||||
if (frame == 0)
|
||||
gflags[MOONSTONE1] = true;
|
||||
else if (frame == 1)
|
||||
gflags[MOONSTONE2] = true;
|
||||
else if (frame == 2)
|
||||
gflags[MOONSTONE3] = true;
|
||||
else if (frame == 3)
|
||||
gflags[MOONSTONE4] = true;
|
||||
else if (frame == 4)
|
||||
gflags[MOONSTONE5] = true;
|
||||
else if (frame == 5)
|
||||
gflags[MOONSTONE6] = true;
|
||||
else if (frame == 6)
|
||||
gflags[MOONSTONE7] = true;
|
||||
else if (frame == 7)
|
||||
gflags[MOONSTONE8] = true;
|
||||
|
||||
//after adding, check to see if all stones are in vortex cube now
|
||||
if (gflags[MOONSTONE1] && gflags[MOONSTONE2] && gflags[MOONSTONE3] && gflags[MOONSTONE4] && gflags[MOONSTONE5] && gflags[MOONSTONE6] && gflags[MOONSTONE7] && gflags[MOONSTONE8])
|
||||
gflags[VORTEX_CUBE_FULL] = true;
|
||||
|
||||
UI_close_gumps();
|
||||
UI_obj_sprite_effect(target, 13, 0, 0, 0, 0, 0, -1);
|
||||
UI_play_sound_effect(68);
|
||||
UI_remove_item(item);
|
||||
|
||||
}
|
||||
else
|
||||
UI_flash_mouse(CURSOR_X);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
//This is used after landing and after 3 ticks or so (adjust)
|
||||
//It switches the shape back to the original
|
||||
|
||||
|
||||
void newballoon shape#(1233) ()
|
||||
{
|
||||
|
||||
const int SHAPE_BALLOON = 1201;
|
||||
var barge = get_barge();
|
||||
var party = UI_get_party_list();
|
||||
var newballoon = UI_find_nearest(AVATAR, SHAPE_NEW_BALLOON, 31); //
|
||||
var quality = UI_get_item_quality(item);
|
||||
var basket_pos = UI_get_object_position(item);
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
if (gflags[BALLOON_IS_FLYING])
|
||||
{
|
||||
var barge = UI_find_nearby(basket_pos, 961, 10, MASK_EGG); //hopefully find the barge before placing
|
||||
var balloon = UI_find_nearest(AVATAR, SHAPE_NEW_BALLOON, 31); //
|
||||
|
||||
//First check to see if Avatar is over the Codex shrine to prevent early access:
|
||||
var isNearCodex = UI_find_nearest(AVATAR, 1125, 60);
|
||||
|
||||
if (isNearCodex)
|
||||
randomPartySay("@Some strange force is preventing us from landing here!@");
|
||||
else if (barge->get_item_flag(OKAY_TO_LAND))
|
||||
{
|
||||
|
||||
// Yes; so begin process of landing.
|
||||
// Flag 10 = 'on moving barge'
|
||||
barge->clear_item_flag(10);
|
||||
// Flag 26 = 'in motion'
|
||||
barge->clear_item_flag(26);
|
||||
// Make carpet descent until the ground.
|
||||
// Flag 10 = 'on moving barge'
|
||||
balloon->clear_item_flag(10);
|
||||
// Flag 26 = 'in motion'
|
||||
balloon->clear_item_flag(26);
|
||||
|
||||
// Flag 10 = 'on moving barge'
|
||||
AVATAR->clear_item_flag(10);
|
||||
// Flag 26 = 'in motion'
|
||||
AVATAR->clear_item_flag(26);
|
||||
UI_clear_item_flag(AVATAR, SAILOR);
|
||||
|
||||
//sound effect
|
||||
UI_play_sound_effect(89);
|
||||
|
||||
//cut the music
|
||||
UI_play_music(255);
|
||||
|
||||
//may not be necessary:
|
||||
UI_halt_scheduled(AVATAR);
|
||||
|
||||
script item
|
||||
{
|
||||
|
||||
repeat 9
|
||||
{
|
||||
descent; //should lift item on z level 9
|
||||
};
|
||||
wait 5;
|
||||
|
||||
|
||||
}
|
||||
script barge after 20 ticks
|
||||
{
|
||||
call renderParty;
|
||||
|
||||
|
||||
}
|
||||
|
||||
script AVATAR
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
descent; //should lift item on z level 9
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (npc in party)
|
||||
{
|
||||
script npc
|
||||
{
|
||||
repeat 9
|
||||
{
|
||||
descent; //should lift item on z level 9
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//UI_remove_item(barge);
|
||||
UI_set_item_shape(item, SHAPE_BALLOON); //switch back to regular balloon
|
||||
UI_set_item_quality(item, 1); //to allow packing
|
||||
gflags[BALLOON_IS_FLYING] = false;
|
||||
|
||||
}
|
||||
else
|
||||
randomPartySay("@I do not believe we can land here safely.@");
|
||||
|
||||
}
|
||||
else //gflag is true or item frame == 0
|
||||
{
|
||||
//UI_set_item_shape(item, SHAPE_PACKED_BALLOON);
|
||||
UI_set_item_quality(item, 1);
|
||||
gflags[BALLOON_IS_FLYING] = false;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//this should be called when the balloon is in the air. Checks to make sure you are staying in the right bounds
|
||||
if (event == SCRIPTED)
|
||||
{
|
||||
UI_error_message("Balloon scripted event is called while in the air.");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,748 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
* This source file contains the code for the Improved Orb of the Moons.
|
||||
*
|
||||
* Author: Marzo Junior
|
||||
* Last Modified: 2006-02-27
|
||||
*/
|
||||
|
||||
/* The old Moongate destinations:
|
||||
enum moongate_destinations
|
||||
{
|
||||
BRITAIN = 1,
|
||||
JHELOM = 2,
|
||||
YEW = 3,
|
||||
MINOC = 4,
|
||||
TRINSIC = 5,
|
||||
NEW_MAGINCIA = 6,
|
||||
SKARA_BRAE = 7,
|
||||
SPIRITUALITY = 8
|
||||
MOONGLOW = 9,
|
||||
};
|
||||
*/
|
||||
|
||||
enum moongate_destinations_new
|
||||
{
|
||||
BRITAIN = 1,
|
||||
JHELOM = 2,
|
||||
YEW = 3,
|
||||
MINOC = 4,
|
||||
TRINSIC = 5,
|
||||
SKARA_BRAE = 6,
|
||||
NEW_MAGINCIA = 7,
|
||||
MOONGLOW = 8,
|
||||
COMPASSION = 9,
|
||||
VALOR = 10,
|
||||
JUSTICE = 11,
|
||||
SACRIFICE = 12,
|
||||
HONOR = 13,
|
||||
SPIRITUALITY = 14,
|
||||
HUMILITY = 15,
|
||||
HONESTY = 16
|
||||
|
||||
/*
|
||||
//Maybe I will add these locations in the future:
|
||||
CASTLE_BRITISH = 17,
|
||||
SERPENTS_HOLD = 18,
|
||||
STONEGATE = 19, //Some other location, maybe?
|
||||
ISLE_OF_AVATAR = 20,
|
||||
EMPATH_ABBEY = 21,
|
||||
TERFIN_SHRINE = 22,
|
||||
LYCAEUM = 23,
|
||||
????? = 24
|
||||
*/
|
||||
};
|
||||
|
||||
var isOrbMoongate 0x826 (var itemref)
|
||||
{
|
||||
var orbmoongates;
|
||||
orbmoongates = [SHAPE_ORB_MOONGATE_HORIZONTAL, SHAPE_ORB_MOONGATE_NW_SE,
|
||||
SHAPE_ORB_MOONGATE_VERTICAL, SHAPE_ORB_MOONGATE_NE_SW];
|
||||
if ((itemref->get_item_shape()) in orbmoongates)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
var getMoongateDestination 0x823 (var moongate)
|
||||
{
|
||||
/* Old destinations:
|
||||
//The coordinates of moongate destinations (changed to reflect the multi-map Britannia):
|
||||
dest_X = [0x04dF, 0x0105, 0x0207, 0x073F, 0x03FF, 0x087F, 0x0237, 0x0B67, 0x0B3F];
|
||||
dest_Y = [0x0550, 0x0B0A, 0x01EB, 0x0192, 0x0983, 0x0922, 0x0649, 0x0963, 0x0712];
|
||||
dest_Z = [0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000];
|
||||
dest_map = [0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000];
|
||||
*/
|
||||
|
||||
//The coordinates of moongate destinations. These are also the destinations
|
||||
//of "standard" blue moongates. If you compare with the above, you'll see
|
||||
//that I switched Skara Brae with New Magincia. This is so the Orb works
|
||||
//closer to the one from U6. Whatever differences are left from U6 (and
|
||||
//there are many) I blame on the sphere generator :-).
|
||||
var dest_X = [
|
||||
//Cities: Britain, Jhelom, Yew, Minoc, Trinsic,
|
||||
0x054F, 0x0105, 0x02b7, 0x07dF, 0x046f,
|
||||
// Skara Brae, New Magincia Moonglow
|
||||
0x00af, 0x08bF, 0x0ac0,
|
||||
|
||||
//Shrines: Compassion, Valor, Justice, Sacrifice, Honor,
|
||||
0x0606, 0x01FB, 0x0386, 0x9b9, 0x03b1,
|
||||
|
||||
// Spirituality, Humility, Honesty
|
||||
0x098a, 0x0B07, 0x0A99
|
||||
];
|
||||
|
||||
var dest_Y = [
|
||||
//Cities: Britain, Jhelom, Yew, Minoc, Trinsic,
|
||||
0x04df, 0x0B0A, 0x01a7, 0x00cf, 0x098f,
|
||||
// Skara Brae, New Magincia Moonglow
|
||||
0x05ff, 0x083f, 0x05e0,
|
||||
//Shrines: Compassion, Valor, Justice, Sacrifice, Honor,
|
||||
0x0460, 0x0A70, 0x0070, 0x1fd, 0x09f6,
|
||||
// Spirituality, Humility, Honesty
|
||||
0x0498, 0x0B0a, 0x048C
|
||||
];
|
||||
|
||||
var dest_Z = [
|
||||
//Cities: Britain, Jhelom, Yew, Minoc, Trinsic,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0001,
|
||||
// Skara Brae, New Magincia Moonglow
|
||||
0x0000, 0x0000, 0x0002,
|
||||
//Shrines: Compassion, Valor, Justice, Sacrifice, Honor,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
// Spirituality, Humility, Honesty
|
||||
0x0001, 0x0000, 0x0000
|
||||
];
|
||||
|
||||
var dest_map = [
|
||||
//Cities: Britain, Jhelom, Yew, Minoc, Trinsic,
|
||||
0, 0, 0, 0, 0,
|
||||
// Skara Brae, New Magincia Moonglow
|
||||
0, 0, 0,
|
||||
//Shrines: Compassion, Valor, Justice, Sacrifice, Honor,
|
||||
0, 0, 0, 0, 0,
|
||||
// Spirituality, Humility, Honesty
|
||||
1, 0, 0
|
||||
];
|
||||
|
||||
var dest_index;
|
||||
var dest_pos;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Get moongate quality = destination index:
|
||||
dest_index = (moongate->get_item_quality() + 1);
|
||||
|
||||
//Blue moongates should only take the avatar to places with blue moongates;
|
||||
//this happens only in the exit from the Shrine of Spirituality, which should
|
||||
//take us to Skara Brae (Moonglow in the original):
|
||||
if (!isOrbMoongate(moongate) && (dest_index > 8)) dest_index = SKARA_BRAE;
|
||||
|
||||
//If the orb hasn't been fixed, we can't visit the Timelord:
|
||||
//if ((!gflags[ORB_FIXED_TIMELORD]) && (dest_index == SPIRITUALITY)) dest_index = SKARA_BRAE;
|
||||
//the original takes the avatar to Moonglow instead.
|
||||
|
||||
//Return the exit coordinates of the moongate:
|
||||
dest_pos = [dest_X[dest_index], dest_Y[dest_index], dest_Z[dest_index], dest_map[dest_index]];
|
||||
|
||||
//return the destination coordinates:
|
||||
return dest_pos;
|
||||
}
|
||||
|
||||
void enterMoongate 0x824 (var moongate)
|
||||
{
|
||||
var avatar_pos;
|
||||
var moongate_pos = UI_get_object_position(moongate);
|
||||
var moongate_shape;
|
||||
var var0004;
|
||||
var quality = UI_get_item_quality(moongate);
|
||||
|
||||
var destination;
|
||||
|
||||
//town coords
|
||||
var britain = [1360, 1247, 0, 0];
|
||||
var trinsic = [1135, 2447, 0, 0];
|
||||
var yew = [0695, 0425, 0, 0];
|
||||
var skara = [0175, 1535, 0, 0];
|
||||
var minoc = [2015, 0207, 0, 0];
|
||||
var jhelom = [0400, 2688, 0, 0];
|
||||
var new_magincia = [2240, 2112, 0, 0];
|
||||
var moonglow = [2751, 1504, 0, 0];
|
||||
|
||||
//shrine coords
|
||||
var humility = [2800, 2858, 0, 0];
|
||||
var justice = [0911, 0131, 0, 0];
|
||||
var honor = [0943, 2582, 0, 0];
|
||||
var sacrifice = [2513, 0530, 0, 0];
|
||||
var compassion = [1554, 1141, 0, 0];
|
||||
var valor = [0432, 2911, 0, 0];
|
||||
var honesty = [2858, 0826, 0, 0];
|
||||
var spirituality = [2457, 1198, 0, 1];
|
||||
|
||||
|
||||
//other coords
|
||||
// gargoyle lands are protected by global flags, only avaliable once you reach it
|
||||
var the_slab = [1576, 1333, 0, 3];
|
||||
var diligence = [1568, 1740, 0, 3];
|
||||
var control = [1401, 1170, 0, 3];
|
||||
var passion = [1719, 1167, 0, 3];
|
||||
|
||||
var isle_of_avatar = [2808, 2687, 0, 0];
|
||||
var lb_throneroom = [0935, 1070, 0, 0];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Fade to black:
|
||||
UI_fade_palette(12, 1, 0);
|
||||
|
||||
//Moongate travel sound:
|
||||
UI_play_sound_effect2(SOUND_MOONGATE, item);
|
||||
|
||||
//Teleport avatar to destination:
|
||||
// var dest = getMoongateDestination(moongate);
|
||||
|
||||
if (quality == 0)//void
|
||||
destination = moongate_pos;
|
||||
else if (quality == 1)
|
||||
destination = compassion;
|
||||
else if (quality == 2)
|
||||
destination = honesty;
|
||||
else if (quality == 3)
|
||||
destination = britain;
|
||||
else if (quality == 4)
|
||||
destination = lb_throneroom;
|
||||
else if (quality == 5)
|
||||
destination = jhelom;
|
||||
else if (quality == 6)
|
||||
destination = passion;
|
||||
else if (quality == 7)
|
||||
destination = valor;
|
||||
else if (quality == 8)
|
||||
destination = justice;
|
||||
else if (quality == 9)
|
||||
destination = yew;
|
||||
else if (quality == 10)
|
||||
destination = minoc;
|
||||
else if (quality == 11)
|
||||
destination = isle_of_avatar;
|
||||
else if (quality == 12)
|
||||
destination = sacrifice;
|
||||
else if (quality == 13)
|
||||
destination = honor ;
|
||||
else if (quality == 14)
|
||||
destination = trinsic;
|
||||
else if (quality == 15)
|
||||
destination = diligence;
|
||||
else if (quality == 16)
|
||||
destination = skara;
|
||||
else if (quality == 17)
|
||||
destination = the_slab;
|
||||
else if (quality == 18)
|
||||
destination = humility;
|
||||
else if (quality == 19)
|
||||
destination = spirituality;
|
||||
else if (quality == 20)
|
||||
destination = new_magincia;
|
||||
else if (quality == 21)
|
||||
destination = moonglow;
|
||||
else if (quality == 22)
|
||||
destination = control;
|
||||
else
|
||||
destination = moongate_pos;
|
||||
|
||||
UI_error_message("Quality is " + quality + " and destination is: " + destination);
|
||||
|
||||
PARTY->move_object(destination);
|
||||
|
||||
script AVATAR {nohalt; call exitMoongate;};
|
||||
|
||||
}
|
||||
|
||||
void Orb_of_the_Moons shape#(0x311) ()
|
||||
{
|
||||
var target;
|
||||
var target_coords;
|
||||
var direction;
|
||||
var coordinate;
|
||||
var moongate_shape;
|
||||
var counter;
|
||||
var blocked;
|
||||
var moongate;
|
||||
var arrived_dest;
|
||||
var distance;
|
||||
var avatar_pos;
|
||||
var coord_offset;
|
||||
|
||||
var quality; //used to set for correct destination
|
||||
|
||||
var destination;
|
||||
|
||||
//town coords
|
||||
var britain_coords = [1360, 1247, 0, 0];
|
||||
var trinsic_coords = [1135, 2447, 0, 0];
|
||||
var yew_coords = [0695, 0243, 0, 0];
|
||||
var skara_coords = [0175, 1535, 0, 0];
|
||||
var minoc_coords = [2015, 0207, 0, 0];
|
||||
var jhelom_coords = [0400, 2688, 0, 0];
|
||||
var new_magincia_coords = [2240, 2112, 0, 0];
|
||||
var moonglow_coords = [2751, 1504, 0, 0];
|
||||
|
||||
//shrine coords
|
||||
var humility = [2800, 2858, 0, 0];
|
||||
var justice = [0911, 0131, 0, 0];
|
||||
var honor = [0943, 2582, 0, 0];
|
||||
var sacrifice = [2513, 0530, 0, 0];
|
||||
var compassion = [1554, 1141, 0, 0];
|
||||
var valor = [0432, 2911, 0, 0];
|
||||
var honesty = [0943, 2582, 0, 0];
|
||||
var spirituality = [2457, 1198, 0, 1];
|
||||
|
||||
|
||||
//other coords
|
||||
// gargoyle lands are protected by global flags, only avaliable once you reach it
|
||||
var the_slab = [1576, 1333, 0, 3];
|
||||
var diligence = [1568, 1740, 0, 3];
|
||||
var control = [1401, 1170, 0, 3];
|
||||
var passion = [1719, 1167, 0, 3];
|
||||
|
||||
var isle_of_avatar = [2808, 2687, 0, 0];
|
||||
var lb_throneroom = [0935, 1070, 0, 0];
|
||||
|
||||
|
||||
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
if (!gflags[ASKED_LB_ABOUT_ORB])
|
||||
{
|
||||
delayedBark(AVATAR, "@I don't know how to use this..@", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
//I prefer this here to help the player choose a
|
||||
//target (no gumps in the way and all...):
|
||||
UI_close_gumps();
|
||||
|
||||
//Prompt for target:
|
||||
target = UI_click_on_item();
|
||||
|
||||
//Get the target's coordinates:
|
||||
target_coords = getClickPosition(target);
|
||||
|
||||
//Make avatar face moongate.
|
||||
script AVATAR {face target;};
|
||||
|
||||
|
||||
//Find the direction of the throw:
|
||||
direction = AVATAR->find_direction(target_coords);
|
||||
UI_error_message("Avatar direction from target coords is " + direction);
|
||||
|
||||
//Get avatar position:
|
||||
avatar_pos = AVATAR->get_object_position();
|
||||
|
||||
|
||||
var moongateshapes = [SHAPE_ORB_MOONGATE_HORIZONTAL, SHAPE_ORB_MOONGATE_NW_SE, SHAPE_ORB_MOONGATE_VERTICAL,
|
||||
SHAPE_ORB_MOONGATE_NE_SW, SHAPE_ORB_MOONGATE_HORIZONTAL, SHAPE_ORB_MOONGATE_NW_SE,
|
||||
SHAPE_ORB_MOONGATE_VERTICAL, SHAPE_ORB_MOONGATE_NE_SW];
|
||||
|
||||
|
||||
|
||||
var dist_x = (target_coords[X] - avatar_pos[X]);
|
||||
UI_error_message("Dist x is " + dist_x);
|
||||
|
||||
var dist_y = (target_coords[Y] - avatar_pos[Y]) * -1;
|
||||
UI_error_message("Dist y is " + dist_y);
|
||||
|
||||
|
||||
//find proper moongate shape and destination
|
||||
|
||||
|
||||
//center column of "U6 grid"
|
||||
if (dist_x > -3 && dist_x < 3)
|
||||
{
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_HORIZONTAL;
|
||||
if (dist_y > -3 && dist_y < 2)
|
||||
quality = 0; //void
|
||||
else if (dist_y < -3 && dist_y > -8)
|
||||
{
|
||||
if (gflags[FOUND_DILIGENCE])
|
||||
quality = 15; //Shrine of Diligence
|
||||
else
|
||||
quality = 0; //haven't visited shrine yet
|
||||
}
|
||||
else if (dist_y < -8)
|
||||
quality = 14; //Trinsic;
|
||||
else if (dist_y > 2 && dist_y < 8)
|
||||
quality = 4;//lb_throneroom;
|
||||
else
|
||||
quality = 3; //britain_coords;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
//2nd column (left)
|
||||
else if (dist_x > -8 && dist_x < -2)
|
||||
{
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_HORIZONTAL;
|
||||
|
||||
if (dist_y > 7)
|
||||
quality = 2; // Honesty shrine
|
||||
else if (dist_y < 7 && dist_y > 2)
|
||||
{
|
||||
if (gflags[FOUND_CONTROL])
|
||||
quality = 22; //CONTROL
|
||||
else
|
||||
quality = 0; //haven't visited Control yet
|
||||
moongate_shape = 1114;
|
||||
|
||||
|
||||
}
|
||||
else if (dist_y < 3 && dist_y > -3)
|
||||
{
|
||||
quality = 20; // New Magincia
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_VERTICAL;
|
||||
}
|
||||
else if (dist_y < -2 && dist_y > -8)
|
||||
{
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_NE_SW;
|
||||
if (gflags[FOUND_SLAB])
|
||||
quality = 17; //The Slab
|
||||
else
|
||||
quality = 0; //haven't visited Slab yet
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
quality = 13; // Shrine of Honor
|
||||
|
||||
|
||||
}
|
||||
//1st column
|
||||
else if (dist_x < -7)
|
||||
{
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_HORIZONTAL;
|
||||
if (dist_y > 7)
|
||||
{
|
||||
quality = 21; //Moonglow
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_NW_SE;
|
||||
}
|
||||
else if (dist_y < 7 && dist_y > 2)
|
||||
{
|
||||
quality = 18; //Shrine of Humility
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_HORIZONTAL;
|
||||
|
||||
|
||||
}
|
||||
else if (dist_y < 3 && dist_y > -3)
|
||||
{
|
||||
quality = 20; // New Magincia
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_VERTICAL;
|
||||
}
|
||||
else if (dist_y < -2 && dist_y > -8)
|
||||
{
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_HORIZONTAL;
|
||||
quality = 19; //Shrine of Spirituality
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
quality = 16; //Skara Brae
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_NE_SW;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
//4th column (right)
|
||||
else if (dist_x > 2 && dist_x < 8)
|
||||
{
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_HORIZONTAL;
|
||||
if (dist_y > 7)
|
||||
quality = 1; //compassion;
|
||||
else if (dist_y < 7 && dist_y > 2)
|
||||
{
|
||||
if (gflags[FOUND_PASSION])
|
||||
quality = 6; //Shrine of passion
|
||||
else
|
||||
quality = 0; //haven't visited Control yet
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_NE_SW;
|
||||
|
||||
|
||||
}
|
||||
else if (dist_y < 3 && dist_y > -3)
|
||||
{
|
||||
quality = 9; // Yew
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_VERTICAL;
|
||||
}
|
||||
else if (dist_y < -2 && dist_y > -8)
|
||||
{
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_NW_SE;
|
||||
quality = 11; //isle of the avatar
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
quality = 12; //Shrine of Sacrifice
|
||||
|
||||
|
||||
|
||||
}
|
||||
//5th column
|
||||
else if (dist_x > 7)
|
||||
{
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_HORIZONTAL;
|
||||
if (dist_y > 7)
|
||||
{
|
||||
UI_error_message("Destination should be Jhelom");
|
||||
quality = 5; //Jhelom_coords;
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_NE_SW;
|
||||
}
|
||||
else if (dist_y < 7 && dist_y > 2)
|
||||
{
|
||||
quality = 7; //Shrine of Valor
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_HORIZONTAL;
|
||||
|
||||
|
||||
}
|
||||
else if (dist_y < 3 && dist_y > -3)
|
||||
{
|
||||
quality = 9; // Yew
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_VERTICAL;
|
||||
}
|
||||
else if (dist_y < -2 && dist_y > -8)
|
||||
{
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_HORIZONTAL;
|
||||
quality = 8; //Shrine of Justice
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
quality = 10; //minoc_coords;
|
||||
moongate_shape = SHAPE_ORB_MOONGATE_NW_SE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
UI_error_message("Moongate quality is " + quality);
|
||||
|
||||
|
||||
|
||||
|
||||
//Change the position to make moongate centered on target pos:
|
||||
//target_coords[coordinate] = (target_coords[coordinate] + 2);
|
||||
|
||||
if ((direction == NORTH) || (direction == SOUTH))
|
||||
target_coords[X] = (target_coords[X] + 2);
|
||||
else if ((direction == EAST) || (direction == WEST))
|
||||
target_coords[Y] = (target_coords[Y] + 2);
|
||||
else
|
||||
{
|
||||
target_coords[X] = (target_coords[X] + 1);
|
||||
target_coords[Y] = (target_coords[Y] + 1);
|
||||
}
|
||||
|
||||
//See if the target destination is blocked:
|
||||
blocked = (!UI_is_not_blocked(target_coords, moongate_shape, 0));
|
||||
|
||||
if (blocked)
|
||||
{
|
||||
UI_error_message("Error - moongate blocked");
|
||||
//It is blocked; attempt to circumvent it by incrementing
|
||||
//the Z coordinate and give up trying after 3 tries:
|
||||
counter = 3;
|
||||
while (counter)
|
||||
{
|
||||
target_coords[Z] = (target_coords[Z] + 1);
|
||||
blocked = (!UI_is_not_blocked(target_coords, moongate_shape, 0));
|
||||
if (!blocked) counter = 0;
|
||||
else counter = counter - 1;
|
||||
}
|
||||
|
||||
//If it is still blocked, tell it to the player
|
||||
//and then leave:
|
||||
if (blocked)
|
||||
{
|
||||
UI_flash_mouse(0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Create the moongate:
|
||||
moongate = UI_create_new_object(moongate_shape);
|
||||
|
||||
//set moongate quality for destination:
|
||||
moongate->set_item_quality(quality);
|
||||
|
||||
//Could not create moongate, so bail out:
|
||||
if (!moongate)
|
||||
{
|
||||
UI_error_message("Moongate aborted for some reason");
|
||||
return;
|
||||
}
|
||||
//Move the moongate to the target position:
|
||||
UI_update_last_created(target_coords);
|
||||
|
||||
//Undoes the change made above, in preparation
|
||||
//to move the avatar to the right spot:
|
||||
if ((direction == NORTH) || (direction == SOUTH))
|
||||
target_coords[X] = (target_coords[X] - 2);
|
||||
else if ((direction == EAST) || (direction == WEST))
|
||||
target_coords[Y] = (target_coords[Y] - 2);
|
||||
else
|
||||
{
|
||||
target_coords[X] = (target_coords[X] - 1);
|
||||
target_coords[Y] = (target_coords[Y] - 1);
|
||||
}
|
||||
|
||||
//Moongate music:
|
||||
UI_play_music(0x0033, 0);
|
||||
|
||||
//Mark moongate as temporary, to avoid filling Britannia
|
||||
//with nonfunctional moongates:
|
||||
moongate->set_item_flag(TEMPORARY);
|
||||
|
||||
//Makes the moongate rise from the ground, animate for a while
|
||||
//then sink back to the ground and disappear:
|
||||
script moongate
|
||||
{
|
||||
frame 0;
|
||||
repeat 3 next frame;;
|
||||
repeat 6
|
||||
{
|
||||
repeat 6 next frame;;
|
||||
frame 4;
|
||||
};
|
||||
repeat 3 previous frame;;
|
||||
remove;
|
||||
}
|
||||
|
||||
//Determine the distance between Avatar and moongate:
|
||||
distance = AVATAR->get_distance(moongate);
|
||||
|
||||
|
||||
//Make avatar face moongate.
|
||||
// script AVATAR {face direction;};
|
||||
|
||||
//Give a small delay to avatar. Only needed for moongates
|
||||
//created very close to the avatar:
|
||||
distance = 5 - distance;
|
||||
if (distance > 0) script AVATAR {wait distance;};
|
||||
|
||||
//Get avatar position:
|
||||
avatar_pos = AVATAR->get_object_position();
|
||||
|
||||
//Determine coord offset for avatar destination:
|
||||
if (!(direction in [EAST, WEST]))
|
||||
{
|
||||
UI_error_message("Destionation is in East / West");
|
||||
if ((target_coords[Y] < avatar_pos[Y])) coord_offset = 1;
|
||||
else coord_offset = -1;
|
||||
target_coords[Y] = (target_coords[Y] + coord_offset);
|
||||
}
|
||||
if (!(direction in [NORTH, SOUTH]))
|
||||
{
|
||||
UI_error_message("Destionation is in North / South");
|
||||
if ((target_coords[X] < avatar_pos[X])) coord_offset = 1;
|
||||
else coord_offset = -1;
|
||||
target_coords[X] = (target_coords[X] + coord_offset);
|
||||
}
|
||||
|
||||
|
||||
arrived_dest = UI_path_run_usecode(target_coords, Orb_of_the_Moons, moongate, PATH_SUCCESS);
|
||||
|
||||
if (arrived_dest)
|
||||
{
|
||||
UI_error_message("arrived_dest is true");
|
||||
//UI_set_path_failure(function, itemref, eventid)
|
||||
// Should the avatar not reach the destination, (say,
|
||||
// because the player moved to somewhere else while
|
||||
// the avatar was still walking), this will call
|
||||
// function with event = eventid and item = itemref.
|
||||
UI_set_path_failure(Orb_of_the_Moons, moongate, PATH_FAILURE);
|
||||
|
||||
//See if the orb is in party's possession:
|
||||
if (!(getOuterContainer(item) in UI_get_party_list()))
|
||||
{
|
||||
//... delete it from wherever it was...
|
||||
remove_item();
|
||||
|
||||
//... and give it back to the avatar:
|
||||
UI_add_party_items(1, SHAPE_ORB, 0, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
//Destination unreachable, close moongate:
|
||||
else
|
||||
{
|
||||
closeOrbMoongate(moongate);
|
||||
UI_error_message("arrived_dest is false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//The player interrupted the avatar before reaching the moongate:
|
||||
if (event == PATH_FAILURE)
|
||||
{
|
||||
UI_error_message("Path failure");
|
||||
//Sanity check: make sure we ARE talking about a moongate:
|
||||
if (isOrbMoongate(item))
|
||||
{
|
||||
//Close the moongate:
|
||||
closeOrbMoongate(item);
|
||||
|
||||
//Make fun of the player:
|
||||
randomPartyBark(["@No, Avatar.@", "@Let thyself enter.@"]);
|
||||
}
|
||||
}
|
||||
|
||||
//The avatar reached the moongate:
|
||||
else if (event == PATH_SUCCESS)
|
||||
{
|
||||
UI_error_message("Path success");
|
||||
//Make sure it IS a moongate...
|
||||
if (isOrbMoongate(item))
|
||||
{
|
||||
//Close the moongate:
|
||||
closeOrbMoongate(item);
|
||||
|
||||
|
||||
|
||||
//Teleport avatar:
|
||||
enterMoongate(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
void packed_balloon shape#(1232) ()
|
||||
{
|
||||
|
||||
|
||||
var barge = get_barge();
|
||||
var party = UI_get_party_list();
|
||||
var newballoon = UI_find_nearest(AVATAR, SHAPE_NEW_BALLOON, 31); //
|
||||
var quality = UI_get_item_quality(item);
|
||||
var basket_pos = UI_get_object_position(item);
|
||||
|
||||
if ((event == DOUBLECLICK) && (get_distance(AVATAR) < 6))
|
||||
{
|
||||
|
||||
if ((UI_get_container(item) == 0)) //checks if on the ground and not in container
|
||||
{
|
||||
if (!UI_is_pc_inside(item)) //checks if no roof above
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_BALLOON);
|
||||
UI_set_item_frame(item, 0);
|
||||
//play SFX ?
|
||||
UI_play_sound_effect(88);
|
||||
//add animations - Avatar bowing
|
||||
}
|
||||
else randomPartyBark("@The balloon can't be used here.@");
|
||||
}
|
||||
else randomPartyBark("@Place it on the ground first..@");
|
||||
|
||||
|
||||
}
|
||||
else randomPartyBark("@Get a little closer to it..@");
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
void panpipes shape#(1165) ()
|
||||
{
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
49
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/raft.uc
Executable file
49
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/raft.uc
Executable file
@@ -0,0 +1,49 @@
|
||||
void raft shape#(1241) ()
|
||||
{
|
||||
var barge = get_barge();
|
||||
var party = UI_get_party_list();
|
||||
var raft_pos = UI_get_object_position(item);
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
if (UI_get_item_flag(AVATAR, ON_MOVING_BARGE)) //checks to see if already using raft, if so, then disengage
|
||||
{
|
||||
UI_clear_item_flag(AVATAR, SAILOR);
|
||||
UI_clear_item_flag(AVATAR, ON_MOVING_BARGE);
|
||||
UI_clear_item_flag(AVATAR, IN_MOTION);
|
||||
|
||||
UI_halt_scheduled(item);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
//To add: party limit of 6?
|
||||
{
|
||||
if (!UI_find_nearby(raft_pos, 961, 10, MASK_EGG)) //will create barge if one not found
|
||||
{
|
||||
UI_create_barge_object(8, 8, NORTH);
|
||||
UI_update_last_created([raft_pos]);
|
||||
}
|
||||
if (UI_on_barge()) //everyone should be on barge, if not, they complain
|
||||
{
|
||||
UI_set_item_flag(AVATAR, SAILOR);
|
||||
UI_set_item_flag(AVATAR, ON_MOVING_BARGE);
|
||||
UI_set_item_flag(AVATAR, IN_MOTION);
|
||||
|
||||
script item // after 6 ticks
|
||||
{
|
||||
call DeepWater;
|
||||
// say "@deep water script called@"; //remove after testing
|
||||
};
|
||||
|
||||
}
|
||||
else
|
||||
randomPartySay("@Not everyone is on the raft yet!@");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
329
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/rawmeat.uc
Executable file
329
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/rawmeat.uc
Executable file
@@ -0,0 +1,329 @@
|
||||
|
||||
void meatBurnt object#() ()
|
||||
{
|
||||
UI_remove_item(item);
|
||||
UI_clear_item_flag(AVATAR, BG_DONT_MOVE);
|
||||
var rand = UI_die_roll(0, 3);
|
||||
|
||||
if (rand == 0) randomPartyBark("@Thou cooked it too long!@");
|
||||
else if (rand == 1) randomPartyBark("@Thou cooked it too long!@");
|
||||
else if (rand == 2) randomPartyBark("@'Tis burnt to a crisp!@");
|
||||
else if (rand == 3) randomPartyBark("@Such a waste..@");
|
||||
|
||||
}
|
||||
|
||||
void meatCooked object#() ()
|
||||
{
|
||||
var meat_type = UI_get_item_shape(item);
|
||||
|
||||
UI_clear_item_flag(AVATAR, BG_DONT_MOVE);
|
||||
if (meat_type == SHAPE_RAW_BEEF)
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_FOOD);
|
||||
UI_set_item_frame(item, FRAME_BEEF);
|
||||
UI_set_item_flag(item, OKAY_TO_TAKE);
|
||||
randomPartyBark("@Mmmm smells good!@");
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
if (meat_type == SHAPE_RAW_CHICKEN)
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_FOOD);
|
||||
UI_set_item_frame(item, FRAME_CHICKEN);
|
||||
UI_set_item_flag(item, OKAY_TO_TAKE);
|
||||
randomPartyBark("@Mmmm smells good!@");
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
if (meat_type == SHAPE_RAW_MUTTON)
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_FOOD);
|
||||
UI_set_item_frame(item, FRAME_MUTTON);
|
||||
UI_set_item_flag(item, OKAY_TO_TAKE);
|
||||
randomPartyBark("@Mmmm smells good!@");
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
if (meat_type == SHAPE_RAW_VENISON)
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_FOOD);
|
||||
UI_set_item_frame(item, FRAME_VENISON);
|
||||
UI_set_item_flag(item, OKAY_TO_TAKE);
|
||||
randomPartyBark("@Mmmm smells good!@");
|
||||
}
|
||||
|
||||
else if (meat_type == SHAPE_RAW_RABBIT)
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_FOOD);
|
||||
UI_set_item_frame(item, FRAME_VENISON); //change to rabbit food shape when implemented
|
||||
UI_set_item_flag(item, OKAY_TO_TAKE);
|
||||
randomPartyBark("@Mmmm smells good!@");
|
||||
}
|
||||
|
||||
if (meat_type == SHAPE_RAW_PORK)
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_FOOD);
|
||||
UI_set_item_frame(item, FRAME_HAM); //change to rabbit food shape when implemented
|
||||
UI_set_item_flag(item, OKAY_TO_TAKE);
|
||||
randomPartyBark("@Mmmm smells good!@");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void cookingMeat object#() ()
|
||||
{
|
||||
const int SFX_COOKING = 20;
|
||||
var cooking_success = UI_die_roll(0, 5);//gives 1 in 5 chances of success
|
||||
UI_set_item_flag(AVATAR, BG_DONT_MOVE); //freezes avatar during cooking so meat can't be moved
|
||||
|
||||
if (cooking_success > 0)
|
||||
{
|
||||
script item after 1 ticks
|
||||
{
|
||||
nohalt;
|
||||
call GenericFreeze;
|
||||
sfx SFX_COOKING;
|
||||
wait 10;
|
||||
sfx SFX_COOKING;
|
||||
wait 10;
|
||||
sfx SFX_COOKING;
|
||||
wait 10;
|
||||
call meatCooked;
|
||||
};
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
script item after 1 ticks
|
||||
{
|
||||
nohalt;
|
||||
sfx SFX_COOKING;
|
||||
wait 10;
|
||||
sfx SFX_COOKING;
|
||||
wait 10;
|
||||
sfx SFX_COOKING;
|
||||
wait 10;
|
||||
sfx SFX_COOKING;
|
||||
wait 10;
|
||||
call meatBurnt;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void useMeatOnFryingPan object#() ()
|
||||
{
|
||||
var fryingpan = AVATAR->find_nearest(SHAPE_FRYINGPAN, 5);
|
||||
|
||||
if (fryingpan)
|
||||
{
|
||||
placeOnTarget(item, fryingpan, 0, 0, 1);
|
||||
|
||||
if (UI_find_nearby(fryingpan, SHAPE_CAMPFIRE, 1, 0))
|
||||
{
|
||||
script item
|
||||
{
|
||||
nohalt;
|
||||
call cookingMeat;
|
||||
};
|
||||
}
|
||||
else
|
||||
randomPartyBark("@Needs to be closer to a campfire to cook.@");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//-------Raw meat shapes below-------------//
|
||||
|
||||
|
||||
void rawBeef shape#(1203) ()
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var target = UI_click_on_item();
|
||||
var target_coords = getClickPosition(target);
|
||||
var target_shape = target->get_item_shape();
|
||||
var target_quality = target->get_item_quality(); //may not need?
|
||||
|
||||
if (target_shape == SHAPE_FRYINGPAN)
|
||||
{
|
||||
script item
|
||||
{
|
||||
nohalt; wait 3;
|
||||
//Place the meat on top of the pan
|
||||
call useMeatOnFryingPan;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
else randomPartyBark("@Cook that on a frying pan.@");
|
||||
}
|
||||
}
|
||||
|
||||
void rawChicken shape#(1204) ()
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var target = UI_click_on_item();
|
||||
var target_coords = getClickPosition(target);
|
||||
var target_shape = target->get_item_shape();
|
||||
var target_quality = target->get_item_quality(); //may not need?
|
||||
|
||||
if (target_shape == SHAPE_FRYINGPAN)
|
||||
{
|
||||
script item
|
||||
{
|
||||
nohalt; wait 3;
|
||||
//Place the meat on top of the pan
|
||||
call useMeatOnFryingPan;
|
||||
};
|
||||
|
||||
}
|
||||
else randomPartyBark("@Cook that on a frying pan.@");
|
||||
}
|
||||
}
|
||||
|
||||
void rawHorsemeat shape#(1205) ()
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var target = UI_click_on_item();
|
||||
var target_coords = getClickPosition(target);
|
||||
var target_shape = target->get_item_shape();
|
||||
var target_quality = target->get_item_quality(); //may not need?
|
||||
|
||||
if (target_shape == SHAPE_FRYINGPAN)
|
||||
{
|
||||
script item
|
||||
{
|
||||
nohalt; wait 3;
|
||||
//Place the meat on top of the pan
|
||||
call useMeatOnFryingPan;
|
||||
};
|
||||
}
|
||||
else randomPartyBark("@Cook that on a frying pan.@");
|
||||
}
|
||||
}
|
||||
|
||||
void rawRibs shape#(1206) ()
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var target = UI_click_on_item();
|
||||
var target_coords = getClickPosition(target);
|
||||
var target_shape = target->get_item_shape();
|
||||
var target_quality = target->get_item_quality(); //may not need?
|
||||
|
||||
if (target_shape == SHAPE_FRYINGPAN)
|
||||
{
|
||||
script item
|
||||
{
|
||||
nohalt; wait 3;
|
||||
//Place the meat on top of the pan
|
||||
call useMeatOnFryingPan;
|
||||
};
|
||||
}
|
||||
else randomPartyBark("@Cook that on a frying pan.@");
|
||||
}
|
||||
}
|
||||
|
||||
void rawVenison shape#(1207) ()
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var target = UI_click_on_item();
|
||||
var target_coords = getClickPosition(target);
|
||||
var target_shape = target->get_item_shape();
|
||||
var target_quality = target->get_item_quality(); //may not need?
|
||||
|
||||
if (target_shape == SHAPE_FRYINGPAN)
|
||||
{
|
||||
script item
|
||||
{
|
||||
nohalt; wait 3;
|
||||
//Place the meat on top of the pan
|
||||
call useMeatOnFryingPan;
|
||||
};
|
||||
}
|
||||
else randomPartyBark("@Cook that on a frying pan.@");
|
||||
}
|
||||
}
|
||||
|
||||
void rawMutton shape#(1208) ()
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var target = UI_click_on_item();
|
||||
var target_coords = getClickPosition(target);
|
||||
var target_shape = target->get_item_shape();
|
||||
var target_quality = target->get_item_quality(); //may not need?
|
||||
|
||||
if (target_shape == SHAPE_FRYINGPAN)
|
||||
{
|
||||
script item
|
||||
{
|
||||
nohalt; wait 3;
|
||||
//Place the meat on top of the pan
|
||||
call useMeatOnFryingPan;
|
||||
};
|
||||
}
|
||||
else randomPartyBark("@Cook that on a frying pan.@");
|
||||
}
|
||||
}
|
||||
|
||||
void rawRabbit shape#(1209) ()
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var target = UI_click_on_item();
|
||||
var target_coords = getClickPosition(target);
|
||||
var target_shape = target->get_item_shape();
|
||||
var target_quality = target->get_item_quality(); //may not need?
|
||||
|
||||
if (target_shape == SHAPE_FRYINGPAN)
|
||||
{
|
||||
script item
|
||||
{
|
||||
nohalt; wait 3;
|
||||
//Place the meat on top of the pan
|
||||
call useMeatOnFryingPan;
|
||||
};
|
||||
}
|
||||
else randomPartyBark("@Cook that on a frying pan.@");
|
||||
}
|
||||
}
|
||||
|
||||
void rawPork shape#(1210) ()
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var target = UI_click_on_item();
|
||||
var target_coords = getClickPosition(target);
|
||||
var target_shape = target->get_item_shape();
|
||||
var target_quality = target->get_item_quality(); //may not need?
|
||||
|
||||
if (target_shape == SHAPE_FRYINGPAN)
|
||||
{
|
||||
script item
|
||||
{
|
||||
nohalt; wait 3;
|
||||
//Place the meat on top of the pan
|
||||
call useMeatOnFryingPan;
|
||||
};
|
||||
}
|
||||
else randomPartyBark("@Cook that on a frying pan.@");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
void RubberDucky shape#(1135) () //
|
||||
{
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
item->item_say("Squeak!");
|
||||
UI_play_sound_effect(85);
|
||||
return;
|
||||
}
|
||||
}
|
||||
107
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/runes.uc
Executable file
107
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/runes.uc
Executable file
@@ -0,0 +1,107 @@
|
||||
void runes shape#(877) ()
|
||||
{
|
||||
/*Rune frames:
|
||||
const int FRAME_SACRIFICE = 0;
|
||||
const int FRAME_JUSTICE = 1;
|
||||
const int FRAME_HUMILITY = 2;
|
||||
const int FRAME_SPIRITUALITY = 3;
|
||||
const int FRAME_VALOR = 4;
|
||||
const int FRAME_COMPASSION = 5;
|
||||
const int FRAME_HONOR = 6;
|
||||
const int FRAME_HONESTY = 7;
|
||||
*/
|
||||
|
||||
//FIELD FRAMES
|
||||
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;
|
||||
|
||||
///////////////
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
//get frame of rune clicked
|
||||
var rune_frame = UI_get_item_frame(item);
|
||||
UI_close_gumps();
|
||||
|
||||
var target = UI_click_on_item(); //target that is selected
|
||||
var target_coords = getClickPosition(target); //gets target (field) coords
|
||||
var target_shape = target->get_item_shape(); //checks if target is field
|
||||
var target_quality = target->get_item_quality(); // gets target quality (which shrine it is)
|
||||
|
||||
|
||||
//first check if the rune has a target
|
||||
if (!target)
|
||||
{
|
||||
randomPartyBark("@That didn't work.@");
|
||||
return;
|
||||
}
|
||||
|
||||
//Then check if the target is a forcefield
|
||||
if (target_shape == SHAPE_FORCEFIELD)
|
||||
{
|
||||
//Shrine of Sacrifice
|
||||
if ((target_quality == QUALITY_SACRIFICE) && (rune_frame == FRAME_SACRIFICE))
|
||||
{
|
||||
freeShrines("Sacrifice", item);
|
||||
}
|
||||
else if ((target_quality == QUALITY_JUSTICE) && (rune_frame == FRAME_JUSTICE))
|
||||
{
|
||||
freeShrines("Justice", item);
|
||||
}
|
||||
|
||||
//Shrine of Humility
|
||||
else if ((target_quality == QUALITY_HUMILITY) && (rune_frame == FRAME_HUMILITY))
|
||||
{
|
||||
freeShrines("Humility", item);
|
||||
}
|
||||
|
||||
//Shrine of Spirituality
|
||||
else if ((target_quality == QUALITY_SPIRITUALITY) && (rune_frame == FRAME_SPIRITUALITY))
|
||||
{
|
||||
freeShrines("Spirituality", item);
|
||||
}
|
||||
|
||||
//Shrine of Valor
|
||||
else if ((target_quality == QUALITY_VALOR) && (rune_frame == FRAME_VALOR))
|
||||
{
|
||||
freeShrines("Valor", item);
|
||||
}
|
||||
|
||||
//Shrine of Compassion
|
||||
else if ((target_quality == QUALITY_COMPASSION) && (rune_frame == FRAME_COMPASSION))
|
||||
{
|
||||
freeShrines("Compassion", item);
|
||||
}
|
||||
|
||||
|
||||
//Shrine of Honor
|
||||
else if ((target_quality == QUALITY_HONOR) && (rune_frame == FRAME_HONOR))
|
||||
{
|
||||
freeShrines("Honor", item);
|
||||
}
|
||||
|
||||
//Shrine of Honesty
|
||||
else if ((target_quality == QUALITY_HONESTY) && (rune_frame == FRAME_HONESTY))
|
||||
{
|
||||
freeShrines("Honesty", item);
|
||||
}
|
||||
else
|
||||
randomPartyBark("@This is the wrong rune.@");
|
||||
|
||||
}
|
||||
else
|
||||
UI_flash_mouse(CURSOR_X);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
void rusty_cutlass shape#(561) ()
|
||||
{
|
||||
if (event == READIED)
|
||||
{
|
||||
if (gflags[CHUCKLES_KILLED])
|
||||
{
|
||||
//Cheating detected or you hid the cutlass
|
||||
UI_remove_item(item);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
283
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/scrolls.uc
Executable file
283
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/scrolls.uc
Executable file
@@ -0,0 +1,283 @@
|
||||
void showBook ()
|
||||
|
||||
{
|
||||
var SOUND_BOOK = 14;
|
||||
//Play book sound:
|
||||
|
||||
UI_play_sound_effect2(SOUND_BOOK, item);
|
||||
|
||||
|
||||
//Start book mode for current item:
|
||||
book_mode();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void scroll shape#(797) ()
|
||||
{
|
||||
var player_name = getAvatarName();
|
||||
var qual = get_item_quality();
|
||||
var msg;
|
||||
var sound;
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
if (qual < 52)
|
||||
{
|
||||
scroll.original();
|
||||
}
|
||||
|
||||
else if (qual == 52)
|
||||
{
|
||||
showBook();
|
||||
say("The bearer of this letter is granted permission to visit the solitary confinement cells in the Yew city jail. This permission is given by my hand this day. -- Lenora.");
|
||||
}
|
||||
|
||||
else if (qual == 53)
|
||||
{
|
||||
//This is the scroll found in the sewers in the old jail. Starts the Drudgeworth quest
|
||||
showBook();
|
||||
|
||||
if (!gflags[READ_LEAFLET])
|
||||
{
|
||||
gflags[READ_LEAFLET] = true; //sets convo flags on Chuckles and Pridgarm
|
||||
}
|
||||
say("From the desk of Lord British~~Honourable jailer,~~As decreed by Lord British, the completion of the sewer systems beneath the city will proceed. Construction of the sewers will require demolition of the Royal Prison. Upon our liege's orders I have arranged for the transport of the remaining prisoners, Drudgeworth and Saduj, to the prison in Yew. Pridgarm, jailer of Yew, hath been instructed to put these dangerous criminals in solitary confinement. The transport carriage will be waiting outside the castle gates at midnight in two days, as to not disturb the townsfolk with their mad ravings. Thou wilt accompany the prisoner transport to Yew, and a hefty purse of gold and a promotion is waiting for thee once the transport hath been completed. Contact me personally if thou hast any questions, our liege is much too busy as of late. ~~Chuckles, on behalf of Lord British");
|
||||
}
|
||||
|
||||
|
||||
else if (qual == 54) //Captain Johne's Scroll
|
||||
{
|
||||
showBook();
|
||||
say("This scroll contains Captain Johne's notes on the gargoyle language. After studying it for a while, you are now able to understand them!");
|
||||
if(!gflags[READ_GARGISH_SCROLL])
|
||||
{
|
||||
UI_set_npc_id(BEHLEM, 1); //can understand beh lem now.
|
||||
UI_set_npc_id(VALKADESH, 1); //can understand valkadesh now.
|
||||
UI_set_npc_id(NAXATILOR, 1); //can understand naxatilor now.
|
||||
UI_set_npc_id(BOLESH, 1); //can understand Bolesh now.
|
||||
UI_set_npc_id(GOODSCRAFTER, 1); //can understand Goodscrafter now.
|
||||
UI_set_npc_id(SNAKECHARMER, 1); //can understand now.
|
||||
UI_set_npc_id(WEAPONSMITH, 1);
|
||||
UI_set_npc_id(FARMER_KRILL, 1);
|
||||
UI_set_npc_id(HEALER, 1);
|
||||
UI_set_npc_id(CARETAKER, 1);
|
||||
UI_set_npc_id(FOODMAKER, 1);
|
||||
UI_set_npc_id(FARMER_NASH, 1);
|
||||
UI_set_npc_id(LENSMAKER, 1);
|
||||
|
||||
|
||||
UI_clear_item_flag(NAXATILOR, SI_ZOMBIE); // used to get intelligent Beh Lem convo since gflag wasn't working
|
||||
UI_clear_item_flag(DRAXINUSOM, SI_ZOMBIE); // used for bark when read scroll but not yet met
|
||||
|
||||
UI_set_item_flag(VALKADESH, CONFUSED); //starts not officially met Valk, but read scroll convo
|
||||
UI_set_item_flag(NAXATILOR, CONFUSED); //starts not officially met Valk, but read scroll convo
|
||||
gflags[READ_GARGISH_SCROLL] = true; //allows Avatar to read gargish and understand gargoyles
|
||||
}
|
||||
}
|
||||
|
||||
else if (qual == 55)
|
||||
{
|
||||
showBook();
|
||||
say("Michael ~~ I beseech thee.. give me more time to repay my debt to you. Our nets have been empty as of late, so income is sparse. I promise that the money will come up, I just need more time. Marney
|
||||
means everything to me and she's all I have left. If not for me, grant the time for Marney's sake. Please consider mine request, and I will give thee the money owed.~~");
|
||||
say("~Quenton");
|
||||
}
|
||||
|
||||
else if (qual == 56)
|
||||
{
|
||||
showBook();
|
||||
say("With love, from cousin Manrel.");
|
||||
}
|
||||
|
||||
else if (qual == 57)
|
||||
{
|
||||
showBook();
|
||||
say("Ship deed to the Lady o' the Sea, commissioned by Fentrissa of Bucaneer's Den.");
|
||||
}
|
||||
|
||||
else if (qual == 58)
|
||||
{
|
||||
showBook();
|
||||
say("Sir Garen, ~~ I have received word from Sir Geoffrey that the Shrine of Honor hath also fallen prey to the gargoyles. Since thou'rt already in Trinsic on thy last assignment, I need thine assistance. Thy new assignment is to scout out the Shrine of Honor and gauge the size of the occupying force. Reinforcements are scarce and must be routed to areas where there are the most gargoyle activity. Respond quickly, and may the virtues be with thee. In honor~~ -Sir Aiden");
|
||||
}
|
||||
|
||||
else if (qual == 59)
|
||||
{
|
||||
var balloon_items = [SHAPE_CAULDRON, SHAPE_BALLOON_BASKET, SHAPE_BALLOON_BAG, SHAPE_ROPE];
|
||||
UI_close_gumps();
|
||||
showBook();
|
||||
say("Plans for the construction of a hot air balloon ~~ First you must have a wicker balloon basket made, large enough to carry several passengers. Then you'll need a big iron cauldron, to hold a fire to generate the hot air. Next you must have a huge bag sewn out of silk, to hold the hot air in. Lastly, get enough rope to tie the balloon securely to the basket. Once you've gathered all of these together, use these plans to assemble them. When flying your balloon, you'll find that a ship's anchor makes the best ballast, and is also useful for stopping the balloon where and when you wish.");
|
||||
|
||||
if ((!gflags[MADE_BALLOON]) && (gflags[READ_BALLOON_PLANS]))
|
||||
{
|
||||
if ((UI_count_objects(PARTY, SHAPE_BALLOON_BASKET, QUALITY_ANY, FRAME_ANY) > 0) && (UI_count_objects(PARTY, SHAPE_CAULDRON, QUALITY_ANY, FRAME_ANY) > 0) && (UI_count_objects(PARTY, SHAPE_BALLOON_BASKET, QUALITY_ANY, FRAME_ANY) > 0) && (UI_count_objects(PARTY, SHAPE_ROPE, QUALITY_ANY, FRAME_ANY) > 0))
|
||||
{
|
||||
UI_remove_party_items(1, SHAPE_BALLOON_BASKET, QUALITY_ANY, FRAME_ANY);
|
||||
UI_remove_party_items(1, SHAPE_BALLOON_BAG, QUALITY_ANY, FRAME_ANY);
|
||||
UI_remove_party_items(1, SHAPE_CAULDRON, QUALITY_ANY, FRAME_ANY);
|
||||
UI_remove_party_items(1, SHAPE_ROPE, QUALITY_ANY, FRAME_ANY);
|
||||
|
||||
UI_add_party_items(1, SHAPE_PACKED_BALLOON, QUALITY_ANY, FRAME_ANY);
|
||||
gflags[MADE_BALLOON] = true;
|
||||
}
|
||||
else randomPartyBark("@We are missing something..@");
|
||||
}
|
||||
|
||||
if (!gflags[READ_BALLOON_PLANS]) //if global flag not true, it sets it after first read.
|
||||
{
|
||||
gflags[READ_BALLOON_PLANS] = true;
|
||||
}
|
||||
}
|
||||
else if (qual == 60)
|
||||
{
|
||||
showBook();
|
||||
say("By proclamation of Lord British this is an official document denoting ownership of the heretofore mentioned sailing vessel. Forgery of this title is prohibited under law no. 1989832.A5, section 809.");
|
||||
say("~DEED~~SHIP NAME: Golden Hinde~COMPLETION DATE: 7-08-0160~INSPECTION DATE: 7-12-0160~SHIPWRIGHT: Peer of Jhelom");
|
||||
}
|
||||
|
||||
else if (qual == 61)
|
||||
{
|
||||
showBook();
|
||||
say("UOR Resume");
|
||||
}
|
||||
|
||||
else if (qual == 62)
|
||||
{
|
||||
AVATAR.say("@Strange.. this letter is stained with blood..@");
|
||||
AVATAR.hide();
|
||||
showBook();
|
||||
|
||||
say("Quenton-~~");
|
||||
say("My patience with you has run out after our last meeting, as I have come back empty without payment. I don't run a charity, and you've had plenty of time to repay thy loan.");
|
||||
say("The next time I come into town, you better have my money ready. If you have nothing but more excuses for me, I might be inclined to take some collateral...");
|
||||
say("I'm sure Marney wouldn't mind..");
|
||||
say("~~You have until tomorrow eve. I'll return in the night, at our pre-arranged meeting place. Don't be late, and don't come empty handed.~~");
|
||||
say("-Michael");
|
||||
UI_close_gumps();
|
||||
|
||||
randomPartyBark("@Don't forget to grab the scrolls!@");
|
||||
|
||||
//move Marney, Michael to docks
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if (qual == 63)
|
||||
{
|
||||
showBook();
|
||||
|
||||
say("Dearest Michael-~~");
|
||||
say("I count down the hours until we meet again. You are a lone beacon of light in my darkness since my father was killed by the gargoyles. I have decided to come with you on the voyage you mentioned to me in your last visit to town.");
|
||||
say("I look forward to the voyage with you and seeing the world, since I've never seen much beyond mine home. Yorl has forbidden me from seeing you, so we will need to meet up in secret. I will be waiting for you at the docks before midnight in three days.");
|
||||
say("Yorl will be asleep by then and I can leave him a letter that he will find on the docks once we have left. Until next we meet, I shall be thinking of thee.~~");
|
||||
say("-Marney");
|
||||
UI_close_gumps();
|
||||
|
||||
if (!gflags[QUENTON_MURDER_SOLVED] || !gflags[MICHAEL_CAPTURED] || !gflags[MARNEY_GONE] || !gflags[MARNEY_SAVED])
|
||||
randomPartyBark("@That's tonight, we must hurry!@");
|
||||
|
||||
//move Marney, Michael to docks
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 64)
|
||||
{
|
||||
showBook();
|
||||
|
||||
UI_close_gumps();
|
||||
|
||||
say("If you're looking for the clue, there's something for you under a plant in Serpent's Hold.");
|
||||
|
||||
}
|
||||
else if (qual == 65)
|
||||
{
|
||||
showBook();
|
||||
|
||||
UI_close_gumps();
|
||||
|
||||
say("This scroll is filled with Lord British's notes on his astronomical observations.");
|
||||
|
||||
}
|
||||
|
||||
else if (qual == 66)
|
||||
{
|
||||
showBook();
|
||||
say("Ship deed to the Majestic Seahorse, commissioned by Peer of Jhelom.");
|
||||
}
|
||||
|
||||
else if (qual == 67)
|
||||
{
|
||||
showBook();
|
||||
say("Ship deed to the Beckoning Siren, commissioned by Trebor of Minoc.");
|
||||
}
|
||||
|
||||
//Chuckles quest scrolls
|
||||
|
||||
else if (qual == 68)
|
||||
{
|
||||
showBook();
|
||||
say("Your next hint is under a beehive in Minoc.");
|
||||
}
|
||||
|
||||
else if (qual == 69)
|
||||
{
|
||||
showBook();
|
||||
say("You're doing well! Next you should search the harpsichord in the Blue Bottle Tavern.");
|
||||
}
|
||||
|
||||
else if (qual == 70)
|
||||
{
|
||||
showBook();
|
||||
say("Well done! Now go search the beds in the jail in Yew.");
|
||||
}
|
||||
|
||||
else if (qual == 71)
|
||||
{
|
||||
showBook();
|
||||
say("Most people would have given up by now... But since you haven't, you can find the next hint under a cauldron in New Magincia.");
|
||||
}
|
||||
|
||||
else if (qual == 72)
|
||||
{
|
||||
showBook();
|
||||
say("You're almost there! Search the stone lions in Lord British's castle.");
|
||||
}
|
||||
|
||||
else if (qual == 73)
|
||||
{
|
||||
showBook();
|
||||
say("Ho eyo he hum! You've won, you've won! Go to Iolo's hut and ask Smith the horse to tell you the clue!");
|
||||
if (!gflags[SOLVED_CHUCKLES_QUEST])
|
||||
gflags[SOLVED_CHUCKLES_QUEST] = true;
|
||||
}
|
||||
|
||||
else if (qual == 74)
|
||||
{
|
||||
showBook();
|
||||
say("This scroll is filled with Lord British's notes on his astronomical observations.");
|
||||
|
||||
}
|
||||
else if (qual == 75)
|
||||
{
|
||||
showBook();
|
||||
say("I look to the moon and stars,");
|
||||
say("Somewhere underneath of them she's there..");
|
||||
}
|
||||
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
showBook();
|
||||
say("This is not a valid scroll QUAL attribute! Stop cheating!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
44
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/shears.uc
Executable file
44
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/shears.uc
Executable file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 Alun Bestor/The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Author: Marzo Junior (reorganizing/updating code by Alun Bestor)
|
||||
* Last Modified: 2006-03-19
|
||||
*/
|
||||
const int SHAPE_SHEEP = 970;
|
||||
const int SHAPE_BANDAGE = 827;
|
||||
//Reimplemented to allow sheep-shearing
|
||||
void Shears shape#(0x2BA) ()
|
||||
{
|
||||
var target;
|
||||
var target_shape;
|
||||
|
||||
if (event != DOUBLECLICK)
|
||||
return;
|
||||
target = UI_click_on_item();
|
||||
target_shape = target->get_item_shape();
|
||||
|
||||
if (target_shape == SHAPE_CLOTH)
|
||||
{
|
||||
target->set_item_shape(SHAPE_BANDAGE);
|
||||
target->set_item_frame(UI_die_roll(0, 2));
|
||||
}
|
||||
else if (target_shape == SHAPE_SHEEP)
|
||||
startShearing(target); //located in sheep.uc
|
||||
else
|
||||
randomPartySay("@Might not those come in handy for cutting cloth into bandages?@");
|
||||
}
|
||||
320
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/shovel.uc
Executable file
320
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/shovel.uc
Executable file
@@ -0,0 +1,320 @@
|
||||
void removeDirt object#() ()
|
||||
{
|
||||
const int SHAPE_SOFT_DIRT = 1191;
|
||||
var dirt = UI_find_nearby_avatar(SHAPE_SOFT_DIRT);
|
||||
UI_remove_item(dirt[1]);
|
||||
UI_error_message("Dirt should be removed");
|
||||
}
|
||||
|
||||
|
||||
void DigResultGrave object#() ()
|
||||
{
|
||||
|
||||
var target = UI_find_nearby(AVATAR, SHAPE_GRAVE, 1, MASK_NONE);
|
||||
var target_shape = UI_get_item_shape(target);
|
||||
var avatar_pos = UI_get_object_position(AVATAR);
|
||||
var target_quality = target->get_item_quality(target);
|
||||
var position = UI_get_object_position(target);
|
||||
var rand = UI_get_random(100);
|
||||
|
||||
|
||||
//change grave to dug up grave shape
|
||||
UI_set_item_shape(target, SHAPE_OPEN_GRAVE);
|
||||
|
||||
//based on quality, change frame to diff type
|
||||
if (target_quality == 0)
|
||||
target->set_item_frame(FRAME_GREY_COFFIN);
|
||||
else if (target_quality == 1)
|
||||
target->set_item_frame(FRAME_BROWN_COFFIN);
|
||||
else if (target_quality == 2) //WONT SPAWN A GHOST (used for Quenton, Gwen's grave)
|
||||
target->set_item_frame(FRAME_BROWN_COFFIN);
|
||||
else
|
||||
target->set_item_frame(FRAME_EMPTY_GRAVE);
|
||||
|
||||
//prevent it from disappearing
|
||||
UI_clear_item_flag(target, TEMPORARY);
|
||||
|
||||
|
||||
//30 % chance you disturb the undead!
|
||||
if (rand >= 60)
|
||||
{
|
||||
//if grave is quality 2 don't spawn a ghost- used for "friendly graves" (can't have duplicate Quenton!)
|
||||
if (target_quality != 2)
|
||||
{
|
||||
var target_coords = UI_get_object_position(target);
|
||||
|
||||
//create ghost at position
|
||||
var ghost = UI_create_new_object2(SHAPE_GHOST, [target_coords[X]-2, target_coords[Y]-2]);
|
||||
|
||||
//set alignment to EVIL
|
||||
ghost->set_alignment(EVIL);
|
||||
|
||||
//make it attack
|
||||
ghost->set_schedule_type(IN_COMBAT);
|
||||
|
||||
//for color
|
||||
randomPartyBark("@Ghost!!!@");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void DigResult object#() ()
|
||||
{
|
||||
var result = UI_die_roll(0, 20);
|
||||
var booty = UI_die_roll(0, 2);
|
||||
var gem_frame = UI_die_roll(0, 13);
|
||||
var avatar_pos = UI_get_object_position(AVATAR);
|
||||
var gem = UI_create_new_object(SHAPE_GEM);
|
||||
|
||||
|
||||
|
||||
|
||||
if (result == 5) //give gold nugget
|
||||
{
|
||||
UI_create_new_object2(SHAPE_GOLDNUGGET, avatar_pos);
|
||||
avatarBark("I've struck gold!");
|
||||
}
|
||||
else
|
||||
|
||||
if (result == 20) //give gem
|
||||
{
|
||||
var gem = UI_create_new_object(SHAPE_GEM);
|
||||
UI_update_last_created(avatar_pos);
|
||||
UI_set_item_frame(gem, gem_frame);
|
||||
avatarBark("Eureka!");
|
||||
}
|
||||
|
||||
else avatarBark("Nothing...");
|
||||
}
|
||||
|
||||
|
||||
void AvatarDig object#() ()
|
||||
{
|
||||
|
||||
//var target = UI_click_on_item(); //target that is selected
|
||||
var target_shape = item->get_item_shape();
|
||||
var target_frame = item->get_item_frame();
|
||||
var target_coords = getClickPosition(item);
|
||||
|
||||
script AVATAR after 5 ticks
|
||||
{
|
||||
face north;
|
||||
wait 5;
|
||||
actor frame USE;
|
||||
wait 5;
|
||||
// actor frame standing;
|
||||
// wait 5;
|
||||
actor frame SWING_2H_3;
|
||||
sfx 3;
|
||||
wait 5;
|
||||
actor frame SWING_2H_2;
|
||||
sfx 6;
|
||||
wait 5;
|
||||
|
||||
face north;
|
||||
wait 5;
|
||||
actor frame USE;
|
||||
wait 5;
|
||||
// actor frame standing;
|
||||
// wait 5;
|
||||
actor frame SWING_2H_3;
|
||||
sfx 3;
|
||||
wait 5;
|
||||
actor frame SWING_2H_2;
|
||||
sfx 6;
|
||||
wait 5;
|
||||
|
||||
face north;
|
||||
wait 5;
|
||||
actor frame USE;
|
||||
wait 5;
|
||||
// actor frame standing;
|
||||
// wait 5;
|
||||
actor frame SWING_2H_3;
|
||||
sfx 3;
|
||||
wait 5;
|
||||
actor frame SWING_2H_2;
|
||||
sfx 6;
|
||||
wait 5;
|
||||
call DigResult;
|
||||
}
|
||||
}
|
||||
|
||||
void AvatarDigGrave object#() ()
|
||||
{
|
||||
UI_error_message("AvatarDigGrave called");
|
||||
var target_shape = item->get_item_shape();
|
||||
var target_frame = item->get_item_frame();
|
||||
var target_coords = getClickPosition(item);
|
||||
|
||||
script AVATAR after 5 ticks
|
||||
{
|
||||
face north;
|
||||
wait 5;
|
||||
actor frame USE;
|
||||
wait 5;
|
||||
// actor frame standing;
|
||||
// wait 5;
|
||||
actor frame SWING_2H_3;
|
||||
sfx 3;
|
||||
wait 5;
|
||||
actor frame SWING_2H_2;
|
||||
sfx 6;
|
||||
wait 5;
|
||||
|
||||
face north;
|
||||
wait 5;
|
||||
actor frame USE;
|
||||
wait 5;
|
||||
// actor frame standing;
|
||||
// wait 5;
|
||||
actor frame SWING_2H_3;
|
||||
sfx 3;
|
||||
wait 5;
|
||||
actor frame SWING_2H_2;
|
||||
sfx 6;
|
||||
wait 5;
|
||||
|
||||
face north;
|
||||
wait 5;
|
||||
actor frame USE;
|
||||
wait 5;
|
||||
// actor frame standing;
|
||||
// wait 5;
|
||||
actor frame SWING_2H_3;
|
||||
sfx 3;
|
||||
wait 5;
|
||||
actor frame SWING_2H_2;
|
||||
sfx 6;
|
||||
wait 5;
|
||||
call DigResultGrave;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void shovel shape#(625) ()
|
||||
{
|
||||
enum cave_tiles
|
||||
{
|
||||
SHAPE_DEBRIS = 202,
|
||||
SHAPE_TEST = 18, //REMOVE WHEN DONE - blue tile shape for testing
|
||||
SHAPE_CAVE_FLOOR = 49,
|
||||
SHAPE_CAVE_FLOOR2 = 50,
|
||||
SHAPE_CAVE_FLOOR3 = 51,
|
||||
SHAPE_CAVE_FLOOR4 = 52,
|
||||
SHAPE_CAVE_FLOOR5 = 53,
|
||||
SHAPE_CAVE_FLOOR6 = 54,
|
||||
SHAPE_CAVE_FLOOR7 = 56,
|
||||
|
||||
SHAPE_SOFT_DIRT = 1191
|
||||
};
|
||||
|
||||
|
||||
var quality = item->get_item_quality();
|
||||
var pos;
|
||||
var framenum = UI_get_item_frame(item);
|
||||
var cave_tiles = [SHAPE_CAVE_FLOOR, SHAPE_TEST, SHAPE_CAVE_FLOOR2, SHAPE_CAVE_FLOOR3, SHAPE_CAVE_FLOOR4, SHAPE_CAVE_FLOOR5, SHAPE_CAVE_FLOOR6, SHAPE_CAVE_FLOOR7, SHAPE_DEBRIS, SHAPE_SOFT_DIRT];
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
|
||||
if (UI_is_readied(AVATAR, BG_BOTH_HANDS, SHAPE_SHOVEL, FRAME_ANY))
|
||||
{
|
||||
var target = UI_click_on_item(); //target that is selected
|
||||
var target_shape = target->get_item_shape();
|
||||
var target_frame = target->get_item_frame();
|
||||
var target_quality = target->get_item_quality();
|
||||
var target_coords = getClickPosition(target);
|
||||
var direction = AVATAR->find_direction(target_coords);
|
||||
|
||||
if (direction == NORTH)
|
||||
{
|
||||
target_coords[X] = (target_coords[X] - 1); //fine
|
||||
target_coords[Y] = (target_coords[Y] - 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (target_shape == SHAPE_GRAVE)
|
||||
{
|
||||
UI_set_item_flag(target, TEMPORARY); //set to isolate grave shape from others
|
||||
UI_si_path_run_usecode(AVATAR, target_coords, false, target, AvatarDigGrave, false);
|
||||
|
||||
//whining from companions
|
||||
randomPartyBark("@Should we be doing this?@");
|
||||
}
|
||||
else if (target_shape == SHAPE_SOFT_DIRT)
|
||||
{
|
||||
|
||||
script AVATAR after 3 ticks
|
||||
{
|
||||
face north;
|
||||
wait 5;
|
||||
actor frame USE;
|
||||
wait 5;
|
||||
|
||||
actor frame SWING_2H_3;
|
||||
sfx 3;
|
||||
wait 5;
|
||||
actor frame SWING_2H_2;
|
||||
sfx 6;
|
||||
wait 5;
|
||||
|
||||
face north;
|
||||
wait 5;
|
||||
actor frame USE;
|
||||
wait 5;
|
||||
|
||||
actor frame SWING_2H_3;
|
||||
sfx 3;
|
||||
wait 5;
|
||||
actor frame SWING_2H_2;
|
||||
sfx 6;
|
||||
wait 5;
|
||||
|
||||
face north;
|
||||
wait 5;
|
||||
actor frame USE;
|
||||
wait 5;
|
||||
|
||||
actor frame SWING_2H_3;
|
||||
sfx 3;
|
||||
wait 5;
|
||||
actor frame SWING_2H_2;
|
||||
sfx 6;
|
||||
wait 5;
|
||||
|
||||
call removeDirt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
UI_si_path_run_usecode(AVATAR, target_coords, false, target, AvatarDigGrave, false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
randomPartyBark("@You have to ready the shovel to use it.@");
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
239
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/signs.uc
Executable file
239
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/signs.uc
Executable file
@@ -0,0 +1,239 @@
|
||||
void signs shape# (1141)()
|
||||
{
|
||||
/* original signs from shape 379
|
||||
0. Drink At The Gilded Lizard
|
||||
1. Skara Brae Population 47
|
||||
2. Trinsic
|
||||
3. The Honorable Hound
|
||||
4. Fellowship Hall
|
||||
5. Britain
|
||||
6. Coming: Raymundos Trials of the Avatar
|
||||
7. Reserve Thy Seats Now
|
||||
8. Royal Museum
|
||||
9. The Music Hall
|
||||
10. --
|
||||
11. The Wayfarers Inn
|
||||
12. Iolos Bows
|
||||
13. The Blue Boar
|
||||
14. Gayes Clothiers
|
||||
15. North Star Armoury
|
||||
16. The Oaken Oar
|
||||
17. Bakery
|
||||
18. Jeweler
|
||||
19. Farmers Market
|
||||
20. Apothecary
|
||||
21. Royal Mint
|
||||
22. Csil The Healer
|
||||
23. Provisions
|
||||
24. Royal Orchards
|
||||
25. Test of Strength-- Art Thou An Avatar
|
||||
26. Punch And Judy Show
|
||||
27. Fish N Chips
|
||||
28. Cove
|
||||
29. The Emerald
|
||||
30. Out 'N Inn
|
||||
31. Lovers Walk
|
||||
32. Buccaneers Den
|
||||
33. The Baths
|
||||
34. House of Games
|
||||
35. The Fallen Virgin
|
||||
36. Budos
|
||||
37. Meditation Retreat
|
||||
38. --
|
||||
39. --
|
||||
40. --
|
||||
41. --
|
||||
42. --
|
||||
43. --
|
||||
44. Go This Way
|
||||
45. --
|
||||
46. --
|
||||
47. --
|
||||
48. --
|
||||
49. --
|
||||
50. --
|
||||
51. --
|
||||
52. Lycaeum
|
||||
53. The Hallowed Dock
|
||||
54. The Friendly Knave
|
||||
55. The Gilded Lizard
|
||||
56. Healer
|
||||
57. Eldroths Provisions
|
||||
58. House of Items
|
||||
59. Britannian Mining Company
|
||||
61. Trainer
|
||||
62. Scholar
|
||||
63. Town Hall
|
||||
64. Wis-Surs Magics
|
||||
65. Observatory
|
||||
66. Vesper
|
||||
67. Moonglow
|
||||
68. Terfin
|
||||
69. Serpents Hold
|
||||
70. Empath Abbey
|
||||
71. Jhelom
|
||||
72. Minoc
|
||||
73. Undertaker
|
||||
74. High Court of Britannia
|
||||
75. Prison
|
||||
76. The Modest Damsel
|
||||
77. Armoury
|
||||
78. Blacksmith
|
||||
79. Recreation Center
|
||||
80. Hall of Knowledge
|
||||
81. Hello There Avatar
|
||||
82. Tonight 9-12 In Person The Avatars
|
||||
83. Why Ask Why
|
||||
84. Street of Honor
|
||||
85. Paladins Path
|
||||
86. Avenue of the Fellowship
|
||||
87. Widows Walk
|
||||
88. Harolds Hallway
|
||||
89. Fools Way
|
||||
90. Whitsaber Road
|
||||
91. Strand
|
||||
92. Chalice Avenue
|
||||
93. Two Coves
|
||||
94. West Wall Road
|
||||
95. East Wall Road
|
||||
96. North Wall Road
|
||||
97. South Wall Road
|
||||
98. Heroes Way
|
||||
99. Iolo's South
|
||||
100. Paws
|
||||
101. To Salty Dog
|
||||
102. Fellowship Shelter
|
||||
103. Vesper Branch
|
||||
104. The Checquered Cork
|
||||
105. Artists Guild
|
||||
106. The Bunk and Stool
|
||||
107. The Library of Scars
|
||||
108. Carlyns Clothes
|
||||
109. Within These Walls Lies Master Richard
|
||||
110. Castle Way
|
||||
111. Lord British Lane
|
||||
112. Noble Road
|
||||
113. West End Avenue
|
||||
114. Hazle Lane
|
||||
115. Park Square North
|
||||
116. Park Square South
|
||||
117. Market Street
|
||||
118. Golden Way
|
||||
119. Center Avenue
|
||||
120. Spike Lane
|
||||
121. Avatar Avenue
|
||||
122. Stable Lane
|
||||
123. East End Avenue
|
||||
124. Farm Road
|
||||
125. Nugget Street
|
||||
126. Cool Cove
|
||||
127. North End Avenue
|
||||
128. Golden Eye Way
|
||||
129. To The Dark Tower
|
||||
130. Beware of Landslides
|
||||
131. Danger: Do Not Enter
|
||||
132. Old Number One
|
||||
133. Do Not Free The Liche
|
||||
134. Beware Monsters Within
|
||||
135. Hauhers Graves
|
||||
136. Manrik A Soul Of A Soul
|
||||
137. Here Lies Jules No Worse For The Loss
|
||||
138. Morgan Her Death A Tragedy
|
||||
139. Here Lies Kethian Friend To Many
|
||||
140. Wadley His Soul Deeper Than His Body
|
||||
141. Here Lies Jenna Kindred Spirit
|
||||
142. Dead End
|
||||
143. To Skara Brae
|
||||
144. The Throne Of the Guardian
|
||||
145. North To Britain
|
||||
146. Pull Lever
|
||||
147. Round And Round
|
||||
148. Way Out
|
||||
149. Keep Doors Open
|
||||
150. Selwyns Tower
|
||||
151. Follow The Fire
|
||||
|
||||
*/
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
var quality = UI_get_item_quality(item);
|
||||
var msg;
|
||||
|
||||
UI_close_gumps();
|
||||
|
||||
if (quality == 0)
|
||||
msg = ["beware", "of", "the", "beast"];
|
||||
|
||||
else if (quality == 1)
|
||||
msg = ["The", "Spiritual", "Path"];
|
||||
|
||||
else if (quality == 2) msg = ["The Kings Way"];
|
||||
|
||||
else if (quality == 3) msg = ["Kafiristan Pass"];
|
||||
|
||||
|
||||
else if (quality == 4) msg = ["For Sale"];
|
||||
|
||||
else if (quality == 5) msg = ["The crypt", "of", "Cantrell"];
|
||||
|
||||
else if (quality == 6) msg = ["The crypt", "of", "Spector"];
|
||||
|
||||
else if (quality == 7) msg = ["The crypt", "of", "Beyvin"];
|
||||
|
||||
else if (quality == 8) msg = ["The crypt", "of", "Malone"];
|
||||
|
||||
else if (quality == 9) msg = ["The crypt", "of", "Bourbonnais"];
|
||||
|
||||
else if (quality == 10) msg = ["The crypt", "of", "Jannati"];
|
||||
|
||||
else if (quality == 11) msg = ["The crypt", "of", "Romero"];
|
||||
|
||||
else if (quality == 12) msg = ["The crypt", "of", "Dwyer"];
|
||||
|
||||
else if (quality == 13) msg = ["The crypt", "of", "Gabriella"];
|
||||
|
||||
else if (quality == 14) msg = ["The", "Blue", "Bottle"];
|
||||
|
||||
else if (quality == 15) msg = ["Fool's Pair", "o'", "Dice"];
|
||||
|
||||
else if (quality == 16) msg = ["Avatar Lane"];
|
||||
|
||||
else if (quality == 17) msg = ["Bellringer Lane"];
|
||||
|
||||
else if (quality == 18) msg = ["Serpents Loop"];
|
||||
|
||||
else if (quality == 19) msg = ["Keep Out!"];
|
||||
|
||||
else if (quality == 20) msg = ["This way"];
|
||||
|
||||
else if (quality == 21) msg = ["That way"];
|
||||
|
||||
else if (quality == 22) msg = ["Drop to", "your death!"];
|
||||
|
||||
else if (quality == 23) msg = ["This way"];
|
||||
|
||||
else if (quality == 24) msg = ["That way"];
|
||||
|
||||
else if (quality == 25) msg = ["The Maze", "Of death!"];
|
||||
|
||||
else if (quality == 26) msg = ["Off Limits!"];
|
||||
|
||||
else if (quality == 27)
|
||||
msg = ["Celestial Garden"];
|
||||
|
||||
else if (quality == 28)
|
||||
msg = ["Please leave", "your weapons", "on the table"];
|
||||
|
||||
else if (quality == 29)
|
||||
msg = ["The Well", "of", "Humility"];
|
||||
|
||||
else
|
||||
msg = ["Stop Cheating!"];
|
||||
|
||||
|
||||
UI_display_runes(49, msg);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
15
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/skiff.uc
Executable file
15
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/skiff.uc
Executable file
@@ -0,0 +1,15 @@
|
||||
void skiff shape#(1150) ()
|
||||
{
|
||||
var party = UI_get_party_list();
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
if (UI_get_array_size(party) > 5)
|
||||
{
|
||||
randomPartySay("@'Twould appear we cannot all fit inside the skiff.@");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
//Reworked from previously used for Pickpocket spell. Pickpocket is now replacing one of the original u7 spells and is used from the spellbook
|
||||
|
||||
|
||||
void magicScroll shape# (1147) ()
|
||||
{
|
||||
const int BUBBLES = 21;
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
var spellbook = AVATAR->find_object(761, QUALITY_ANY, FRAME_ANY);
|
||||
|
||||
if (spellbook > 0)
|
||||
{
|
||||
if (!hasSpell(ARMAGEDDON))
|
||||
{
|
||||
UI_add_spell(ARMAGEDDON, 0, spellbook);
|
||||
UI_close_gumps();
|
||||
UI_play_sound_effect(68);
|
||||
UI_sprite_effect(BUBBLES, 0, 0, 0, 0, 0, -1);
|
||||
UI_obj_sprite_effect(AVATAR, BUBBLES, 0, 0, 0, 0, 0, -1);
|
||||
|
||||
UI_item_say(AVATAR, "'Armageddon' has been transcribed..");
|
||||
|
||||
//remove item
|
||||
UI_remove_item(item);
|
||||
|
||||
}
|
||||
else //Cheating detected, game go boom!
|
||||
{
|
||||
UI_error_message("That's not supposed to happen.");
|
||||
randomPartyBark("@Uh oh...@");
|
||||
UI_armageddon();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
UI_flash_mouse(1);
|
||||
UI_item_say(AVATAR, "I need a spellbook for this.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
extern var getOuterContainer 0x945(var obj);
|
||||
extern void spellFails object#(0x606) ();
|
||||
|
||||
|
||||
void StormCloak shape#(1247) ()
|
||||
{
|
||||
if (event == READIED)
|
||||
{
|
||||
UI_close_gumps2();
|
||||
|
||||
if (AVATAR->is_readied(BG_CLOAK, SHAPE_STORM_CLOAK, FRAME_ANY))
|
||||
{
|
||||
//AVATAR->close_gumps2(); //didn't work
|
||||
//UI_close_gumps2();
|
||||
UI_error_message("Gumps should be closed now");
|
||||
|
||||
|
||||
}
|
||||
|
||||
UI_error_message("Storm cloak equipped!");
|
||||
// Come back here next tick to do initial cleanup.
|
||||
|
||||
//set anti magic weather
|
||||
UI_set_weather(SPARKLE);
|
||||
|
||||
|
||||
// Add more spells here:
|
||||
var spell_shapes = [281, 408, 527, 807, 856];
|
||||
|
||||
// Who is wearing the cloak:
|
||||
var wearer = getOuterContainer(item);
|
||||
|
||||
// How far from the wearer we want to search.
|
||||
var dist = 20;
|
||||
|
||||
// Find all nearby NPCs, of any shape, within 20 tiles and whether or
|
||||
// not they are invisible.
|
||||
var npc_list = wearer->find_nearby(-359, dist, 0x28);
|
||||
|
||||
// To prevent party NPCs from being affected.
|
||||
var party = UI_get_party_list();
|
||||
|
||||
// For color.
|
||||
var barks = ["My pretty spells are gone!", "My magic?!!", "My spells?!!"];
|
||||
var numbarks = UI_get_array_size(barks);
|
||||
|
||||
for (npc in npc_list)
|
||||
{
|
||||
var align = npc->get_alignment();
|
||||
var in_party = npc->get_npc_object();
|
||||
|
||||
// Is the NPC is being attacked by a party member?
|
||||
if (in_party || !(npc->get_oppressor() in party))
|
||||
{
|
||||
// No. Check basic alignment only.
|
||||
|
||||
if (in_party || align == 0)
|
||||
{
|
||||
// Friendly NPCs and party members.
|
||||
|
||||
// Uncharm.
|
||||
npc->clear_item_flag(2);
|
||||
// Uncurse.
|
||||
npc->clear_item_flag(3);
|
||||
// Unparalyze.
|
||||
npc->clear_item_flag(7);
|
||||
|
||||
// Do nothing else.
|
||||
continue;
|
||||
}
|
||||
else if (align == 1)
|
||||
{
|
||||
// Neutral NPCs.
|
||||
|
||||
// Do nothing? Do everything? Your choice.
|
||||
|
||||
// I went with 'do nothing'.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Hostile and random NPCs, fighting neutral NPCs or friendly NPCs
|
||||
// being attacked by party members.
|
||||
|
||||
// We want to delete spells, if any.
|
||||
|
||||
// We also want to count how many spells were deleted.
|
||||
var cnt = 0;
|
||||
|
||||
// Go through the spell shapes.
|
||||
for (spell in spell_shapes)
|
||||
{
|
||||
// Remove all spells of this shape that the NPC is carrying.
|
||||
cnt += npc->remove_cont_items(-359, spell, -359, -359, true);
|
||||
}
|
||||
|
||||
// Did we delete any spells?
|
||||
if (cnt > 0)
|
||||
{
|
||||
// We did. Now we must to do a couple more things.
|
||||
|
||||
// 'Magebane' effect: prevents mages from teleporting, turning
|
||||
// invisible or summoning more foes.
|
||||
npc->set_item_flag(31);
|
||||
|
||||
// Color: spell fizzle effect plus surprised bark.
|
||||
script npc after UI_die_roll(4,8) ticks
|
||||
{
|
||||
call spellFails;
|
||||
wait 4;
|
||||
say barks[UI_get_random(numbarks)];
|
||||
}
|
||||
}
|
||||
|
||||
// The following are optional tweaks:
|
||||
// Force visible.
|
||||
npc->clear_item_flag(0);
|
||||
// Uncharm.
|
||||
npc->clear_item_flag(2);
|
||||
// Uncurse.
|
||||
npc->clear_item_flag(3);
|
||||
// Unparalyze.
|
||||
npc->clear_item_flag(7);
|
||||
// Unprotect.
|
||||
npc->clear_item_flag(9);
|
||||
// Remove might.
|
||||
npc->clear_item_flag(12);
|
||||
}
|
||||
|
||||
|
||||
// Script it to return here again.
|
||||
script item after 4 ticks // Change this at your leisure.
|
||||
{
|
||||
// nohalt;
|
||||
call StormCloak;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (event == UNREADIED)
|
||||
{
|
||||
UI_close_gumps();
|
||||
UI_error_message("Storm cloak un-equipped");
|
||||
UI_halt_scheduled(item);
|
||||
UI_set_weather(CLEAR_WEATHER);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
327
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/tombstones.uc
Executable file
327
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/items/tombstones.uc
Executable file
@@ -0,0 +1,327 @@
|
||||
void tombstones shape# (715)()
|
||||
{
|
||||
var quality = get_item_quality();
|
||||
|
||||
//CAN ONLY BE 9 CHARs Long!
|
||||
//TH = (
|
||||
//NG = *
|
||||
//EA = +
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
UI_close_gumps();
|
||||
var msg;
|
||||
var msg1;
|
||||
var msg2;
|
||||
var msg3;
|
||||
var quality = get_item_quality();
|
||||
|
||||
if (quality == 0)
|
||||
msg = ["seeking", "a", "present"];
|
||||
|
||||
else if (quality == 1)
|
||||
msg = ["to give", "a", "druid"];
|
||||
|
||||
else if (quality == 2)
|
||||
|
||||
msg = ["try a", "bottle of", "our"];
|
||||
|
||||
else if (quality == 3)
|
||||
|
||||
msg = ["embalming", "fluid"];
|
||||
|
||||
else if (quality == 4)
|
||||
|
||||
msg = ["burma", "grave"];
|
||||
|
||||
else if (quality == 5)
|
||||
|
||||
msg = ["as you", "are now", "so once was i", "as i am you", "shall soon be" ,"prepare", "for death", "when this", "you see"];
|
||||
|
||||
else if (quality == 6)
|
||||
|
||||
msg = ["as i am", "you shall", "soon be"];
|
||||
|
||||
else if (quality == 7)
|
||||
|
||||
msg = ["The crypt", "of", "Beyvin"];
|
||||
|
||||
else if (quality == 8)
|
||||
|
||||
msg = ["The crypt", "of", "Malone"];
|
||||
|
||||
else if (quality == 9)
|
||||
|
||||
msg = ["The crypt", "of", "Bourbonnais"];
|
||||
|
||||
else if (quality == 10)
|
||||
|
||||
msg = ["The crypt", "of", "Jannati"];
|
||||
|
||||
else if (quality == 11)
|
||||
|
||||
msg = ["The crypt", "of", "Romero"];
|
||||
|
||||
else if (quality == 12)
|
||||
|
||||
msg = ["The crypt", "of", "Dwyer"];
|
||||
|
||||
else if (quality == 13)
|
||||
|
||||
msg = ["The crypt", "of", "Gabriella"];
|
||||
|
||||
else if (quality == 14)
|
||||
{
|
||||
msg1 = ["Husband", "the first Sir", "Cedric burned", "with fire bold"];
|
||||
msg = ["till his life", "was quenched", "with a", "dagger cold"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
else if (quality == 15)
|
||||
{
|
||||
msg1 = ["Husband", "the second", "Roderic passed", "with an awful", "wail"];
|
||||
msg = ["when", "someone served", "him poisoned", "ale"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
else if (quality == 16) //for long tombstones- show last msg first. 'msg' always displays first
|
||||
{
|
||||
msg1 = ["Husband", "the third", "Walter passed", "on in", "his sleep"];
|
||||
msg = ["his thoughts", "a secret", "that death", "will keep"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
else if (quality == 17)
|
||||
{
|
||||
msg1 = ["Husband", "the fourth", "Rogers manner", "was formal"];
|
||||
msg2 = ["and stiff", "till one day", "he fell off", "a cliff"];
|
||||
msg3 = ["but now", "his bodys a", "cordial host"];
|
||||
msg = ["to worms", "and maggots", "for he's", "a ghost"];
|
||||
UI_display_runes(50, msg1);
|
||||
UI_display_runes(50, msg2);
|
||||
UI_display_runes(50, msg3);
|
||||
}
|
||||
|
||||
|
||||
else if (quality == 18)
|
||||
{
|
||||
msg1 = ["Husband", "the fifth", "Martin left", "this world", "of toil"];
|
||||
msg = ["when he", "fell in a", "vat of", "boiling oil"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
else if (quality == 19)
|
||||
{
|
||||
msg1 = ["Though she", "outlasted", "husbands five"];
|
||||
msg2 = ["now Beth", "too is", "no more", "alive"];
|
||||
msg3 = ["but as", "she drew her", "final breath"];
|
||||
msg = ["she smiled", "a smile", "to scoff", "at death"];
|
||||
UI_display_runes(50, msg1);
|
||||
UI_display_runes(50, msg2);
|
||||
UI_display_runes(50, msg3);
|
||||
}
|
||||
|
||||
else if (quality == 20)
|
||||
{
|
||||
msg1 = ["Here lies a", "man twas", "known as Ed"];
|
||||
msg = ["So Loud", "alive so", "quiet dead"];
|
||||
UI_display_runes(50, msg1);
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 21)
|
||||
{
|
||||
msg1 = ["Hinges", "Rusty on", "your loved", "ones coffin"];
|
||||
msg = ["tis not", "a box", "that youll", "open often", "burma grave"];
|
||||
|
||||
UI_display_runes(50, msg1);
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 22)
|
||||
{
|
||||
msg1 = ["Golden", "Lads and", "Lasses Must"];
|
||||
msg = ["Like", "Chimney", "sweepers", "come to", "dust"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
else if (quality == 23)
|
||||
{
|
||||
msg1 = ["This great", "Musician is", "not just", "dozing"];
|
||||
msg = ["Here he", "lies now", "decomposing"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
else if (quality == 24)
|
||||
{
|
||||
msg1 = ["Here Lies", "Johns body", "we lost", "his head"];
|
||||
msg = ["but he", "doesnt need it", "because hes", "dead"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
else if (quality == 25)
|
||||
{
|
||||
msg1 = ["as you are", "now so once", "was I"];
|
||||
msg2 = ["as I am", "now you soon", "shall be"];
|
||||
msg = ["Prepare", "for death", "when this", "you see"];
|
||||
UI_display_runes(50, msg1);
|
||||
UI_display_runes(50, msg2);
|
||||
}
|
||||
|
||||
else if (quality == 26)
|
||||
{
|
||||
msg1 = ["On his", "wifes birthday", "Ralph Was", "Clever"];
|
||||
msg = ["A Tombstones", "the gift", "that lasts", "forever", "burma grave"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
//Skara Brae
|
||||
|
||||
else if (quality == 27)
|
||||
{
|
||||
msg1 = ["here lies", "the wretched", "remains of", "the archmage", "flain"];
|
||||
msg = ["buried", "where he", "was slain"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
else if (quality == 28)
|
||||
{
|
||||
msg1 = ["here lies", "captain hawkins", "he died a", "hard death"];
|
||||
msg = ["and he", "deserved it"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
else if (quality == 29)
|
||||
{
|
||||
msg = ["here lies", "Quenton", "Beloved Father","and","friend"];
|
||||
|
||||
}
|
||||
else if (quality == 30)
|
||||
{
|
||||
msg = ["here lies", "Gwen", "Gone too soon"];
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 31)
|
||||
{
|
||||
msg = ["here lies", "Kindor", "killed by", "a Shadowlord"];
|
||||
|
||||
}
|
||||
//graves in New Magincia
|
||||
else if (quality == 32)
|
||||
{
|
||||
msg = ["here lies", "heywood", "1-1-136"];
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 33)
|
||||
{
|
||||
msg = ["here lies", "Slim", "1-1-136"];
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 34)
|
||||
{
|
||||
msg = ["here lies", "Banter", "1-1-136"];
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 35)
|
||||
{
|
||||
msg = ["here lies", "Demitry", "1-1-136"];
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 36)
|
||||
{
|
||||
msg = ["here lies", "Bulbous", "1-1-136"];
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 37)
|
||||
{
|
||||
msg = ["here lies", "Rushin", "1-1-136"];
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 38)
|
||||
{
|
||||
msg = ["here lies", "Rogi"];
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 39)
|
||||
{
|
||||
msg = ["here lies", "Isaac"];
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 40)
|
||||
{
|
||||
msg1 = ["Here lies", "S.J."];
|
||||
msg = ["He came", "he saw", "he raged"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
else if (quality == 41)
|
||||
{
|
||||
msg1 = ["Here lies", "Alex C."];
|
||||
msg = ["His treasure", "Confiscated"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
|
||||
else if (quality == 42)
|
||||
{
|
||||
msg1 = ["Here lies", "Odkin"];
|
||||
msg = ["His work", "Unfinished"];
|
||||
UI_display_runes(50, msg1);
|
||||
}
|
||||
else if (quality == 43)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["Anten Nom"];
|
||||
else
|
||||
msg = ["To have lacked", "a name"];
|
||||
UI_display_runes(50, msg);
|
||||
}
|
||||
//gargoyle cemetery
|
||||
else if (quality == 44)
|
||||
{
|
||||
if (!gflags[READ_GARGISH_SCROLL])
|
||||
msg = ["kahmanizende", "manchar"];
|
||||
else
|
||||
msg = ["Sacrificial", "remains"];
|
||||
UI_display_runes(50, msg);
|
||||
}
|
||||
|
||||
else if (quality == 45)
|
||||
{
|
||||
|
||||
UI_display_runes(50, "");
|
||||
}
|
||||
else if (quality == 46)
|
||||
{
|
||||
msg1 = ["Here lies", "Phil"];
|
||||
msg = ["Grifting", "aint easy"];
|
||||
UI_display_runes(50, msg1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (quality == 47)
|
||||
{
|
||||
msg1 = ["In memory", "of Kate"];
|
||||
msg = ["Vanished", "without a", "trace"];
|
||||
UI_display_runes(50, msg1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
else msg = ["Stop Cheating!"];
|
||||
|
||||
|
||||
UI_display_runes(50, msg);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
void TrinsicSched 3001()
|
||||
{
|
||||
var hour;
|
||||
var minute;
|
||||
|
||||
if (event == EGG)
|
||||
{
|
||||
hour = UI_game_hour();
|
||||
minute = UI_game_minute();
|
||||
|
||||
if (hour == 11) //11am
|
||||
{
|
||||
IMMANUELLE->move_object([0x4d1, 0x8c7, 0x0]);
|
||||
UI_set_schedule_type(IMMANUELLE, STAND_THERE);
|
||||
IMMANUELLE->set_item_frame_rot(32);
|
||||
|
||||
WHITSABER->move_object([0x4e8, 0x8d2, 0x0]);
|
||||
UI_set_schedule_type(WHITSABER, EAT_AT_INN);
|
||||
}
|
||||
if (hour == 13) //1pm
|
||||
{
|
||||
WHITSABER->move_object([0x51e, 0x8e7, 0x2]);
|
||||
UI_set_schedule_type(WHITSABER, WANDER);
|
||||
}
|
||||
|
||||
if (hour == 14) //2pm
|
||||
{
|
||||
IMMANUELLE->move_object([0x4bb, 0x9a7, 0x0]);
|
||||
UI_set_schedule_type(IMMANUELLE, LOITER);
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (hour == 19) //7pm
|
||||
{
|
||||
WHITSABER->move_object([0x4a8, 0x8e6, 0x0]);
|
||||
UI_set_schedule_type(WHITSABER, SLEEP);
|
||||
}
|
||||
|
||||
|
||||
if (hour == 20) //8pm
|
||||
{
|
||||
IMMANUELLE->move_object([0x4cf, 0x9a7, 0x0]);
|
||||
UI_set_schedule_type(IMMANUELLE, SLEEP);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
void volcano shape#(1177) ()
|
||||
{
|
||||
|
||||
|
||||
var rand = UI_die_roll(100, 300);
|
||||
|
||||
|
||||
if (isNearby(AVATAR))
|
||||
// if (event == PROXIMITY) //changed from proximity
|
||||
{
|
||||
item.say("test");
|
||||
|
||||
Eruption();
|
||||
|
||||
|
||||
script item after 40 ticks // increase number, just for testing
|
||||
{
|
||||
nohalt;
|
||||
// say "test";
|
||||
call volcano;
|
||||
};
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
void yewstaff shape#(1163) ()
|
||||
{
|
||||
var spellbook = AVATAR->find_object(761, QUALITY_ANY, FRAME_ANY);
|
||||
var target = UI_click_on_item();
|
||||
var charges = UI_get_item_quality(item);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void yewstaff_charged_lightning shape#(1164) ()
|
||||
{
|
||||
extern var getOuterContainer 0x945(var obj);
|
||||
var wearer = getOuterContainer(item);
|
||||
|
||||
//if staff runs out of charges, change back into regular yew staff
|
||||
if ((event == UNREADIED) && (UI_get_item_quality(item) < 1))
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_YEW_STAFF);
|
||||
}
|
||||
else if ((event == READIED) && (UI_get_item_quality(item) < 1))
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_YEW_STAFF);
|
||||
}
|
||||
}
|
||||
|
||||
void yewstaff_charged_firebolt shape#(1260) ()
|
||||
{
|
||||
extern var getOuterContainer 0x945(var obj);
|
||||
var wearer = getOuterContainer(item);
|
||||
|
||||
//if staff runs out of charges, change back into regular yew staff
|
||||
if ((event == UNREADIED) && (UI_get_item_quality(item) < 1))
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_YEW_STAFF);
|
||||
}
|
||||
else if ((event == READIED) && (UI_get_item_quality(item) < 1))
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_YEW_STAFF);
|
||||
}
|
||||
}
|
||||
|
||||
void yewstaff_charged_deathbolt shape#(1261) ()
|
||||
{
|
||||
extern var getOuterContainer 0x945(var obj);
|
||||
var wearer = getOuterContainer(item);
|
||||
|
||||
//if staff runs out of charges, change back into regular yew staff
|
||||
if ((event == UNREADIED) && (UI_get_item_quality(item) < 1))
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_YEW_STAFF);
|
||||
}
|
||||
else if ((event == READIED) && (UI_get_item_quality(item) < 1))
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_YEW_STAFF);
|
||||
}
|
||||
else if (UI_get_item_quality(item) < 1)
|
||||
{
|
||||
|
||||
UI_set_item_shape(item, SHAPE_YEW_STAFF);
|
||||
}
|
||||
}
|
||||
|
||||
void yewstaff_charged_poison shape#(1262) ()
|
||||
{
|
||||
extern var getOuterContainer 0x945(var obj);
|
||||
var wearer = getOuterContainer(item);
|
||||
|
||||
//if staff runs out of charges, change back into regular yew staff
|
||||
if ((event == UNREADIED) && (UI_get_item_quality(item) < 1))
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_YEW_STAFF);
|
||||
}
|
||||
else if ((event == READIED) && (UI_get_item_quality(item) < 1))
|
||||
{
|
||||
UI_set_item_shape(item, SHAPE_YEW_STAFF);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,377 @@
|
||||
void createWinglessGargoyle object# ()()
|
||||
{
|
||||
var quality;
|
||||
var quantity;
|
||||
var position;
|
||||
var new_gargoyle;
|
||||
var new_gear;
|
||||
var frame;
|
||||
|
||||
var random_helm;
|
||||
var random_armor;
|
||||
var random_weapon;
|
||||
var random_gold;
|
||||
var random_equipment;
|
||||
var random_container;
|
||||
|
||||
|
||||
var helm;
|
||||
var armor;
|
||||
var weapon;
|
||||
var gold;
|
||||
var equipment;
|
||||
var container;
|
||||
|
||||
var str;
|
||||
var dex;
|
||||
var Int;
|
||||
var combat;
|
||||
|
||||
var current_STR;
|
||||
var current_DEX;
|
||||
var current_INT;
|
||||
var current_COMBAT;
|
||||
|
||||
|
||||
if (event == EGG)
|
||||
{
|
||||
//default quantity is 1 unless otherwise determined
|
||||
quantity = 1;
|
||||
|
||||
//determine random armor, weapon, equipment values
|
||||
random_helm = UI_get_random(2);
|
||||
if (random_helm == 1)
|
||||
helm = SHAPE_LEATHER_HELM;
|
||||
else
|
||||
helm = SHAPE_WOODEN_SHIELD;
|
||||
|
||||
random_armor = UI_get_random(10);
|
||||
if (random_armor <= 6 )
|
||||
armor = SHAPE_LEATHER_ARMOR;
|
||||
else
|
||||
armor = SHAPE_SCALE_ARMOR;
|
||||
|
||||
random_weapon = UI_get_random(3);
|
||||
|
||||
if (random_weapon == 1)
|
||||
weapon = SHAPE_BOOMERANG;
|
||||
else if (random_weapon == 2)
|
||||
weapon = SHAPE_CLUB;
|
||||
else
|
||||
weapon = SHAPE_THROWING_AXE; quantity = 5;
|
||||
|
||||
random_gold = UI_die_roll(20, 55);
|
||||
|
||||
random_equipment = UI_get_random(10);
|
||||
|
||||
frame = 0;
|
||||
if (random_equipment == 1)
|
||||
equipment = SHAPE_GOLD_NUGGET;
|
||||
else if (random_equipment == 2)
|
||||
{
|
||||
equipment = SHAPE_GARGOYLE_JEWELRY;
|
||||
frame = UI_get_random(6);
|
||||
}
|
||||
else if (random_equipment == 3)
|
||||
{
|
||||
equipment = SHAPE_GOLD;
|
||||
quantity = UI_get_random(10);
|
||||
}
|
||||
else if (random_equipment == 4)
|
||||
{
|
||||
equipment = SHAPE_GOLD;
|
||||
quantity = UI_get_random(5);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
equipment = SHAPE_FOOD;
|
||||
frame = UI_get_random(27);
|
||||
}
|
||||
|
||||
random_container = UI_get_random(2);
|
||||
|
||||
if (random_container == 1)
|
||||
container = SHAPE_BACKPACK;
|
||||
else
|
||||
container = SHAPE_BAG;
|
||||
|
||||
|
||||
// Get random Str, Dex, Int, and Combat values
|
||||
dex = UI_die_roll(15, 20);
|
||||
str = UI_die_roll(15, 25);
|
||||
Int = UI_die_roll(8, 12);
|
||||
combat = UI_die_roll(8, 13);
|
||||
|
||||
quality = UI_get_item_quality(item);
|
||||
position = UI_get_object_position(item);
|
||||
|
||||
//create Shape
|
||||
new_gargoyle = UI_create_new_object2(SHAPE_WINGLESS_GARGOYLE, position);
|
||||
UI_set_item_flag(new_gargoyle, TEMPORARY);
|
||||
|
||||
//get current stats so we don't "over-buff" them
|
||||
current_STR = UI_get_npc_prop(new_gargoyle, STRENGTH);
|
||||
current_DEX = UI_get_npc_prop(new_gargoyle, DEXTERITY);
|
||||
current_INT = UI_get_npc_prop(new_gargoyle, INTELLIGENCE);
|
||||
current_COMBAT = UI_get_npc_prop(new_gargoyle, COMBAT);
|
||||
|
||||
//reset current stats by deleting current stats
|
||||
UI_set_npc_prop(new_gargoyle, STRENGTH, -current_STR);
|
||||
UI_set_npc_prop(new_gargoyle, DEXTERITY, -current_DEX);
|
||||
UI_set_npc_prop(new_gargoyle, INTELLIGENCE, -current_INT);
|
||||
UI_set_npc_prop(new_gargoyle, COMBAT, -current_COMBAT);
|
||||
|
||||
|
||||
//Give new gargoyle gear
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, helm, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, armor, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, weapon, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, random_gold, SHAPE_GOLD, 0, FRAME_ANY, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, equipment, 0, frame, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, container, 0, frame, true);
|
||||
|
||||
//Set Gargoyle's new stats
|
||||
UI_set_npc_prop(new_gargoyle, STRENGTH, str);
|
||||
UI_set_npc_prop(new_gargoyle, DEXTERITY, dex);
|
||||
UI_set_npc_prop(new_gargoyle, INTELLIGENCE, Int);
|
||||
UI_set_npc_prop(new_gargoyle, COMBAT, combat);
|
||||
|
||||
// Default for Quality 0
|
||||
if (quality == 0)
|
||||
{
|
||||
//UI_set_alignment(new_gargoyle, EVIL);
|
||||
UI_set_schedule_type(new_gargoyle, IN_COMBAT);
|
||||
}
|
||||
else if (quality == 1)
|
||||
{
|
||||
UI_set_schedule_type(new_gargoyle, FARM);
|
||||
//UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
}
|
||||
else if (quality == 2)
|
||||
{
|
||||
UI_set_schedule_type(new_gargoyle, WANDER);
|
||||
//UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
}
|
||||
else if (quality == 3)
|
||||
{
|
||||
UI_set_schedule_type(new_gargoyle, PATROL);
|
||||
//UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
}
|
||||
else
|
||||
UI_set_schedule_type(new_gargoyle, LOITER);
|
||||
|
||||
//set alignment based on global flags
|
||||
if (inParty(BEHLEM) || gflags[WEARING_AMULET_SUBMISSION] || gflags[SUBMITTED_TO_DRAXINUSOM])
|
||||
UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
else
|
||||
{
|
||||
UI_set_alignment(new_gargoyle, EVIL);
|
||||
UI_set_schedule_type(new_gargoyle, IN_COMBAT);
|
||||
}
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Creates random amounts of wingless gargoyles
|
||||
void createWinglessGargoyle2 3040()
|
||||
{
|
||||
var quality;
|
||||
var quantity;
|
||||
var position;
|
||||
var new_gargoyle;
|
||||
var new_gear;
|
||||
var frame;
|
||||
|
||||
var random_helm;
|
||||
var random_armor;
|
||||
var random_weapon;
|
||||
var random_gold;
|
||||
var random_equipment;
|
||||
var random_container;
|
||||
|
||||
|
||||
var helm;
|
||||
var armor;
|
||||
var weapon;
|
||||
var gold;
|
||||
var equipment;
|
||||
var container;
|
||||
|
||||
var str;
|
||||
var dex;
|
||||
var Int;
|
||||
var combat;
|
||||
|
||||
var current_STR;
|
||||
var current_DEX;
|
||||
var current_INT;
|
||||
var current_COMBAT;
|
||||
|
||||
|
||||
if (event == EGG)
|
||||
{
|
||||
// Get quantity of gargoyles to spawn -
|
||||
// default quantity is 1 unless otherwise determined
|
||||
quantity = 1 + UI_get_random(4);
|
||||
var count = 1;
|
||||
|
||||
UI_error_message("Gargoyle egg count is: " + quantity);
|
||||
|
||||
|
||||
//create each gargoyle in the while loop
|
||||
while (count < quantity)
|
||||
{
|
||||
|
||||
//determine random armor, weapon, equipment values
|
||||
|
||||
//choose a random helmet, or give a wooden shield
|
||||
random_helm = UI_get_random(2);
|
||||
|
||||
if (random_helm == 1)
|
||||
helm = SHAPE_LEATHER_HELM;
|
||||
else
|
||||
helm = SHAPE_WOODEN_SHIELD;
|
||||
|
||||
//chose random armor
|
||||
random_armor = UI_get_random(10);
|
||||
|
||||
if (random_armor <= 6 )
|
||||
armor = SHAPE_LEATHER_ARMOR;
|
||||
else
|
||||
armor = SHAPE_SCALE_ARMOR;
|
||||
|
||||
//choose random weapon
|
||||
random_weapon = UI_get_random(3);
|
||||
|
||||
if (random_weapon == 1)
|
||||
weapon = SHAPE_BOOMERANG;
|
||||
else if (random_weapon == 2)
|
||||
weapon = SHAPE_CLUB;
|
||||
else
|
||||
weapon = SHAPE_THROWING_AXE; quantity = 5;
|
||||
|
||||
//choose random gold amount
|
||||
random_gold = UI_die_roll(15, 55);
|
||||
|
||||
//get random equipment
|
||||
random_equipment = UI_get_random(10);
|
||||
frame = 0;
|
||||
|
||||
if (random_equipment == 1)
|
||||
equipment = SHAPE_GOLD_NUGGET;
|
||||
|
||||
else if (random_equipment == 2)
|
||||
{
|
||||
equipment = SHAPE_GARGOYLE_JEWELRY;
|
||||
frame = UI_get_random(6);
|
||||
}
|
||||
|
||||
else if (random_equipment == 3 || random_equipment == 4)
|
||||
{
|
||||
equipment = SHAPE_GOLD;
|
||||
quantity = random_gold;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
equipment = SHAPE_FOOD;
|
||||
frame = UI_get_random(27);
|
||||
}
|
||||
|
||||
random_container = UI_get_random(2);
|
||||
if (random_container == 1)
|
||||
container = SHAPE_BACKPACK;
|
||||
else
|
||||
container = SHAPE_BAG;
|
||||
|
||||
|
||||
// Get random Str, Dex, Int, and Combat values
|
||||
dex = UI_die_roll(15, 20);
|
||||
str = UI_die_roll(15, 25);
|
||||
Int = UI_die_roll(8, 12);
|
||||
combat = UI_die_roll(8, 13);
|
||||
|
||||
quality = UI_get_item_quality(item);
|
||||
position = UI_get_object_position(item);
|
||||
|
||||
//create Shape
|
||||
new_gargoyle = UI_create_new_object2(SHAPE_WINGLESS_GARGOYLE, position);
|
||||
UI_set_item_flag(new_gargoyle, TEMPORARY);
|
||||
|
||||
//get current stats so we don't "over-buff" them
|
||||
current_STR = UI_get_npc_prop(new_gargoyle, STRENGTH);
|
||||
current_DEX = UI_get_npc_prop(new_gargoyle, DEXTERITY);
|
||||
current_INT = UI_get_npc_prop(new_gargoyle, INTELLIGENCE);
|
||||
current_COMBAT = UI_get_npc_prop(new_gargoyle, COMBAT);
|
||||
|
||||
//reset current stats by deleting current stats
|
||||
UI_set_npc_prop(new_gargoyle, STRENGTH, -current_STR);
|
||||
UI_set_npc_prop(new_gargoyle, DEXTERITY, -current_DEX);
|
||||
UI_set_npc_prop(new_gargoyle, INTELLIGENCE, -current_INT);
|
||||
UI_set_npc_prop(new_gargoyle, COMBAT, -current_COMBAT);
|
||||
|
||||
|
||||
//Give new gargoyle gear
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, helm, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, armor, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, weapon, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, container, 0, frame, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, random_gold, SHAPE_GOLD, 0, FRAME_ANY, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, equipment, 0, frame, true);
|
||||
|
||||
|
||||
//Set Gargoyle's new stats
|
||||
UI_set_npc_prop(new_gargoyle, STRENGTH, str);
|
||||
UI_set_npc_prop(new_gargoyle, DEXTERITY, dex);
|
||||
UI_set_npc_prop(new_gargoyle, INTELLIGENCE, Int);
|
||||
UI_set_npc_prop(new_gargoyle, COMBAT, combat);
|
||||
|
||||
// Default for Quality 0
|
||||
if (quality == 0)
|
||||
{
|
||||
//UI_set_alignment(new_gargoyle, EVIL);
|
||||
UI_set_schedule_type(new_gargoyle, IN_COMBAT);
|
||||
}
|
||||
else if (quality == 1)
|
||||
{
|
||||
UI_set_schedule_type(new_gargoyle, FARM);
|
||||
//UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
}
|
||||
else if (quality == 2)
|
||||
{
|
||||
UI_set_schedule_type(new_gargoyle, WANDER);
|
||||
//UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
}
|
||||
else if (quality == 3)
|
||||
{
|
||||
UI_set_schedule_type(new_gargoyle, PATROL);
|
||||
//UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
}
|
||||
else
|
||||
UI_set_schedule_type(new_gargoyle, LOITER);
|
||||
|
||||
//set alignment based on global flags
|
||||
if (inParty(BEHLEM) || gflags[WEARING_AMULET_SUBMISSION] || gflags[SUBMITTED_TO_DRAXINUSOM])
|
||||
UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
else
|
||||
{
|
||||
UI_set_alignment(new_gargoyle, EVIL);
|
||||
UI_set_schedule_type(new_gargoyle, IN_COMBAT);
|
||||
}
|
||||
count+=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
void createHighwayman object# ()()
|
||||
{
|
||||
|
||||
//using highwayman to replace "swashbuckler"
|
||||
|
||||
var quality = UI_get_item_quality(item);
|
||||
var quantity;
|
||||
var position;
|
||||
var new_highwayman;
|
||||
var new_gear;
|
||||
var frame;
|
||||
|
||||
var random_helm; //also can be used for other articles of armor
|
||||
var random_armor;
|
||||
var random_leggings;
|
||||
var leggings;
|
||||
var random_weapon;
|
||||
var random_weapon2;
|
||||
var random_gold;
|
||||
var random_equipment;
|
||||
var random_container;
|
||||
var equipment_number;
|
||||
var projectile;
|
||||
var num_projectiles;
|
||||
|
||||
|
||||
|
||||
var helm;
|
||||
var armor;
|
||||
var weapon;
|
||||
var gold;
|
||||
var equipment;
|
||||
var container;
|
||||
var weapon2;
|
||||
|
||||
var str;
|
||||
var dex;
|
||||
var Int;
|
||||
var combat;
|
||||
|
||||
var current_STR;
|
||||
var current_DEX;
|
||||
var current_INT;
|
||||
var current_COMBAT;
|
||||
|
||||
|
||||
|
||||
|
||||
if (event == EGG)
|
||||
{
|
||||
//default quantity is 1 unless otherwise determined
|
||||
quantity = 1;
|
||||
|
||||
//determine random armor, weapon, equipment values
|
||||
random_helm = UI_get_random(4);
|
||||
if (random_helm == 1)
|
||||
helm = SHAPE_LEATHER_HELM;
|
||||
else if (random_helm == 2)
|
||||
helm = SHAPE_WOODEN_SHIELD;
|
||||
else if (random_helm == 3)
|
||||
helm = SHAPE_MAIN_GAUCHE;
|
||||
else
|
||||
helm = SHAPE_LEATHER_COLLAR;
|
||||
|
||||
//make leggings dependent on type of armor used
|
||||
random_armor = UI_get_random(3);
|
||||
if (random_armor == 1)
|
||||
{
|
||||
armor = SHAPE_CLOTH_ARMOR;
|
||||
leggings = SHAPE_CLOTH_LEGGINGS;
|
||||
}
|
||||
else if (random_armor == 2)
|
||||
{
|
||||
armor = SHAPE_LEATHER_ARMOR;
|
||||
leggings = SHAPE_LEATHER_LEGGINGS;
|
||||
}
|
||||
else
|
||||
{
|
||||
armor = SHAPE_RING_MAIL;
|
||||
leggings = SHAPE_CHAIN_LEGGINGS;
|
||||
}
|
||||
|
||||
|
||||
random_weapon = UI_get_random(5);
|
||||
if (random_weapon == 1)
|
||||
weapon = SHAPE_SWORD;
|
||||
else if (random_weapon == 2)
|
||||
weapon = SHAPE_MAIN_GAUCHE;
|
||||
else if (random_weapon == 3)
|
||||
{
|
||||
weapon = SHAPE_THROWING_AXE;
|
||||
quantity = 5;
|
||||
}
|
||||
else if (random_weapon == 4)
|
||||
{
|
||||
weapon = SHAPE_SLING;
|
||||
}
|
||||
else
|
||||
{
|
||||
weapon = SHAPE_BOW;
|
||||
projectile = SHAPE_ARROW;
|
||||
num_projectiles = UI_die_roll(5, 24);
|
||||
}
|
||||
|
||||
|
||||
random_gold = UI_die_roll(1, 25);
|
||||
frame = 0;
|
||||
|
||||
|
||||
random_container = UI_get_random(2);
|
||||
if (random_container == 1)
|
||||
container = SHAPE_BACKPACK;
|
||||
else
|
||||
container = SHAPE_BAG;
|
||||
|
||||
|
||||
// Get random Str, Dex, Int, and Combat values
|
||||
dex = UI_die_roll(15, 20);
|
||||
str = UI_die_roll(15, 25);
|
||||
Int = UI_die_roll(8, 12);
|
||||
combat = UI_die_roll(8, 13);
|
||||
|
||||
quality = UI_get_item_quality(item);
|
||||
position = UI_get_object_position(item);
|
||||
|
||||
//create Shape
|
||||
new_highwayman = UI_create_new_object2(SHAPE_HIGHWAYMAN, position);
|
||||
UI_set_item_flag(new_highwayman, TEMPORARY);
|
||||
|
||||
//get current stats so we don't "over-buff" them
|
||||
current_STR = UI_get_npc_prop(new_highwayman, STRENGTH);
|
||||
current_DEX = UI_get_npc_prop(new_highwayman, DEXTERITY);
|
||||
current_INT = UI_get_npc_prop(new_highwayman, INTELLIGENCE);
|
||||
current_COMBAT = UI_get_npc_prop(new_highwayman, COMBAT);
|
||||
|
||||
//reset current stats by deleting current stats
|
||||
UI_set_npc_prop(new_highwayman, STRENGTH, -current_STR);
|
||||
UI_set_npc_prop(new_highwayman, DEXTERITY, -current_DEX);
|
||||
UI_set_npc_prop(new_highwayman, INTELLIGENCE, -current_INT);
|
||||
UI_set_npc_prop(new_highwayman, COMBAT, -current_COMBAT);
|
||||
|
||||
|
||||
//Give new highwayman gear
|
||||
new_gear = UI_add_cont_items(new_highwayman, 1, helm, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_highwayman, 1, armor, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_highwayman, 1, weapon, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_highwayman, 1, leggings, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_highwayman, 1, container, 0, frame, true);
|
||||
new_gear = UI_add_cont_items(new_highwayman, quantity, SHAPE_GOLD, 0, FRAME_ANY, true);
|
||||
|
||||
if (random_weapon == 5) //Bow
|
||||
{
|
||||
new_gear = UI_add_cont_items(new_highwayman, 1, SHAPE_BOW, QUALITY_ANY, FRAME_ANY, true);
|
||||
new_gear = UI_add_cont_items(new_highwayman, 1, projectile, num_projectiles, FRAME_ANY, true);
|
||||
}
|
||||
|
||||
//Determine how many extra items the npc will have
|
||||
equipment_number = UI_get_random(5);
|
||||
|
||||
while (equipment_number > 0)
|
||||
{
|
||||
|
||||
random_equipment = UI_get_random(10);
|
||||
if (random_equipment == 1)
|
||||
equipment = SHAPE_GOLD_NUGGET;
|
||||
else if (random_equipment == 2)
|
||||
{
|
||||
equipment = SHAPE_POTION;
|
||||
frame = UI_die_roll(0, 2);
|
||||
}
|
||||
else if (random_equipment == 3)
|
||||
{
|
||||
equipment = SHAPE_GOLD;
|
||||
quantity = UI_get_random(10);
|
||||
}
|
||||
else if (random_equipment == 4)
|
||||
{
|
||||
equipment = SHAPE_GOLD;
|
||||
quantity = UI_get_random(5);
|
||||
}
|
||||
else if (random_equipment >= 5)
|
||||
{
|
||||
equipment = SHAPE_FOOD;
|
||||
frame = UI_get_random(27);
|
||||
}
|
||||
else
|
||||
{
|
||||
equipment = SHAPE_GOLD;
|
||||
quantity = UI_get_random(5);
|
||||
}
|
||||
new_gear = UI_add_cont_items(new_highwayman, quantity, equipment, 0, frame, true);
|
||||
equipment_number -= 1;
|
||||
quantity = 1; //resets quantity
|
||||
}
|
||||
|
||||
|
||||
//Set Highwayman's new stats
|
||||
UI_set_npc_prop(new_highwayman, STRENGTH, str);
|
||||
UI_set_npc_prop(new_highwayman, DEXTERITY, dex);
|
||||
UI_set_npc_prop(new_highwayman, INTELLIGENCE, Int);
|
||||
UI_set_npc_prop(new_highwayman, COMBAT, combat);
|
||||
|
||||
// Default for Quality 0
|
||||
if (quality == 0)
|
||||
{
|
||||
UI_set_alignment(new_highwayman, EVIL);
|
||||
UI_set_schedule_type(new_highwayman, IN_COMBAT);
|
||||
}
|
||||
|
||||
else if (quality == 1)
|
||||
{
|
||||
UI_set_schedule_type(new_highwayman, FARM);
|
||||
UI_set_alignment(new_highwayman, NEUTRAL);
|
||||
}
|
||||
else if (quality == 2)
|
||||
{
|
||||
UI_set_schedule_type(new_highwayman, WANDER);
|
||||
UI_set_alignment(new_highwayman, NEUTRAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
UI_set_schedule_type(new_highwayman, WANDER);
|
||||
UI_set_alignment(new_highwayman, NEUTRAL);
|
||||
}
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
void createWingedGargoyle object# ()()
|
||||
{
|
||||
var quality;
|
||||
var quantity;
|
||||
var position;
|
||||
var new_gargoyle;
|
||||
var new_gear;
|
||||
var frame;
|
||||
|
||||
var random_helm = UI_get_random(4);
|
||||
var random_armor = UI_get_random(10);
|
||||
var random_weapon = UI_get_random(7);
|
||||
var random_gold = UI_die_roll(20, 80);
|
||||
var random_equipment;
|
||||
var random_container = UI_get_random(5);
|
||||
var weapon2;
|
||||
var projectile;
|
||||
var num_projectiles;
|
||||
|
||||
|
||||
var helm;
|
||||
var armor;
|
||||
var weapon;
|
||||
var gold;
|
||||
var equipment;
|
||||
var container;
|
||||
|
||||
var str;
|
||||
var dex;
|
||||
var Int;
|
||||
var combat;
|
||||
|
||||
var current_STR;
|
||||
var current_DEX;
|
||||
var current_INT;
|
||||
var current_COMBAT;
|
||||
var gold_amount;
|
||||
|
||||
if (event == EGG)
|
||||
{
|
||||
|
||||
//default quantity is 1 unless otherwise determined
|
||||
quantity = 1;
|
||||
|
||||
//determine random armor, weapon, equipment values
|
||||
if (random_helm == 1)
|
||||
helm = SHAPE_GARGOYLE_HELM;
|
||||
else if (random_helm == 2)
|
||||
helm = SHAPE_WOODEN_SHIELD;
|
||||
else
|
||||
helm = SHAPE_LEATHER_HELM;
|
||||
|
||||
|
||||
if (random_armor <= 6 )
|
||||
armor = SHAPE_LEATHER_ARMOR;
|
||||
else
|
||||
armor = SHAPE_ANTIQUE_ARMOR;
|
||||
|
||||
|
||||
if (random_weapon == 1)
|
||||
weapon = SHAPE_BOOMERANG;
|
||||
else if (random_weapon == 2)
|
||||
weapon = SHAPE_HALBERD;
|
||||
else if (random_weapon == 3)
|
||||
{
|
||||
weapon = SHAPE_PARALYZE;
|
||||
quantity = UI_get_random(3);
|
||||
}
|
||||
else if (random_weapon == 4)
|
||||
{
|
||||
weapon = SHAPE_EXPLOSION;
|
||||
quantity = UI_get_random(3);
|
||||
|
||||
}
|
||||
else if (random_weapon == 5)
|
||||
{
|
||||
weapon = SHAPE_BOW;
|
||||
projectile = SHAPE_ARROW;
|
||||
num_projectiles = UI_die_roll(5, 15);
|
||||
}
|
||||
else if (random_weapon == 6)
|
||||
weapon = SHAPE_TWOHANDEDSWORD;
|
||||
else
|
||||
weapon = SHAPE_CLUB;
|
||||
|
||||
random_gold = UI_die_roll(20, 80);
|
||||
|
||||
random_equipment = UI_get_random(10);
|
||||
frame = 0;
|
||||
if (random_equipment == 1)
|
||||
equipment = SHAPE_GOLD_NUGGET;
|
||||
else if (random_equipment == 2)
|
||||
{
|
||||
equipment = SHAPE_GARGOYLE_JEWELRY;
|
||||
frame = UI_get_random(6);
|
||||
}
|
||||
else if (random_equipment == 3)
|
||||
{
|
||||
equipment = SHAPE_GOLD;
|
||||
quantity = UI_get_random(30);
|
||||
}
|
||||
else if (random_equipment == 4)
|
||||
{
|
||||
equipment = SHAPE_GOLD;
|
||||
quantity = UI_get_random(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
equipment = SHAPE_FOOD;
|
||||
frame = UI_get_random(27);
|
||||
}
|
||||
|
||||
if (random_container == 1)
|
||||
container = SHAPE_LOCKED_CHEST;
|
||||
else if (random_container == 2)
|
||||
container = SHAPE_BAG;
|
||||
else
|
||||
container = SHAPE_BACKPACK;
|
||||
|
||||
|
||||
// Get random Str, Dex, Int, and Combat values
|
||||
dex = UI_die_roll(15, 20);
|
||||
str = UI_die_roll(15, 25);
|
||||
Int = UI_die_roll(8, 12);
|
||||
combat = UI_die_roll(8, 13);
|
||||
|
||||
quality = UI_get_item_quality(item);
|
||||
position = UI_get_object_position(item);
|
||||
|
||||
//create Shape
|
||||
new_gargoyle = UI_create_new_object2(226, position); //Flying Gargoyle warrior
|
||||
UI_set_item_flag(new_gargoyle, TEMPORARY);
|
||||
|
||||
|
||||
//get current stats so we don't "over-buff" them
|
||||
current_STR = UI_get_npc_prop(new_gargoyle, STRENGTH);
|
||||
current_DEX = UI_get_npc_prop(new_gargoyle, DEXTERITY);
|
||||
current_INT = UI_get_npc_prop(new_gargoyle, INTELLIGENCE);
|
||||
current_COMBAT = UI_get_npc_prop(new_gargoyle, COMBAT);
|
||||
|
||||
//reset current stats by deleting current stats
|
||||
UI_set_npc_prop(new_gargoyle, STRENGTH, -current_STR);
|
||||
UI_set_npc_prop(new_gargoyle, DEXTERITY, -current_DEX);
|
||||
UI_set_npc_prop(new_gargoyle, INTELLIGENCE, -current_INT);
|
||||
UI_set_npc_prop(new_gargoyle, COMBAT, -current_COMBAT);
|
||||
|
||||
|
||||
//Give new gargoyle gear
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, container, 0, frame, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, helm, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, armor, 0, 0, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, random_gold, SHAPE_GOLD, 0, FRAME_ANY, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, equipment, 0, frame, true);
|
||||
|
||||
|
||||
if (random_weapon == 3) //Paralyze
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, weapon, quality , FRAME_ANY, true);
|
||||
else if (random_weapon == 4) //Explosion
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, weapon, quality , FRAME_ANY, true);
|
||||
else if (random_weapon == 5) //Bow
|
||||
{
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, weapon, QUALITY_ANY, FRAME_ANY, true);
|
||||
new_gear = UI_add_cont_items(new_gargoyle, num_projectiles, projectile, QUALITY_ANY, FRAME_ANY);
|
||||
}
|
||||
else
|
||||
new_gear = UI_add_cont_items(new_gargoyle, 1, weapon, 0, 0, true);
|
||||
|
||||
//Set Gargoyle's new stats
|
||||
UI_set_npc_prop(new_gargoyle, STRENGTH, str);
|
||||
UI_set_npc_prop(new_gargoyle, DEXTERITY, dex);
|
||||
UI_set_npc_prop(new_gargoyle, INTELLIGENCE, Int);
|
||||
UI_set_npc_prop(new_gargoyle, COMBAT, combat);
|
||||
|
||||
// Default for Quality 0
|
||||
if (quality == 0)
|
||||
{
|
||||
|
||||
UI_set_schedule_type(new_gargoyle, IN_COMBAT);
|
||||
}
|
||||
if (quality == 1)
|
||||
{
|
||||
UI_set_schedule_type(new_gargoyle, FARM);
|
||||
UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
}
|
||||
if (quality == 2)
|
||||
{
|
||||
UI_set_schedule_type(new_gargoyle, WANDER);
|
||||
UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
}
|
||||
if (quality >= 3)
|
||||
{
|
||||
UI_set_schedule_type(new_gargoyle, WANDER);
|
||||
UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
}
|
||||
|
||||
//set alignment based on global flags
|
||||
if (inParty(BEHLEM) || gflags[WEARING_AMULET_SUBMISSION] || gflags[SUBMITTED_TO_DRAXINUSOM])
|
||||
UI_set_alignment(new_gargoyle, NEUTRAL);
|
||||
else
|
||||
{
|
||||
UI_set_alignment(new_gargoyle, EVIL);
|
||||
// UI_set_schedule_type(new_gargoyle, IN_COMBAT);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
void Guards object#(0x625) ()
|
||||
{
|
||||
|
||||
|
||||
if (event == STARTED_TALKING)
|
||||
{
|
||||
//find other arresting guards:
|
||||
var arresting_guards = UI_find_nearby_avatar(946);
|
||||
var guard;
|
||||
var num_guards = UI_get_array_size(arresting_guards);
|
||||
UI_error_message("Number of arresting guards is " + num_guards);
|
||||
|
||||
UI_show_npc_face(16, 0);
|
||||
item.say("You see an irate guard.");
|
||||
item.say("@Wilt thou come quietly?@");
|
||||
if (askYesNo())
|
||||
{
|
||||
say("@A wise decision.@");
|
||||
guardArrest();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
say("@Very well. To the death!!@");
|
||||
for (guard in arresting_guards)
|
||||
{
|
||||
UI_set_schedule_type(guard, IN_COMBAT); //prevent them from speaking after another
|
||||
subtractKarma(15);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
//find other arresting guards:
|
||||
var arresting_guards = UI_find_nearby_avatar(946);
|
||||
var guard;
|
||||
var num_guards = UI_get_array_size(arresting_guards);
|
||||
UI_error_message("Number of arresting guards is " + num_guards);
|
||||
|
||||
UI_show_npc_face(16, 0);
|
||||
item.say("You see an irate guard.");
|
||||
item.say("@Wilt thou come quietly?@");
|
||||
if (askYesNo())
|
||||
{
|
||||
say("@A wise decision.@");
|
||||
guardArrest();
|
||||
UI_play_music(255, 0); //to stop annoying combat music
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
subtractKarma(15);
|
||||
say("@Very well. To the death!!@");
|
||||
for (guard in arresting_guards)
|
||||
{
|
||||
UI_set_schedule_type(guard, IN_COMBAT); //prevent them from speaking after another
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
135
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/monsters/sheep.uc
Executable file
135
info.exult.exult/data/blackgate/mods/Ultima6v1.2/src/usecode/monsters/sheep.uc
Executable file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2006 Alun Bestor/The Exult Team
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Author: Marzo Junior (reorganizing/updating code by Alun Bestor)
|
||||
* Last Modified: 2006-03-19
|
||||
*/
|
||||
|
||||
|
||||
const int SHEARED = 28;
|
||||
const int SHAPE_SHEARS = 698;
|
||||
const int SOUND_SHEARING = 0;
|
||||
|
||||
|
||||
//create the wool beside the Avatar
|
||||
void finishShearing object#() ()
|
||||
{
|
||||
var wool = UI_create_new_object(SHAPE_WOOL);
|
||||
|
||||
wool->set_item_frame(1); //vertical bale
|
||||
wool->set_item_flag(TEMPORARY);
|
||||
|
||||
var target_pos = get_object_position(); //place the new bale next to the sheep
|
||||
target_pos[X] = target_pos[X] + 1;
|
||||
target_pos[Y] = target_pos[Y] + 1;
|
||||
|
||||
//Todo: stick it in the players inventory if it can't be placed here
|
||||
UI_update_last_created(target_pos);
|
||||
|
||||
//Make the sheep run away after the deed is done
|
||||
set_schedule_type(SHY);
|
||||
|
||||
//This prevents us from shearing it twice
|
||||
set_item_flag(MET);
|
||||
}
|
||||
|
||||
//Shear that sheep!
|
||||
void shearSheep ()
|
||||
{
|
||||
script AVATAR
|
||||
{
|
||||
nohalt;
|
||||
//paralyze the avatar so the player can't move during sequence
|
||||
call GenericFreeze;
|
||||
|
||||
face directionFromAvatar(item);
|
||||
say("@Easy now...@");
|
||||
|
||||
repeat 6
|
||||
{
|
||||
actor frame standing;
|
||||
actor frame reach_1h;
|
||||
sfx SOUND_SHEARING;
|
||||
actor frame strike_1h;
|
||||
wait 2;
|
||||
};
|
||||
actor frame standing;
|
||||
|
||||
call GenericUnfreeze; //unparalyze again
|
||||
}
|
||||
|
||||
script item
|
||||
{
|
||||
nohalt;
|
||||
call GenericFreeze;
|
||||
wait 20;
|
||||
say "@Baaa!@";
|
||||
wait 20;
|
||||
say "@Baa-aa-aa!@";
|
||||
call GenericUnfreeze;
|
||||
call finishShearing; //Create the wool
|
||||
}
|
||||
|
||||
//our resident sheep expert
|
||||
if (inParty(KATRINA))
|
||||
{
|
||||
var barks = [
|
||||
"@Thou art doing it all wrong!@",
|
||||
"@Nay, work thy way forwards!@",
|
||||
"@Thou shouldst be a shepherd!@"
|
||||
];
|
||||
delayedBark(KATRINA, randomIndex(barks), 20);
|
||||
}
|
||||
}
|
||||
|
||||
//Organise everything for shearing, and go to the sheep
|
||||
void startShearing (var sheep)
|
||||
{
|
||||
UI_close_gumps();
|
||||
|
||||
//The sheep is already sheared
|
||||
if (sheep->get_item_flag(SHEARED))
|
||||
{
|
||||
randomPartySay("@Thou hast sheared that sheep already! Give the poor thing a chance to grow it back.@");
|
||||
return;
|
||||
}
|
||||
|
||||
//make sure the shears are readied first
|
||||
if (!AVATAR->is_readied(BG_WEAPON_HAND, SHAPE_SHEARS, FRAME_ANY))
|
||||
{
|
||||
randomPartySay("@Thou must have the shears in thy hand.@");
|
||||
return;
|
||||
}
|
||||
|
||||
//Stop the sheep from moving around before we get there.
|
||||
//Note: they will be unfrozen once they have been sheared.
|
||||
//Unfortunately, just using a simple wait (or wait-loop)
|
||||
//doesn't stop the GRAZE schedule from making the sheep
|
||||
//wander off, so we actually have to paralyze them to keep
|
||||
//them still.
|
||||
script sheep { nohalt; call GenericFreeze; }
|
||||
|
||||
//Get in behind the sheep (oh, the jokes never cease)
|
||||
var sheep_offsetx = [0, -1, 1];
|
||||
var sheep_offsety = [1, 1, 1];
|
||||
gotoObject(sheep, sheep_offsetx, sheep_offsety, 0, shearSheep, sheep, SCRIPTED);
|
||||
|
||||
//Hat tip to Marzo for this one - this will unfreeze the
|
||||
//sheep if the player cancels the go-to
|
||||
UI_set_path_failure(GenericUnfreeze, sheep, SCRIPTED);
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
/*
|
||||
* Copyright 2019 AgentOrangeGuy
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
|
||||
void Anya object# (0x425) ()
|
||||
{
|
||||
var party = UI_get_party_list();
|
||||
var player_name = getAvatarName();
|
||||
var polite_title = getPoliteTitle();
|
||||
var hour = UI_game_hour();
|
||||
var partynum = UI_get_array_size(party);
|
||||
var bark;
|
||||
var player_is_female;
|
||||
var greeting; //When addressing party as plural or singular
|
||||
var avatar_bark;
|
||||
var npc_bark;
|
||||
var time_of_day = timeFunction(hour);
|
||||
var schedule = UI_get_schedule_type(item); //gets current schedule
|
||||
var temp = schedule;
|
||||
var current_schedule = temp;
|
||||
|
||||
const int MEAD_SELL_PRICE = 4;
|
||||
const int ALE_SELL_PRICE = 3;
|
||||
const int WINE_SELL_PRICE = 6;
|
||||
|
||||
const int MUTTON_SELL_PRICE = 4;
|
||||
const int CAKE_SELL_PRICE = 8;
|
||||
|
||||
var food_drink_options =["nothing", "mead", "ale", "wine", "mutton", "cake"];
|
||||
var food_drink_frames = [FRAME_MEAD, FRAME_ALE, FRAME_WINE, FRAME_MUTTON, FRAME_CAKE];
|
||||
var prices = [4, 3, 6, 4, 8];
|
||||
|
||||
var initial_choice_question = "@Wouldst thou like ale, mead, wine, mutton, or perhaps a cake@";
|
||||
var askIfInterested1 = "@That'll be "; //split into two to capture price
|
||||
var askIfInterested2 = " gold coins, okay?@";
|
||||
var ask_quantity = "@How many?@";
|
||||
var cant_afford = "@I'm sorry, but you don't have enough gold.@";
|
||||
var cant_hold = "@You haven't any room in your pack.@";
|
||||
var saidNo = "@Anything else I can do for thee?@";
|
||||
var success = "Anya gives you the ";
|
||||
var success2 = "@I hope thou dost enjoy it!@";
|
||||
var nothing = "@Very well. What else dost thou wish to speak about?@";
|
||||
|
||||
//group together dialog options in array for cleaner look
|
||||
var dialog = [initial_choice_question, askIfInterested1, askIfInterested2, ask_quantity, cant_afford, cant_hold, saidNo, nothing, success, success2];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//READ flag used to initiate conversations via TALK
|
||||
var started_talking = UI_get_item_flag(item, READ);
|
||||
|
||||
if (player_is_female) //
|
||||
{
|
||||
// noun = " ";
|
||||
// title = "madame";
|
||||
}
|
||||
else
|
||||
{
|
||||
// noun = " ";
|
||||
// title = " ";
|
||||
}
|
||||
|
||||
//determine single/plural greeting
|
||||
if (partynum > 1)
|
||||
greeting = "friends";
|
||||
else greeting = "friend"; //Avatar is solo
|
||||
|
||||
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
|
||||
//Avatar and NPC greeting barks
|
||||
var av_1st_greet = "@Excuse me, miss..@";
|
||||
var npc_1st_greet = "@What can I do for you?@";
|
||||
|
||||
var av_2nd_greet = "@Hello again.@";
|
||||
var npc_2nd_greet = "@Welcome back, " + greeting + ".@";
|
||||
|
||||
//call convo script
|
||||
startConvo(item, av_1st_greet, npc_1st_greet, av_2nd_greet, npc_2nd_greet);
|
||||
}
|
||||
|
||||
if (started_talking)
|
||||
{
|
||||
if ((current_schedule != WAITER) && (hour < 6))
|
||||
{
|
||||
UI_error_message("Current schedule is, " + current_schedule);
|
||||
UI_error_message("Schedule is, " + schedule);
|
||||
UI_error_message("Hour is, " + hour);
|
||||
item.say("@I'm sorry, " + polite_title + ", but I've just an hour to myself today. I'll gladly talk with thee later.@");
|
||||
delayedBark(item, "Come back tomorrow..", 3);
|
||||
UI_run_schedule(item);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UI_get_item_flag(item, MET))
|
||||
{
|
||||
item.say("You see a buxom woman who looks hard working, yet contented.*");
|
||||
item.say("@Good " + time_of_day + ", " + polite_title + ", and welcome to the Blue Boar Tavern. Art thou here for business or pleasure?@");
|
||||
UI_set_item_flag(item, MET);
|
||||
}
|
||||
else
|
||||
item.say("@Good " + time_of_day + ", " + polite_title + ", and welcome to the Blue Boar Tavern. Art thou here for business or pleasure?@");
|
||||
|
||||
//standard conversation options
|
||||
var options = ["name", "job", "bye", "business", "pleasure"];
|
||||
|
||||
if (gflags[ASKEDARIANAABOUTRUNE])
|
||||
add("rune");
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//Main conversation thread
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
converse(options)
|
||||
{
|
||||
case "name"(remove):
|
||||
say("@I am Anya.@*");
|
||||
|
||||
case "job"(remove):
|
||||
say("@I run this tavern to support my family. The hours are long, but my husband offers what help he can.@");
|
||||
say("@We make enough to pay for my daughter's schooling, so 'tis all worthwhile.@");
|
||||
add(["family"]);
|
||||
|
||||
case "pleasure"(remove):
|
||||
say("@'Tis good to talk with thee again. Things have been slow around here since the gypsies left. Good! Perhaps thou might stay and talk with me a while, before I'm back about my work.@");
|
||||
add(["gypsies"]);
|
||||
|
||||
case "gypsies"(remove):
|
||||
say("@They pass by Britain occasionally. I believe they travel on the King's Way.@");
|
||||
add(["King's Way"]);
|
||||
|
||||
case "King's Way"(remove):
|
||||
say("@The King's Way is the oldest road in Britain.@");
|
||||
|
||||
case "family"(remove):
|
||||
say("@My husband Matt, and my daughter Ariana.@");
|
||||
add(["Matt", "Ariana"]);
|
||||
|
||||
case "Matt"(remove):
|
||||
say("@He had an accident as a child which left him deaf and dumb, but I love him all the same. I only wish he could hear our daughter play, just once. But 'twill ne'er come to pass. He lives in a world of eternal silence.@");
|
||||
if (!UI_set_item_flag(item, NAKED)) //Only gives this option if Avatar hasn't already said yes or no to Anya to prevent repeated karma loss/gain
|
||||
add(["wish"]);
|
||||
|
||||
case "Ariana"(remove):
|
||||
say("@Ariana is the light of my life. Seems she had scarce learned to walk when she first showed a gift for music. She studies now with the bards at the Conservatory.@");
|
||||
add(["bards"]);
|
||||
|
||||
case "wish"(remove):
|
||||
say("Her face brightens suddenly. @You have the look of one who practices the art of magic. Perhaps thou couldst find some spell that might restore my husband's hearing! I know 'tis a lot to ask, but wilt thou try?@");
|
||||
if (askYesNo())
|
||||
{
|
||||
say("@Oh, thank you, " + player_name + "!@");
|
||||
UI_set_item_flag(item, NAKED); //flag used to prevent repeated karma loss/gain
|
||||
addKarma(5);
|
||||
}
|
||||
else
|
||||
{
|
||||
say("Her look of hope changes to one of sorrow as she looks down at the floor to hide her embarrassment. @I'm sorry to have bothered thee,@ she says. @I'm sure thou hast more important things to do.@");
|
||||
UI_set_item_flag(item, NAKED); //flag used to prevent repeated karma loss/gain
|
||||
subtractKarma(5);
|
||||
}
|
||||
|
||||
case "bards"(remove):
|
||||
say("@Bless their hearts for teaching her well. She'll be no tavern wench when she grows older.@*");
|
||||
say("@Perhaps she'll even be court musician to Lord British some day...@");
|
||||
|
||||
case "mantra"(remove):
|
||||
say("@Thou shouldst ask my daughter of that. Methinks the bards have taught her of it.@");
|
||||
|
||||
case "rune"(remove):
|
||||
if (!gflags[ASKED_PARENTS_PERMISSION])
|
||||
{
|
||||
say("@Ah, twas the proudest moment of my life when they awarded my dear little Ariana the Rune of Compassion. They said she was the most promising student they'd ever had at the Conservatory. I'm sure she would show thee the rune, if thou wouldst care to see it.@");
|
||||
say("@Thou dost wish to borrow the Rune of Compassion from my daughter?@ She pauses a while in thought.*");
|
||||
say("@Very well--thou dost have an honest face. I grant thee my permission.@");
|
||||
gflags[ASKED_PARENTS_PERMISSION] = true;
|
||||
|
||||
}
|
||||
else
|
||||
say("@I already gave thee my permission to borrow the rune! Do thou be careful not to lose the stone or let any harm befall it. Ariana would never forgive herself.@");
|
||||
add(["mantra"]);
|
||||
|
||||
|
||||
case "business":
|
||||
sellFood(ANYA, food_drink_options, prices, food_drink_frames, dialog);
|
||||
|
||||
|
||||
|
||||
//TODO: add sidequest to cure Matt
|
||||
|
||||
case "bye":
|
||||
say("@Well, 'tis time I was back about my work. Dishes to wash, food to cook, drinks to serve... I thank thee for stopping by to brighten my day with thy conversation. Do thou come again.@");
|
||||
var avatar_goodbye = "@Have a good " + time_of_day + "!@";
|
||||
var npc_goodbye = "@Come back anytime!@";
|
||||
|
||||
//function that is called, do not change this:
|
||||
sayGoodbye(item, npc_goodbye, avatar_goodbye);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
else scheduleBarks(item);
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
void Ariana object# (0x418) ()
|
||||
{
|
||||
|
||||
var party = UI_get_party_list();
|
||||
var player_name = getAvatarName();
|
||||
var polite_title = getPoliteTitle();
|
||||
var hour = UI_game_hour();
|
||||
var partynum = UI_get_array_size(party);
|
||||
var bark;
|
||||
var time_of_day;
|
||||
var player_is_female;
|
||||
var greeting; //When addressing party as plural or singular
|
||||
var avatar_bark;
|
||||
var npc_bark;
|
||||
|
||||
var got_compassion_rune = UI_get_item_flag(item, PETRA); //set once you have the rune
|
||||
|
||||
|
||||
|
||||
if (player_is_female) //
|
||||
{
|
||||
// noun = " ";
|
||||
// title = "madame";
|
||||
}
|
||||
else
|
||||
{
|
||||
// noun = " ";
|
||||
// title = " ";
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////Time of day/////////////
|
||||
|
||||
if ((hour >= 6) && (hour < 12)) //'good morning'
|
||||
{
|
||||
time_of_day = "morning";
|
||||
}
|
||||
|
||||
if ((hour >= 12) && (hour < 18)) //'good afternoon'
|
||||
{
|
||||
time_of_day = "afternoon";
|
||||
}
|
||||
else time_of_day = "evening";
|
||||
|
||||
|
||||
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
if (partynum > 1) greeting = "friends";
|
||||
else greeting = "friend"; //Avatar is solo
|
||||
|
||||
var met_ariana = UI_get_item_flag(item, MET); //
|
||||
|
||||
//barks for Avatar
|
||||
if (!met_ariana) bark = "@Hello there..@"; //
|
||||
else bark = "@Hello, Ariana!@"; //barked after npc is met
|
||||
|
||||
script AVATAR
|
||||
{
|
||||
call GenericFreeze;
|
||||
face AVATAR->find_direction(item);
|
||||
actor frame standing;
|
||||
say bark;
|
||||
wait 10;
|
||||
};
|
||||
|
||||
|
||||
//NPC barks
|
||||
if (!met_ariana) bark = "@Hi!@"; //change !met_ariana with !met_yourariana - npc's first greeting bark
|
||||
else bark = "@Hi, Avatar!@"; //bark when npc met you already
|
||||
|
||||
|
||||
script item
|
||||
{
|
||||
call GenericFreeze;
|
||||
wait 5;
|
||||
face find_direction(AVATAR);
|
||||
actor frame standing;
|
||||
say bark;
|
||||
wait 8;
|
||||
call (Ariana);
|
||||
};
|
||||
}
|
||||
else if (event == SCRIPTED)
|
||||
{
|
||||
//Unfreeze Avatar and ITEM:
|
||||
AVATAR->GenericUnfreeze();
|
||||
item->GenericUnfreeze();
|
||||
|
||||
if (!UI_get_item_flag(item, MET))
|
||||
{
|
||||
UI_set_item_flag(item, MET);
|
||||
item.say("You see a cute little girl with short hair.");
|
||||
item.say("@My parents told me never to talk to strangers. What's your name?@");
|
||||
var avatar_or_name = chooseFromMenu(["The Avatar", ("I am " + player_name)]);
|
||||
|
||||
if (avatar_or_name == "The Avatar")
|
||||
say("@Ok, now I can talk to you!@");
|
||||
|
||||
else if (avatar_or_name == ("I am " + player_name))
|
||||
say("@Ok, now I can talk to you!@");
|
||||
}
|
||||
else
|
||||
|
||||
if (gflags[ASKEDARIANAABOUTRUNE] && !got_compassion_rune)
|
||||
{
|
||||
item.say("@Hi! Did you get permission from my parents to borrow the rune?@");
|
||||
if (askYesNo())
|
||||
{
|
||||
if (!gflags[ASKED_PARENTS_PERMISSION])
|
||||
subtractKarma(10); //take a karma hit for tellin fibs to the little turd
|
||||
if (UI_add_party_items(1, SHAPE_RUNE, QUALITY_ANY, FRAME_COMPASSION, true))
|
||||
{
|
||||
item.say("@Then here you are.@ She hands you the rune. @I wish you the best of luck on your quest.@");
|
||||
UI_set_item_flag(item, PETRA); //got_compassion_rune
|
||||
gflags[ASKED_PARENTS_PERMISSION] = false;
|
||||
script item after 3 ticks say "@Good luck!@";
|
||||
return;
|
||||
|
||||
}
|
||||
else
|
||||
item.say("@Oh, you're carrying too much right now. You'd better come back for it later.@");
|
||||
}
|
||||
else
|
||||
item.say("@Well, if you get their permission later, let me know.@");
|
||||
}
|
||||
else
|
||||
item.say("@Oh, hello again.@");
|
||||
|
||||
var options = ["name", "job", "bye"];
|
||||
|
||||
if (UI_get_item_flag(item, SI_ZOMBIE)) //Set by Tholden/Lady Nan/anyone else asked about rune
|
||||
add(["rune", "mantra"]);
|
||||
|
||||
|
||||
|
||||
//Variable conversation options based on global flags or people met. Remove if none/////
|
||||
// if (gflags[GLOBAL_FLAG_HERE])
|
||||
// add("Insert Convo topic here");
|
||||
|
||||
|
||||
//-------------------------------------------------------------//based on MET flag - delete all if not used
|
||||
// if (UI_get_item_flag(ARIANA, MET))
|
||||
// add ("NPC name");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
converse(options)
|
||||
{
|
||||
case "name"(remove):
|
||||
say("She curtsies gracefully. @Ariana is my name.@");
|
||||
|
||||
case "job"(remove):
|
||||
say("@I'm learning to be a bard. I like to play the harpsichord best.@");
|
||||
add(["bard", "play"]);
|
||||
|
||||
case "bard"(remove):
|
||||
say("@I want to be a bard when I grow up. They have more fun than anybody!@");
|
||||
add(["fun"]);
|
||||
|
||||
case "play"(remove):
|
||||
say("@I've been studying to be a bard since I was this many.@ She holds up three fingers.*");
|
||||
say("@I'd like to play something for you, but I'm not good enough yet.@");
|
||||
say("She looks away for a moment, then turns back to you, blushing slightly. @Will you come back to hear my music when I am older, if you can?@");
|
||||
if (askYesNo())
|
||||
{
|
||||
say("The little girl's face breaks out into a smile bright enough to light up the whole room. @Really? I would like that very much.@");
|
||||
addKarma(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
say("The little girl sniffles, seeming suddenly on the verge of tears. @I'm sorry,@ she says, @I shouldn't have asked.@ She turns her back, as if ashamed to face you.");
|
||||
subtractKarma(10);
|
||||
UI_set_schedule_type(item, SHY);
|
||||
script item after 3 ticks say "@..sniffles..@";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
case "fun"(remove):
|
||||
say("@Oh yes, lots of it!@");
|
||||
|
||||
case "mantra"(remove):
|
||||
say("@I can't remember it now... And Kenneth just taught it to me last week... Wait, I know! It's 'mo!' Or maybe it was 'om'... Or 'mu,' or 'um'... It was something like that.@");
|
||||
add(["Kenneth"]);
|
||||
|
||||
case "Kenneth"(remove):
|
||||
say("@He's my teacher.@");
|
||||
add(["compassion"]);
|
||||
|
||||
case "compassion"(remove):
|
||||
say("@They taught me all about compassion. They say it's very important for bards.@");
|
||||
|
||||
case "rune"(remove):
|
||||
if (!got_compassion_rune)
|
||||
{
|
||||
say("@I have the Rune of Compassion. Isn't it pretty?@ She reaches into her pocket and takes it out to show you. @Do you need it for something?@");
|
||||
if (askYesNo())
|
||||
{
|
||||
say("@Are you on an important quest?@");
|
||||
if (askYesNo())
|
||||
{
|
||||
say("@I'm not supposed to let anyone else have it. But if you truly need it... I don't know what I should do. I know! My parents run the Blue Boar Tavern. Go ask them if you can borrow the rune. If they say 'tis okay, I'll give it to you.@");
|
||||
gflags[ASKEDARIANAABOUTRUNE] = true;
|
||||
}
|
||||
else
|
||||
say("@I'd best hold onto it then. I was told to look after it carefully.@");
|
||||
}
|
||||
else
|
||||
say("@Ok.@");
|
||||
}
|
||||
else
|
||||
say("@I already gave it to you, silly. I hope you can figure out how to use it.@");
|
||||
|
||||
|
||||
case "bye":
|
||||
avatar_bark = "@Bye Ariana..@";
|
||||
npc_bark = "@See you later!@";
|
||||
delayedBark(AVATAR, avatar_bark, 3);
|
||||
delayedBark(ARIANA, npc_bark, 10);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else scheduleBarks(item);
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
* Copyright 2019 AgentOrangeGuy
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
|
||||
void Arty object# (0x428) ()
|
||||
{
|
||||
|
||||
var party = UI_get_party_list();
|
||||
var player_name = getAvatarName();
|
||||
var polite_title = getPoliteTitle();
|
||||
var hour = UI_game_hour();
|
||||
var partynum = UI_get_array_size(party);
|
||||
var bark;
|
||||
var player_is_female;
|
||||
var greeting; //When addressing party as plural or singular
|
||||
var avatar_bark;
|
||||
var npc_bark;
|
||||
var time_of_day = timeFunction(hour);
|
||||
var schedule = UI_get_schedule_type(item); //use for schedule specific convos
|
||||
var current_schedule = schedule;
|
||||
|
||||
//READ flag used to initiate conversations via TALK
|
||||
var started_talking = UI_get_item_flag(item, READ);
|
||||
|
||||
//make sure it determines shop is open
|
||||
if (UI_get_schedule_type(item) == TEND_SHOP)
|
||||
{
|
||||
UI_set_item_flag(item, SHOP_IS_OPEN);
|
||||
UI_error_message("Shop is open");
|
||||
}
|
||||
|
||||
//custom flag to determine if Arty is drinking or not (STAND).
|
||||
var is_drinking = UI_get_item_flag(item, PETRA);
|
||||
|
||||
//this makes sure you can talk to them still if their shop is open (convo function turns it to TALK)
|
||||
var shop_is_open = UI_get_item_flag(item, SHOP_IS_OPEN);
|
||||
|
||||
|
||||
|
||||
const int FRAME_SILVER = 0;
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
//Avatar and NPC greeting barks
|
||||
var av_1st_greet = "@Excuse me..@";
|
||||
var npc_1st_greet = "@...@";
|
||||
|
||||
var av_2nd_greet = "@Greetings..@";
|
||||
var npc_2nd_greet = "@...@";
|
||||
|
||||
//call convo script
|
||||
startConvo(item, av_1st_greet, npc_1st_greet, av_2nd_greet, npc_2nd_greet);
|
||||
}
|
||||
|
||||
if (started_talking)
|
||||
{
|
||||
item.say("A silent but good-natured man.~");
|
||||
if (UI_get_schedule_type(item) == MAJOR_SIT)
|
||||
item.say("He looks up from his tankard of ale, sees you and smiles.");
|
||||
else
|
||||
item.say("He grins widely and waves at you.");
|
||||
UI_clear_item_flag(item, READ);
|
||||
UI_run_schedule(item);
|
||||
|
||||
//standard conversation options
|
||||
var options = ["name", "job", "bye"];
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Main conversation thread
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
converse(options)
|
||||
{
|
||||
case "name"(remove):
|
||||
say("He points to his mouth and shakes his head.");
|
||||
if (isNearby(DUPRE))
|
||||
{
|
||||
DUPRE.say("@I know of this person, " + player_name + ". He is Arty the Mute, a local shipwright and an honored citizen.@");
|
||||
DUPRE.hide();
|
||||
say("The man smiles and nods.");
|
||||
}
|
||||
add(["mute", "deaf"]);
|
||||
|
||||
case "job":
|
||||
if (is_drinking)
|
||||
say("The man looks at you, puzzled. Then he raises his tankard and goes back to drinking.");
|
||||
|
||||
else
|
||||
{
|
||||
say("He smiles and points to the workbench. On the bench, you see the tools of a shipwright.");
|
||||
add(["buy"]);
|
||||
}
|
||||
case "mute"(remove):
|
||||
say("Arty smiles and nods.");
|
||||
|
||||
case "deaf"(remove):
|
||||
say("The man shakes his head.");
|
||||
|
||||
case "buy"(remove):
|
||||
if (!shop_is_open)
|
||||
say("The man looks at you, puzzled. He shakes his head and spreads his hands as if to say @sorry.@");
|
||||
|
||||
else
|
||||
{
|
||||
say("The man smiles and points to the deed to a shipm and to a sextant.");
|
||||
add(["ship", "sextant"]);
|
||||
}
|
||||
case "ship"(remove):
|
||||
say("Arty shows you a ship deed. Written on it is the price, 400 gold. Do you want to buy the deed?");
|
||||
if(askYesNo())
|
||||
{
|
||||
if (hasGold(400))
|
||||
{
|
||||
if (UI_add_party_items(1, SHAPE_SCROLL, 44, 1, true))
|
||||
{
|
||||
chargeGold(400);
|
||||
say("After accepting the gold, Arty smiles and hands you the deed. He seems pleased.");
|
||||
|
||||
}
|
||||
else say("You don't have enough room to carry the deed");
|
||||
}
|
||||
else say("You don't have enough gold for that.");
|
||||
}
|
||||
else say("Arty shrugs.");
|
||||
|
||||
case "sextant"(remove):
|
||||
say("Arty shows you a sextant. Written on a piece of paper is the price, 20 gold. Do you want to buy the deed?");
|
||||
if(askYesNo())
|
||||
{
|
||||
if (hasGold(20))
|
||||
{
|
||||
if (UI_add_party_items(1, SHAPE_SEXTANT, QUALITY_ANY, FRAME_SILVER, true))
|
||||
{
|
||||
chargeGold(20);
|
||||
say("After accepting the gold, Arty smiles and hands you the sextant. He seems pleased.");
|
||||
|
||||
}
|
||||
else say("You don't have enough room to carry the sextant");
|
||||
}
|
||||
else say("You don't have enough gold for that.");
|
||||
}
|
||||
else say("Arty shrugs.");
|
||||
|
||||
|
||||
|
||||
|
||||
case "bye":
|
||||
if (is_drinking)
|
||||
item.say("Arty waves as you leave, then returns to his ale.");
|
||||
|
||||
else
|
||||
item.say("Arty waves as you leave, then returns to what he was doing.");
|
||||
|
||||
|
||||
var avatar_goodbye = "@Goodbye, Arty!@";
|
||||
var npc_goodbye = "@...@";
|
||||
|
||||
//function that is called, do not change this:
|
||||
sayGoodbye(item, npc_goodbye, avatar_goodbye);
|
||||
UI_run_schedule(item);
|
||||
UI_clear_item_flag(item, PETRA); // to reset "is drinking"
|
||||
break;
|
||||
}
|
||||
}
|
||||
else scheduleBarks(item);
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
|
||||
void Cullen object# (0x434) ()
|
||||
{
|
||||
|
||||
var party = UI_get_party_list();
|
||||
var player_name = getAvatarName();
|
||||
var polite_title = getPoliteTitle();
|
||||
var hour = UI_game_hour();
|
||||
var partynum = UI_get_array_size(party);
|
||||
var bark;
|
||||
var barks;
|
||||
var player_is_female;
|
||||
var greeting; //When addressing party as plural or singular
|
||||
var avatar_bark;
|
||||
var npc_bark;
|
||||
var time_of_day = timeFunction(hour);
|
||||
var schedule = UI_get_schedule_type(item); //use for schedule specific convos
|
||||
var current_schedule = schedule;
|
||||
|
||||
const int BREAD_SELL_PRICE = 3;
|
||||
const int CAKE_SELL_PRICE = 5;
|
||||
const int ROLLS_SELL_PRICE = 1;
|
||||
const int FLOUR_BUY_PRICE = 5;
|
||||
const int PASTRY_SELL_PRICE = 6;
|
||||
|
||||
//READ flag used to initiate conversations via TALK
|
||||
var started_talking = UI_get_item_flag(item, READ);
|
||||
|
||||
//determine single/plural greeting
|
||||
if (partynum > 1)
|
||||
greeting = "friends";
|
||||
else greeting = "friend"; //Avatar is solo
|
||||
|
||||
|
||||
if ((event == PROXIMITY) && (UI_get_schedule_type(item, BAKE)))
|
||||
{
|
||||
barks = UI_get_random(3);
|
||||
if (barks == 1)
|
||||
delayedBark(item, "@Bread fit for a king!@", 0);
|
||||
else if (barks == 2)
|
||||
delayedBark(item, "@Delicious pastries here!@", 0);
|
||||
else
|
||||
delayedBark(item, "@Mouthwatering rolls!@", 0);
|
||||
}
|
||||
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
//Avatar and NPC greeting barks
|
||||
var av_1st_greet = "@Greetings..@";
|
||||
var npc_1st_greet = "@Ah, welcome!@";
|
||||
|
||||
var av_2nd_greet = "@Hello again..@";
|
||||
var npc_2nd_greet = "@Ah, welcome back!@";
|
||||
|
||||
//call convo script
|
||||
startConvo(item, av_1st_greet, npc_1st_greet, av_2nd_greet, npc_2nd_greet);
|
||||
}
|
||||
|
||||
if (started_talking)
|
||||
{
|
||||
//reset schedule for after convo
|
||||
UI_run_schedule(item);
|
||||
|
||||
if (!UI_get_item_flag(item, MET))
|
||||
{
|
||||
item.say("You see a short, dark man, covered in white flour.");
|
||||
item.say("@Hello again my " + greeting + "!@ As he shakes your hand enthusiastically, clouds of flour fly off his clothes.");
|
||||
UI_set_item_flag(item, MET);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.say("You see a short, dark man, covered in white flour.");
|
||||
item.say("@Hello again my " + greeting + "!@ As he shakes your hand enthusiastically, clouds of flour fly off his clothes.");
|
||||
}
|
||||
//standard conversation options
|
||||
var options = ["name", "job", "bye"];
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Main conversation thread
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
converse(options)
|
||||
{
|
||||
case "name":
|
||||
say("@I'm Cullen, Cullen the Baker.@");
|
||||
add(["baker"]);
|
||||
|
||||
case "job":
|
||||
say("@I'd have thought that'd be obvious! I'm a baker!@ As he laughs heartily, more clouds of flour rise off his clothing.*");
|
||||
say("@You can buy bakery goods from me or perhaps you have some flour to sell, eh?@");
|
||||
add(["baker", "buy", "sell"]);
|
||||
|
||||
case "baker"(remove):
|
||||
say("@I bake goods for Lord British himself!@ the man says proudly. @If you'd like to buy some, just say the word!@");
|
||||
|
||||
case "sell" (remove):
|
||||
if (UI_get_schedule_type(item) != BAKE)
|
||||
say("@Come to my shop when it's open!@");
|
||||
else
|
||||
{
|
||||
|
||||
var sack1 = UI_count_objects(PARTY, SHAPE_KITCHEN_ITEMS, QUALITY_ANY, FRAME_UNOPENED_SACK);
|
||||
var sack2 = UI_count_objects(PARTY, SHAPE_KITCHEN_ITEMS, QUALITY_ANY, FRAME_FLOUR);
|
||||
var party_flour = sack1 + sack2;
|
||||
if (party_flour > 0)
|
||||
{
|
||||
say("@Will you take 5 gold for that sack of flour?@");
|
||||
if (askYesNo())
|
||||
{
|
||||
say("@Done!@ He hands you 5 gold pieces and takes the sack of flour.@");
|
||||
if (sack1 >= 1)
|
||||
UI_remove_party_items(1, SHAPE_KITCHEN_ITEMS, QUALITY_ANY, FRAME_UNOPENED_SACK, true);
|
||||
else
|
||||
UI_remove_party_items(1, SHAPE_KITCHEN_ITEMS, QUALITY_ANY, FRAME_FLOUR, true);
|
||||
UI_add_party_items(5, SHAPE_GOLD, QUALITY_ANY, FRAME_ANY, true);
|
||||
}
|
||||
else say ("@Changed your mind, eh?@ he folds his arms. @Well, what else will it be then?@");
|
||||
}
|
||||
else say("@Sorry, you haven't any flour.@");
|
||||
}
|
||||
|
||||
//For shopkeepers:
|
||||
case "buy"(remove):
|
||||
if (UI_get_schedule_type(item) != BAKE)
|
||||
say("@Come to my shop when it's open!@");
|
||||
else
|
||||
{
|
||||
say("@Which item?@");
|
||||
//shopkeeper options
|
||||
var choice;
|
||||
var cant_hold = "@But thou canst not carry any " + choice + "!@";
|
||||
|
||||
var cant_afford = "@I'm sorry, but you don't have enough gold.@";
|
||||
var success = "@Here's thy " + choice + ", " + player_name + ", plus one for luck!@";
|
||||
var askIfInterested; //"Do you want this
|
||||
var saidNo = "Suit thyself, " + polite_title + ", but thou'lt find no better!@";
|
||||
var quantity;
|
||||
|
||||
if (askYesNo())
|
||||
{
|
||||
say("@Which item?@");
|
||||
choice = chooseFromMenu(["bread", "rolls", "cake", "pastry", "nothing"]);
|
||||
|
||||
if (choice == "bread")
|
||||
{
|
||||
askIfInterested = "@Those cost " + BREAD_SELL_PRICE + " gold each. How many do you want, " + polite_title + "?@";
|
||||
quantity = UI_input_numeric_value(1, 100, 1, 1);
|
||||
while (quantity > 50)
|
||||
{
|
||||
say("@Whoa! Don't buy out my entire stock!@");
|
||||
say("@How many do you want, " + polite_title + "?@");
|
||||
quantity = UI_input_numeric_value(1, 100, 1, 1);
|
||||
}
|
||||
basicSell(item, SHAPE_FOOD, quantity, QUALITY_ANY, FRAME_BREAD, BREAD_SELL_PRICE, cant_hold, cant_afford, success, askIfInterested, saidNo);
|
||||
}
|
||||
else if (choice == "rolls")
|
||||
{
|
||||
askIfInterested = "@Those cost " + ROLLS_SELL_PRICE + " gold each. How many do you want, " + polite_title + "?@";
|
||||
quantity = UI_input_numeric_value(1, 100, 1, 1);
|
||||
while (quantity > 50)
|
||||
{
|
||||
say("@Whoa! Don't buy out my entire stock!@");
|
||||
say("@How many do you want, " + polite_title + "?@");
|
||||
quantity = UI_input_numeric_value(1, 100, 1, 1);
|
||||
}
|
||||
basicSell(item, SHAPE_FOOD, quantity, QUALITY_ANY, FRAME_ROLLS, ROLLS_SELL_PRICE, cant_hold, cant_afford, success, askIfInterested, saidNo);
|
||||
}
|
||||
|
||||
else if (choice == "cake")
|
||||
{
|
||||
askIfInterested = "@Those cost " + CAKE_SELL_PRICE + " gold each. How many _do you want, " + polite_title + "?@";
|
||||
quantity = UI_input_numeric_value(1, 100, 1, 1);
|
||||
while (quantity > 50)
|
||||
{
|
||||
say("@Whoa! Don't buy out my entire stock!@");
|
||||
say("@How many do you want, " + polite_title + "?@");
|
||||
quantity = UI_input_numeric_value(1, 100, 1, 1);
|
||||
}
|
||||
basicSell(item, SHAPE_FOOD, quantity, QUALITY_ANY, FRAME_CAKE, CAKE_SELL_PRICE, cant_hold, cant_afford, success, askIfInterested, saidNo);
|
||||
}
|
||||
|
||||
else if (choice == "pastry")
|
||||
{
|
||||
askIfInterested = "@Ah, my specialty! Those cost " + PASTRY_SELL_PRICE + " gold each. How many do you want, " + polite_title + "?@";
|
||||
quantity = UI_input_numeric_value(1, 100, 1, 1);
|
||||
while (quantity > 50)
|
||||
{
|
||||
say("@Whoa! Don't buy out my entire stock!@");
|
||||
say("@How many do you want, " + polite_title + "?@");
|
||||
quantity = UI_input_numeric_value(1, 100, 1, 1);
|
||||
}
|
||||
basicSell(item, SHAPE_FOOD, quantity, QUALITY_ANY, FRAME_PASTRY, PASTRY_SELL_PRICE, cant_hold, cant_afford, success, askIfInterested, saidNo);
|
||||
}
|
||||
else if (choice == "nothing")
|
||||
say("@How about something else, " + polite_title + "?@");
|
||||
|
||||
}
|
||||
else
|
||||
say("@Perhaps some other time, then.@");
|
||||
|
||||
}
|
||||
|
||||
case "bye":
|
||||
|
||||
var avatar_goodbye = "@Farewell..@";
|
||||
var npc_goodbye = "@Come again soon!@";
|
||||
|
||||
//function that is called, do not change this:
|
||||
sayGoodbye(item, npc_goodbye, avatar_goodbye);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
else scheduleBarks(item);
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
|
||||
|
||||
void Daros object# (0x42e) ()
|
||||
{
|
||||
|
||||
var party = UI_get_party_list();
|
||||
var player_name = getAvatarName();
|
||||
var polite_title = getPoliteTitle();
|
||||
var hour = UI_game_hour();
|
||||
var partynum = UI_get_array_size(party);
|
||||
var bark;
|
||||
var player_is_female;
|
||||
var greeting; //When addressing party as plural or singular
|
||||
var avatar_bark;
|
||||
var npc_bark;
|
||||
var time_of_day = timeFunction(hour);
|
||||
var schedule = UI_get_schedule_type(item); //use for schedule specific convos
|
||||
var current_schedule = schedule;
|
||||
|
||||
//READ flag used to initiate conversations via TALK
|
||||
var started_talking = UI_get_item_flag(item, READ);
|
||||
|
||||
if (player_is_female) //
|
||||
{
|
||||
// noun = " ";
|
||||
// title = "madame";
|
||||
}
|
||||
else
|
||||
{
|
||||
// noun = " ";
|
||||
// title = " ";
|
||||
}
|
||||
|
||||
//determine single/plural greeting
|
||||
if (partynum > 1)
|
||||
greeting = "friends";
|
||||
else greeting = "friend"; //Avatar is solo
|
||||
|
||||
|
||||
if (event == PROXIMITY)
|
||||
{
|
||||
var barks = UI_get_random(3);
|
||||
if (barks == 1)
|
||||
{
|
||||
delayedBark(item, "@Oooh, woulda thrown this away?@", 0);
|
||||
|
||||
|
||||
}
|
||||
else if (barks == 2)
|
||||
delayedBark(item, "@Watch the rats, ducky!@", 2);
|
||||
else
|
||||
delayedBark(item, "@Wish I had me some panpipes!@", 3);
|
||||
}
|
||||
|
||||
|
||||
if (event == DOUBLECLICK)
|
||||
{
|
||||
//Avatar and NPC greeting barks
|
||||
var av_1st_greet = "@Hello there..@";
|
||||
var npc_1st_greet = "@Hey hey hey!@";
|
||||
|
||||
var av_2nd_greet = "@Hello again..@";
|
||||
var npc_2nd_greet = "@Oh, hello again ducks!@";
|
||||
|
||||
//call convo script
|
||||
startConvo(item, av_1st_greet, npc_1st_greet, av_2nd_greet, npc_2nd_greet);
|
||||
}
|
||||
|
||||
if (started_talking)
|
||||
{
|
||||
//reset schedule for after convo
|
||||
UI_run_schedule(item);
|
||||
if (!UI_get_item_flag(item, MET))
|
||||
{
|
||||
UI_set_item_flag(item, MET);
|
||||
item.say("A skinny, awkward looking man, wearing boots that come up past his knees.");
|
||||
item.say("@Hey hey hey! Welcome to the finest sewers in Britannia. You look like you need a nickname, so I'll call you 'ducks.'@");
|
||||
}
|
||||
else
|
||||
item.say("@Hey hey hey! Welcome to the finest sewers in Britannia.@");
|
||||
|
||||
//standard conversation options
|
||||
var options = ["name", "job", "bye"];
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Main conversation thread
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
converse(options)
|
||||
{
|
||||
case "name"(remove):
|
||||
say("@My name's Daros, old duck.@ He shakes your hand.");
|
||||
|
||||
case "job":
|
||||
say("@Well, ducky, I keep the sewers running the way they should. When work is slow, sometimes I play a joke or two on my friends to keep things lively.@ He winks at you.");
|
||||
add(["joke", "friends", "sewers"]);
|
||||
|
||||
case "friends"(remove):
|
||||
say("@Even though we don't know each other that well, I'd like to think of you as my friend already.@");
|
||||
|
||||
case "sewers"(remove):
|
||||
say("@Britain is the biggest city in the world, and all those people use a lot of water. All the runoff drains down here. It's not a bad place to work, really, except for the rats.@");
|
||||
add(["Britain", "water", "rats"]);
|
||||
|
||||
case "joke"(remove):
|
||||
say("@Oh you know, ducks, the usual kinds.@ He nudges you in the ribs.");
|
||||
|
||||
case "Britain"(remove):
|
||||
say("@Go back up and have a look! I'm sure it's still there.@ He grins, obviously delighted with his own sense of humor.@");
|
||||
|
||||
case "water"(remove):
|
||||
say("@I wouldn't go swimming around here, ducks.@");
|
||||
|
||||
case "rats"(remove):
|
||||
say("@They're pretty big, ducky, but not to worry. They usually won't eat you until after they've killed you first.@");
|
||||
say("@Of course, if you have a set of panpipes, I hear you can just pipe them away...@");
|
||||
add(["panpipes"]);
|
||||
|
||||
case "panpipes"(remove):
|
||||
say("@I don't have a set myself. I usually just run away.@");
|
||||
add(["run"]);
|
||||
|
||||
case "run"(remove):
|
||||
say("@It's real good exercise!@");
|
||||
|
||||
|
||||
case "bye":
|
||||
if (!gflags[GOT_DUCK]) //used for whether or not he gave duck yet
|
||||
{
|
||||
say("@See you around, old duck.@ He gives you a hearty slap on the back as you leave, which almost knocks one of the straps on your pack loose.");
|
||||
UI_add_party_items(1, SHAPE_DUCK, QUALITY_ANY, FRAME_ANY, true);
|
||||
gflags[GOT_DUCK] = true; //can ask Dupre about ducks
|
||||
|
||||
}
|
||||
else
|
||||
say("@See you around, old duck.@ He gives you a hearty slap on the back as you leave, which almost knocks one of the straps on your pack loose.");
|
||||
var avatar_goodbye = "@So long..@";
|
||||
var npc_goodbye = "@See you around, old duck!@";
|
||||
|
||||
//function that is called, do not change this:
|
||||
sayGoodbye(item, npc_goodbye, avatar_goodbye);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
else scheduleBarks(item);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user