Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Adding Planets To Galaxy Map in TSL

Page: 1 of 1
 stoffe
08-28-2006, 4:20 PM
#1
Taken from this thread here (http://www.lucasforums.com/showthread.php?t=169807), please ask any and all questions about this Tutorial in that thread. ;) -RH

(...quote and explanation snipped...)

To add a new working planet to the Ebon Hawk Galaxy Map you'd roughly follow these steps. The NSS files for scripts mentioned below exist either in scripts.bif, or can be found recreated here (http://www.lucasforums.com/showpost.php?p=1854110&postcount=2):


Make a galaxy map icon for your planet. The easiest way is to extract one of the existing GAL_*_2.tpc files (where * is the planet name, for example GAL_M478_2.tpc), edit that one and then save it under a new name. In this example I'll call the new planet Gaia, so I'll save the modified icon as gal_gaia_2.tga. Put this in the override folder.

Next, create a TXI file containing the texture information KotorTool likely had trouble extracting when you converted the TPC file to TGA. Create a new text file, name it the same as your TGA file but with a TXI extension instead (gal_gaia_2.txi), and as content of the file type in mipmap 0. Save this file along with the TGA file in the override folder.


Open your dialog.tlk file with a TLK editor (TalkEd will do), and add two new entries. The first should contain the name of your new planet (Gaia in this example), the second should contain the specifics of the planet, laid out like:
Climate: Terran
Terrain: Mixed
Docking: Gaia's Landing
Write down the StrRef numbers these two entries were added as, you'll need those numbers soon.


From gui.bif, extract the file named galaxymap_p.gui and save it in your override folder. Open this file with a GFF Editor, expand the CONTROLS list field and select the struct with listindex 11, copy it and paste it in under the CONTROLS field to add a new struct to the list while saving yourself some manual field creation. Open your newly pasted struct, find the BORDER struct inside it and expand that one too. There, find the FILL field and change its value to the name of the planet icon you created in step 1 above, gal_gaia_2 in this case.

Next back up to your new struct again and expand the EXTENT struct (inside it) and change the LEFT and TOP fields to the X and Y coordinates on the galaxy map where you want your planet to appear. Check the coordinates for some of the other planets to get an idea of the scale, though some trial and error may be needed to find the desired location.

Next back up to your new struct again and expand the HILIGHT struct (inside it) and change the value of the FILL field here to the name of the icon you created in step 1 above as well, gal_gaia_2 in this case.

Back up to your new struct again and find the TAG field. Set this to something that has the name of your planet for simplicity, I use LBL_Planet_Gaia in this example, and write this down somewhere as you'll need this tag soon.

Save changes to the modified galaxymap_p.gui file.


Next, open the Planetary.2da file (2da.bif) and find line 12 (live planet 2):
Change the Label field here to the name of your planet (Gaia).
Change the name field to the StrRef number of the name of your planet from step 2 above.
Change the description field to the StrRef number of the description from step 2 above.
Change the icon field to the name of the icon you created in step 1 above (gal_gaia_2).
Change the model field to the name of the model (MDL/MDX) file of the model you want to use for the "spinning planet" 3D view when you select your planet on the galaxy map. Unless you've made a new unique model for your planet you can re-use one of the existing ones, as I do in this example. I set the value planet_06 here, borrowing the planetary view of Dantooine for my planet.
Change the guitag field to the Tag of the struct you added to the galaxymap_p.gui file in the previous step, LBL_Planet_Gaia in this example.

Save your modified planetary.2da in the override folder.


Extract the include file named k_inc_hawk.nss from scripts.bif and put where you compile your scripts. You'll need to make some changes to this include file and use this modified copy when recompiling the following scripts.

First, find the function named SetBackground(). This is responsible for setting what is seen outside the cockpit window in the Ebon Hawk when you have "arrived" at the planet. As far as I am aware it's currently not possible to add new room animations to an area model, so you'll have to use a view from one of the existing planets. Pick one that's close enough to resemble your new planet, I'll use the view for Dxun in this example.

Scroll down to near the end of the long switch...case statement in this function, and before default: add a new case and set the room animation number you want to use here. In this example it looks like (the bolded part is what I added):
(...snip...)
case 10://Hyperspace
{
nRoomAnimation = ANIMATION_ROOM_SCRIPTLOOP11;
}break;
case 12: //ST: Gaia....
{
nRoomAnimation = ANIMATION_ROOM_SCRIPTLOOP05;
}break;
default://error
{
AurPostString("EBO ERROR: No background sepcified!",15,15,10.0);
}
(...snip...)



Next, scroll down to the function SetHologramWorld() and do the same. Before the default: case, add a new case for your planet, like (again, bolded part is what added, the other is just to show where to insert it):
(...snip...)
case 10://Hyperspace
{
sResRef = "";
}break;
case 12: //ST: Gaia...
{
sResRef = "holo_tel";
}break;
default://error
{
AurPostString("EBO ERROR: No background sepcified!",15,15,10.0);
}
(...snip...)

This function set the name of the placeable UTP file for the holographic image of a planet that is shown in the main hold of the ebon hawk while "landed" on the planet. Pick one of the existing ones to re-use if you haven't made your own model, it doesn't matter which one since they are all completely identical as far as I can tell. I used holo_tel in this example. :)


Last, find the function GetCurrentPlanet(), which is used to tell the other scripts what planet you are currently landed/docked at. Again insert a new case near the end, like (bolded part is new, again...):
(...snip...)
case 10://Hyperspace
{
return PLANET_EBON_HAWK;
}break;
case 12: //ST: Gaia...
{
return PLANET_LIVE_02;
}break;
default://error
{
return PLANET_EBON_HAWK;
}
(...snip...)


Save this modified k_inc_hawk.nss include file in a place where it will be used when you recompile the next batch of scripts below.


Using the above modified k_inc_hawk.nss include file, recompile the scripts a_holoworld.nss and k_003ebo_enter.nss that is posted below. No changes to these scripts need to be done directly, they just need to be recompiled for the changes to the k_inc_hawk.nss include file to take effect.


In the script a_galaxymap.nss (used to open the map screen), add...
SetPlanetAvailable(PLANET_LIVE_02, TRUE);
SetPlanetSelectable(PLANET_LIVE_02, TRUE);
...somewhere near the end to make sure the planet is always reachable. If you want the planet to only be reachable under certain conditions you may add additional checks here as well, but in this example the planet should always be there so the above is sufficient. Save the modified script, recompile it and put the resulting a_galaxymap.ncs file in the override folder.


In the script k_sup_galaxymap.nss (used when you pick a destination at the map screen), find the switch statement near the start of the main() function that begins like switch(GetGlobalNumber("003EBO_BACKGROUND")). Add a new case at the end for your planet, like:
case 12: // ST: Gaia....
{
QueueMovie("HypMov01");
}break;

This part plays the departure and hyperspace movies to give the impression of the ship travelling to its destination. If you've made a departure movie for your planet (or want to re-use an existing one) add another QueueMovie() call with the name of the BIK movie file as parameter. Otherwise you can do as the above example and skip the departure movie and go straight to the "jump to hyperspace" movie.

Next scroll down to the next switch statement. This plays the arrival/landing movie for the destination planet, and sets which planet the Ebon Hawk is currently landed on. Add a new case at the end, like:
case PLANET_LIVE_02:
{
SetGlobalNumber("003EBO_RETURN_DEST",12);
SetGlobalNumber("003EBO_BACKGROUND",12);
}break;


This sets which planet you are currently landed on. If you've made a new landing movie for your planet, or want to re-use an existing one you can add a QueueMovie() call with the name of the BIK movie file as parameter after the last of the SetGlobalNumber() function calls.

Save and recompile the file, and put the resulting k_sup_galaxymap.ncs file in the override folder.


If you want to restrict what NPCs may be brought along when exiting the Ebon Hawk on your new planet you can modify the script tr_leave_ehawk.nss to add these restrictions. This script is the OnEnter script of the exit ramp trigger inside the Ebon Hawk.


Open the script check_party_gui.nss and scroll down to the ExitEbonHawk() function (it should be at the top of the script if you use the re-created script I made). In the switch statement inside this function, add a new case above the default case, like (bold text is new):
(..snip..)
case 10: sDest = "IN_TRANSIT"; break;
case 12: sDest = "ST_GAIA"; break;
default: sDest = "ERROR";
(..snip..)

The text you assign at case 12 above (ST_GAIA) is the name of the MOD or RIM file containing your new module (st_gaia.mod in this example). This tells the game what module to load when you exit the Ebon Hawk. Save, recompile and put the resulting check_party_gui.ncs file in the override folder.


These steps will add a new planet to the galaxy map. When selected, a "jump to hyperspace" movie is played and the hawk is "landed" on that planet. When you exit the Ebon Hawk, the module for the new planet will load. With reservation for typos and poor memory, since I just wrote this thing it's only roughly proof-read. :)

The next posts in this thread contain the scripts mentioned above that have no NSS source code available in scripts.bif that you can use.
 stoffe
08-28-2006, 4:20 PM
#2
Above mentioned scripts that have no source available in scripts.bif:

a_holoworld.nss
// ST: a_holoworld.nss (003EBO_s.rim)
#include "k_inc_hawk"

void main() {
SetHologramWorld();
}



check_party_gui.nss
// ST: check_party_gui.nss (003EBO_s.rim)

#include "k_inc_hawk"

void ExitEbonHawk() {
int nDest = GetGlobalNumber("003EBO_RETURN_DEST");
string sDest;

switch (nDest) {
case 0: sDest = "106PER"; break;
case 1: sDest = "201TEL"; break;
case 2: sDest = "262TEL"; break;
case 3: sDest = "301NAR"; break;
case 4: sDest = "401DXN"; break;
case 5: sDest = "601DAN"; break;
case 6: sDest = "701KOR"; break;
case 7: sDest = "801DRO"; break;
case 8: sDest = "IN_TRANSIT"; break;
case 9: sDest = "901MAL"; break;
case 10: sDest = "IN_TRANSIT"; break;
default: sDest = "ERROR";
}

if (sDest == "ERROR")
AurPostString("EBO ERROR: No module sepcified!", 5, 15, 10.0);
else if (sDest == "IN_TRANSIT")
AurPostString("Flying through space, wooooooooo!", 5, 15, 10.0);
else
StartNewModule(sDest, "WP_from_ebonhawk");
}

void main() {
SetGlobalFadeIn();
int nParam = GetRunScriptVar();

if (!nParam) {
object oPC = GetFirstPC();

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_from_outside"))));
}
else {
SetGlobalBoolean("003_PARTY_SPAWN", FALSE);
ExitEbonHawk();
}
}


tr_leave_ehawk.nss
// ST: tr_leave_ehawk.nss (003EBO_s.rim)

#include "k_inc_hawk"

void ExitToDxunOnderon();
void ExitToKorriban();
void DoEbo004ExitHawk();

void main() {
object oEnter = GetEnteringObject();

// ST: Merged tr_leave_ehawk from 003EBO and 004EBO so they both
// work if put in Override.
if (GetTag(GetArea(oEnter)) == "004EBO") {
DoEbo004ExitHawk();
return;
}

SetNPCSelectability(NPC_KREIA, TRUE);
SetNPCSelectability(NPC_ATTON, TRUE);

if (oEnter == GetFirstPC()) {
// ST: In combat
if (GetGlobalNumber("003_IN_COMBAT") == 1) {
BarkString(OBJECT_INVALID, 135165);
return;
}
// ST: In space
else if (GetGlobalNumber("003EBO_RETURN_DEST") == 8) {
BarkString(OBJECT_INVALID, 129942);
return;
}
// ST: Landed on Dxun
else if (GetGlobalNumber("003EBO_RETURN_DEST") == 4) {
SetGlobalFadeOut();
SetFadeUntilScript();
AurPostString("Leaving the hawk", 15, 22, 10.0);
DelayCommand(1.0, ExitToDxunOnderon());
}
// ST: Landed on Korriban
else if (GetGlobalNumber("003EBO_RETURN_DEST") == 6) {
SetGlobalFadeOut();
SetFadeUntilScript();
AurPostString("Leaving the hawk", 15, 22, 10.0);
DelayCommand(1.0, ExitToKorriban());
}
else {
SetGlobalFadeOut();
SetFadeUntilScript();
ShowPartySelectionGUI("check_party_gui", -1, -1, TRUE);
}
}
}

void ExitToDxunOnderon () {
if (GetGlobalBoolean("401_FIRST_ENTER") && (GetGlobalNumber("502OND_End_First") > 0)) {
AurPostString("Atton is selectable", 5, 19, 10.0);
SetNPCSelectability(NPC_ATTON, TRUE);
}
else {
SetNPCSelectability(NPC_ATTON, FALSE);
AurPostString("Atton is NOT selectable", 5, 19, 10.0);
}
AurPostString("Showing party selection", 5, 20, 10.0);
ShowPartySelectionGUI("check_party_gui");
}

void ExitToKorriban() {
SetNPCSelectability(NPC_KREIA, FALSE);
AurPostString("Kreia is NOT selectable", 5, 19, 10.0);
AurPostString("Showing party selection", 5, 20, 10.0);
ShowPartySelectionGUI("check_party_gui");
}

void DoEbo004ExitHawk() {
if (GetEnteringObject() == GetFirstPC()) {
int nDest = GetGlobalNumber("003EBO_RETURN_DEST");
string sDest;

switch (nDest) {
case 0: sDest = "106PER"; break;
case 1: sDest = "201TEL"; break;
case 2: sDest = "262TEL"; break;
case 3: sDest = "301NAR"; break;
case 4: sDest = "401DXN"; break;
case 5: sDest = "601DAN"; break;
case 6: sDest = "701KOR"; break;
case 7: sDest = "801DRO"; break;
case 8: sDest = "ERROR"; break;
case 9: sDest = "901MAL"; break;
case 10: sDest = "ERROR"; break;
default: sDest = "ERROR";
}

if (sDest == "ERROR")
AurPostString("EBO ERROR: No module sepcified!", 5, 15, 10.0);
else
StartNewModule(sDest, "WP_from_ebonhawk");
}
}



a_galaxymap.nss
// ST: a_galaxymap.nss (003EBO_s.rim)

#include "k_inc_hawk"

void main() {
if (GetGlobalNumber("003EBO_Atton_Talk") <= 4) {
object oPC = GetFirstPC();
AssignCommand(oPC, ClearAllActions());
AssignCommand(OBJECT_SELF, ActionStartConversation(oPC, "galaxy", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE));
return;
}
else if (GetGlobalNumber("003EBO_RETURN_DEST") == 4) {
if (GetGlobalNumber("502OND_End_First") == 0) {
object oPC = GetFirstPC();
AssignCommand(oPC, ClearAllActions());
AssignCommand(OBJECT_SELF, ActionStartConversation(oPC, "galaxy2", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE));
return;
}
}
else if (GetGlobalNumber("003_IN_COMBAT") == 1) {
object oPC = GetFirstPC();
AssignCommand(oPC, ClearAllActions());
AssignCommand(OBJECT_SELF, ActionStartConversation(oPC, "galaxy", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE));
return;
}

int nWorld = 0;
for (nWorld = PLANET_DANTOOINE; nWorld < PLANET_LIVE_01; ++nWorld) {
SetPlanetAvailable(nWorld, FALSE);
SetPlanetSelectable(nWorld, FALSE);
}

if (GetGlobalNumber("900MAL_Open") == 1) {
for (nWorld = PLANET_DANTOOINE; nWorld < PLANET_LIVE_01; nWorld++) {
int nPlanet = nWorld;
SetPlanetAvailable(nPlanet, TRUE);

if (nWorld == PLANET_MALACHOR_V)
SetPlanetSelectable(nPlanet, TRUE);
}
}
else if (GetGlobalNumber("262TEL_Escape_Telos") == 1) {
for (nWorld = PLANET_DANTOOINE; nWorld < PLANET_LIVE_01; nWorld++) {
int nPlanet = nWorld;

if (nWorld != PLANET_MALACHOR_V) {
SetPlanetAvailable(nPlanet, TRUE);
if (nWorld != PLANET_PERAGUS)
SetPlanetSelectable(nPlanet, TRUE);
}
}

if (GetGlobalNumber("401DXN_Visited") == 0) {
SetPlanetAvailable(PLANET_DXUN, FALSE);
SetPlanetSelectable(PLANET_DXUN, FALSE);
}
else {
SetPlanetSelectable(PLANET_ONDERON, FALSE);
}
}
else {
SetPlanetAvailable(PLANET_HARBINGER, TRUE);
SetPlanetSelectable(PLANET_HARBINGER, TRUE);
SetPlanetAvailable(PLANET_PERAGUS, TRUE);
SetPlanetSelectable(PLANET_PERAGUS, FALSE);
}

SetPlanetAvailable(PLANET_TELOS, FALSE);
SetPlanetSelectable(PLANET_TELOS, FALSE);
SetPlanetAvailable(PLANET_M4_78, FALSE);
SetPlanetSelectable(PLANET_M4_78, FALSE);
SetPlanetAvailable(PLANET_EBON_HAWK, FALSE);
SetPlanetSelectable(PLANET_EBON_HAWK, FALSE);

int nPlanet = GetCurrentPlanet();

if ((GetGlobalNumber("003EBO_BACKGROUND") == 8) || (GetGlobalNumber("003EBO_BACKGROUND") == 10)) {
nPlanet = PLANET_EBON_HAWK;
SetPlanetAvailable(PLANET_EBON_HAWK, TRUE);
}

SetPlanetSelectable(nPlanet, FALSE);
ShowGalaxyMap(nPlanet);

}



k_003ebo_enter.nss (part 1/2)
// ST: k_003ebo_enter.nss (003EBO_s.rim)

#include "k_inc_hawk"

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Globals used to identify cutscenes:
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int CUTSCENE_NONE = 0;

int CUTSCENE_CUT_ATTON_T3_PAZAAK_1 = 1;
int CUTSCENE_CUT_ATTON_T3_PAZAAK_2 = 2;
int CUTSCENE_CUT_ATTON_T3_ARGUE = 3;
int CUTSCENE_CUT_ATTON_MAID_FIGHT = 4;
int CUTSCENE_CUT_ATTON_KREIA_OFF = 5;
int CUTSCENE_CUT_ATTON_KREIA_GIVE = 6;
int CUTSCENE_CUT_ATTON_KREIA_TAKE = 7;
int CUTSCENE_CUT_ATTON_BAO_PLAYER = 8;

int CUTSCENE_CUT_BAO_CONFRONT_KRE = 10;
int CUTSCENE_CUT_BAO_REMOTE_1 = 11;
int CUTSCENE_CUT_BAO_REMOTE_2 = 12;
int CUTSCENE_CUT_BAO_REMOTE_3 = 13;
int CUTSCENE_CUT_BAO_T3 = 14;
int CUTSCENE_CUT_BAO_HK47_1 = 15;
int CUTSCENE_CUT_BAO_HK47_2 = 16;
int CUTSCENE_CUT_BAO_G0T0_1 = 17;
int CUTSCENE_CUT_BAO_G0T0_2 = 18;
int CUTSCENE_CUT_BAO_MALACHOR = 19;
int CUTSCENE_CUT_BAO_VS_MAND_1 = 20;
int CUTSCENE_CUT_BAO_VS_MAND_2 = 21;

int CUTSCENE_CUT_DISC_PLAYER_MED = 30;
int CUTSCENE_CUT_ATTON_DISC_1 = 31;
int CUTSCENE_CUT_ATTON_DISC_2 = 32;
int CUTSCENE_CUT_ATTON_DISC_3 = 33;
int CUTSCENE_CUT_DISC_TELOS = 34;
int CUTSCENE_CUT_DISC_WORLD_1 = 35;
int CUTSCENE_CUT_DISC_WORLD_2 = 36;
int CUTSCENE_CUT_DISC_FORCE = 37;
int CUTSCENE_DISC_REVAN = 38;

int CUTSCENE_CUT_G0T0_HK47_1 = 40;
int CUTSCENE_CUT_G0T0_REMOTE_1 = 41;
int CUTSCENE_CUT_G0T0_REMOTE_2 = 42;

int CUTSCENE_KREIA_ATTACKS_T3 = 50;
int CUTSCENE_CUT_KREIA_MAID_1 = 51;
int CUTSCENE_CUT_KREIA_MAID_2 = 52;
int CUTSCENE_CUT_KREIA_DISC_1 = 53;
int CUTSCENE_CUT_KREIA_DISC_2 = 54;
int CUTSCENE_CUT_KREIA_DISC_3 = 55;

int CUTSCENE_CUT_MIRA_MAID = 60;

int CUTSCENE_CUT_T3_VS_HK47 = 71;
int CUTSCENE_CUT_T3_DISC_HOLO = 72;

int CUTSCENE_CUT_VISAS_VS_MAID = 80;
int CUTSCENE_VISAS_ARRIVES = 81;

int CUTSCENE_CUT_MSG_FROM_KELBORN = 90;
int CUTSCENE_CUT_FIRST_ATTON = 91;
int CUTSCENE_CUT_SECOND_ATTON = 92;
int CUTSCENE_CUT_BAODUR_LIGHTSABER = 93;

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Function prototypes:
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RunCutscene(int nScene);
void DoCutscenes();
void TriggerCutscenes();
void UpdateSomeNumbers();
void DelayedFadeIn(float fDelay, float fWait, float fLength);

int PlanetCount();
int GetIsAvailable(int nNPC);
int GetInfluenceDiff(int nNPC1, int nNPC2);
int CheckNPCLevel(int nNPC);
int CheckNPCSkill(int nNPC, int nType);

object GetAndMoveNPCToWaypoint(int nNPC, string sTag);
object GetAndMovePUPToWaypoint(int nPUP, string sTag);

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Main function
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void main() {
object oEnter = GetEnteringObject();

if (oEnter == GetFirstPC()) {
SetNPCSelectability(NPC_KREIA, TRUE);
SetNPCSelectability(NPC_ATTON, TRUE);

SetBackground();
SetHologramWorld();

if (GetLoadFromSaveGame()) {
DelayCommand(1.0, RebuildPartyTable());
return;
}

object oDoor = GetObjectByTag("CargoDoor");
AssignCommand(oDoor, ActionOpenDoor(oDoor));

ClearPlayerParty();
ClearEbonHawk();

SetGlobalBoolean("003_cutscene_mode", TRUE);
SetGlobalBoolean("003_PARTY_SPAWN", TRUE);

SpawnAllAvailablePartyMembers();
UpdateSomeNumbers();
DelayCommand(1.0, DoCutscenes());
}
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Increase some globals. Don't know why this is a function.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void UpdateSomeNumbers() {
if (GetGlobalNumber("003EBO_G0T0_BAO_2") == 1) {
SetGlobalNumber("003EBO_G0T0_BAO_2", 2);
}
if (GetGlobalNumber("003EBO_ATTDISC_COUNT") == 1) {
SetGlobalNumber("003EBO_ATTDISC_COUNT", 2);
}
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Trigger Ebon Hawk cutscenes. Wrapper for Dxun arrival.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DoCutscenes() {
object oPC = GetFirstPC();

if (GetGlobalNumber("401DXN_STARTED") == 2) {
SetGlobalNumber("401DXN_STARTED", 3);

object oAtton = GetObjectByTag("Atton");
object oKreia = GetObjectByTag("Kreia");
object oMira = GetObjectByTag("Mira");
object oExile = GetFirstPC();

AssignCommand(oAtton, ClearAllActions());
AssignCommand(oKreia, ClearAllActions());
AssignCommand(oMira, ClearAllActions());
AssignCommand(oExile, ClearAllActions());

AssignCommand(oKreia, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_kreia_dxn"))));
AssignCommand(oExile, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_player_dxn"))));
if (GetIsObjectValid(oMira))
AssignCommand(oMira, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_mira_dxn"))));

DelayCommand(0.2, AssignCommand(oAtton, ActionStartConversation(oExile, "attond", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
return;
}
else if (GetGlobalNumber("401DXN_STARTED") == 4) {
SetGlobalNumber("401DXN_STARTED", 5);

object oAtton = GetObjectByTag("Atton");
object oKreia = GetObjectByTag("Kreia");
object oMira = GetObjectByTag("Mira");
object oExile = GetFirstPC();

AssignCommand(oAtton, ClearAllActions());
AssignCommand(oKreia, ClearAllActions());
AssignCommand(oMira, ClearAllActions());
AssignCommand(oExile, ClearAllActions());

AssignCommand(oKreia, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_kreia_dxn"))));
AssignCommand(oExile, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_player_dxn"))));
if (GetIsObjectValid(oMira))
AssignCommand(oMira, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_mira_dxn"))));

DelayCommand(0.2, AssignCommand(oAtton, ActionStartConversation(oExile, "attond", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
return;
}
else if (GetGlobalBoolean("003_PARTY_SPAWN") && GetGlobalBoolean("003_cutscene_mode")) {
AssignCommand(oPC, ClearAllActions());

if (GetGlobalNumber("003_IN_COMBAT") == 0) {
AssignCommand(oPC, TriggerCutscenes());
}
}
else {
AurPostString("ON 003 ENTER: SHOULD NOT BE HITTING THIS! REPORT TO ANTHONYD.", 5, 14, 10.0);
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, TriggerCutscenes());
}
}


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Determine which cutscene to trigger.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TriggerCutscenes() {
SetGlobalFadeOut();
SetFadeUntilScript();

int nScene;

if (!GetGlobalBoolean("CUT_FIRST_ATTON")
&& (GetIsAvailable(NPC_T3_M4)
&& GetIsAvailable(NPC_ATTON)
&& GetIsAvailable(NPC_KREIA))
&& (GetGlobalNumber("003EBO_Atton_Talk") == 0))
{
AurPostString("CS: 003EBO_Atton_Talk == 0", 5, 15, 5.0);
SetGlobalBoolean("CUT_FIRST_ATTON", TRUE);
nScene = CUTSCENE_CUT_FIRST_ATTON;
}
else if (GetIsAvailable(NPC_ATTON)
&& !GetIsAvailable(NPC_VISAS)
&& GetGlobalBoolean("003EBO_VISAS_ARRIVES")
&& (GetGlobalNumber("262TEL_Escape_Telos") == 1)
&& (PlanetCount() >= 2))
{
AurPostString("CS: VISAS ARRIVES", 5, 15, 5.0);
SetGlobalBoolean("003EBO_VISAS_ARRIVES", FALSE);
SetGlobalBoolean("003EBO_CLEANUP_VISAS", TRUE);
SetGlobalNumber("003_IN_COMBAT", 1);
nScene = CUTSCENE_VISAS_ARRIVES;
}
else if (!GetGlobalBoolean("CUT_BAODUR_LIGHTSABER")
&& GetIsAvailable(NPC_BAO_DUR)
&& (GetGlobalNumber("262TEL_Escape_Telos") == 1))
{
AurPostString("CS: BAODUR LIGHTSABER", 5, 15, 5.0);
SetGlobalBoolean("CUT_BAODUR_LIGHTSABER", TRUE);
nScene = CUTSCENE_CUT_BAODUR_LIGHTSABER;
}
else if (!GetGlobalBoolean("CUT_SECOND_ATTON")
&& GetGlobalBoolean("CUT_FIRST_ATTON")
&& GetIsAvailable(NPC_T3_M4)
&& GetIsAvailable(NPC_ATTON)
&& GetIsAvailable(NPC_KREIA)
&& (GetGlobalNumber("262TEL_CNPC_Freed") == 0)
&& ((GetGlobalNumber("003EBO_Atton_Talk") == 1) || (GetGlobalNumber("003EBO_Atton_Talk") == 2)))
{
AurPostString("CS: 262TEL_CNPC_Freed == 0", 5, 15, 5.0);
SetGlobalBoolean("CUT_SECOND_ATTON", TRUE);
nScene = CUTSCENE_CUT_SECOND_ATTON;
}
else if (!GetGlobalBoolean("CUT_MSG_FROM_KELBORN")
&& GetIsAvailable(NPC_T3_M4)
&& GetGlobalNumber("502OND_End_First")
&& ((GetGlobalNumber("403DXN_Return_Trigger") == 3) || (GetGlobalNumber("000_Jedi_Found") > GetGlobalNumber("403DXN_Return_Trigger"))))
{
AurPostString("CS: MESSAGE FROM KELBORN", 5, 15, 5.0);
SetGlobalBoolean("CUT_MSG_FROM_KELBORN", TRUE);
nScene = CUTSCENE_CUT_MSG_FROM_KELBORN;
}
else if (!GetGlobalBoolean("CUT_ATTON_T3_PAZAAK_1")
&& GetIsAvailable(NPC_ATTON)
&& GetIsAvailable(NPC_T3_M4)
&& (GetGlobalNumber("003EBO_ATTON_T3_START") == 1)
&& (GetGlobalNumber("003EBO_T3_Pazaak") == 0))
{
AurPostString("CS: ATTON T3 PAZAAK", 5, 15, 5.0);
SetGlobalNumber("003EBO_ATTON_T3_START", 2);
SetGlobalBoolean("CUT_ATTON_T3_PAZAAK_1", TRUE);
nScene = CUTSCENE_CUT_ATTON_T3_PAZAAK_1;
}
else if (!GetGlobalBoolean("CUT_ATTON_T3_PAZAAK_2")
&& GetIsAvailable(NPC_ATTON)
&& GetIsAvailable(NPC_T3_M4)
&& (GetGlobalNumber("003EBO_T3_Pazaak") == 1))
{
AurPostString("CS: ATTON T3 PAZAAK 2", 5, 15, 5.0);
SetGlobalBoolean("CUT_ATTON_T3_PAZAAK_2", TRUE);
nScene = CUTSCENE_CUT_ATTON_T3_PAZAAK_2;
}
else if (!GetGlobalBoolean("CUT_ATTON_T3_ARGUE")
&& GetIsAvailable(NPC_ATTON)
&& GetIsAvailable(NPC_T3_M4)
&& ((GetInfluence(NPC_T3_M4) >= 75) || (GetInfluence(NPC_T3_M4) <= 25)))
{
AurPostString("CS: ATTON T3 ARGUE", 5, 15, 5.0);
SetGlobalBoolean("CUT_ATTON_T3_ARGUE", TRUE);
SetGlobalNumber("003EBO_T3_Atton", 1);
nScene = CUTSCENE_CUT_ATTON_T3_ARGUE;
}
else if (!GetGlobalBoolean("CUT_ATTON_MAID_FIGHT")
&& GetIsAvailable(NPC_ATTON)
&& GetIsAvailable(NPC_HANDMAIDEN)
&& (GetGlobalNumber("003EBO_Handmaid_Fight") == 1)
&& (GetGlobalNumber("003EBO_Atton_Hand") == 0))
{
AurPostString("CS: ATTON HANDMAIDEN FIGHT", 5, 15, 5.0);
SetGlobalBoolean("CUT_ATTON_MAID_FIGHT", TRUE);
nScene = CUTSCENE_CUT_ATTON_MAID_FIGHT;
}
else if (!GetGlobalBoolean("CUT_VISAS_VS_MAID")
&& GetIsAvailable(NPC_VISAS)
&& GetIsAvailable(NPC_HANDMAIDEN)
&& (GetGlobalNumber("003EBO_Visas_Hand") == 0)
&& (GetInfluenceDiff(NPC_VISAS, NPC_HANDMAIDEN) >= 15)
&& GetGlobalBoolean("000_PLAYER_GENDER"))
{
AurPostString("CS: VISAS HANDMAIDEN ARGUE", 5, 15, 5.0);
SetGlobalBoolean("CUT_VISAS_VS_MAID", TRUE);
nScene = CUTSCENE_CUT_VISAS_VS_MAID;
}
else if (!GetGlobalBoolean("CUT_MIRA_MAID")
&& GetIsAvailable(NPC_MIRA)
&& GetIsAvailable(NPC_HANDMAIDEN)
&& GetIsAvailable(NPC_VISAS)
&& (GetGlobalNumber("003EBO_Visas_Hand") == 1)
&& (GetGlobalNumber("003EBO_Mira_Hand") == 0))
{
AurPostString("CS: MIRA HANDMAIDEN TALK", 5, 15, 5.0);
SetGlobalBoolean("CUT_MIRA_MAID", TRUE);
nScene = CUTSCENE_CUT_MIRA_MAID;
}
else if (!GetGlobalBoolean("CUT_KREIA_MAID_1")
&& GetIsAvailable(NPC_VISAS)
&& GetIsAvailable(NPC_HANDMAIDEN)
&& GetIsAvailable(NPC_KREIA)
&& (GetGlobalNumber("003EBO_Visas_Hand") == 1)
&& (GetInfluenceDiff(NPC_VISAS, NPC_HANDMAIDEN) >= 30))
{
AurPostString("CS: KREIA HANDMAIDEN DS 1", 5, 15, 5.0);
SetGlobalBoolean("CUT_KREIA_MAID_1", TRUE);
nScene = CUTSCENE_CUT_KREIA_MAID_1;
}
else if (!GetGlobalBoolean("CUT_KREIA_MAID_2")
&& GetIsAvailable(NPC_VISAS)
&& GetIsAvailable(NPC_HANDMAIDEN)
&& GetIsAvailable(NPC_KREIA)
&& (GetGlobalNumber("003EBO_Visas_Hand") == 2)
&& (GetInfluenceDiff(NPC_VISAS, NPC_HANDMAIDEN) >= 45))
{
AurPostString("CS: KREIA HANDMAIDEN DS 2", 5, 15, 5.0);
SetGlobalBoolean("CUT_KREIA_MAID_2", TRUE);
nScene = CUTSCENE_CUT_KREIA_MAID_2;
}
else if (!GetGlobalBoolean("CUT_G0T0_HK47_1")
&& GetIsAvailable(NPC_G0T0)
&& GetIsAvailable(NPC_HK_47)
&& (GetGlobalNumber("003EBO_Goto_HK47") == 0))
{
AurPostString("CS: GOTO HK 47 1", 5, 15, 5.0);
SetGlobalBoolean("CUT_G0T0_HK47_1", TRUE);
nScene = CUTSCENE_CUT_G0T0_HK47_1;
}
else if (!GetGlobalBoolean("CUT_G0T0_REMOTE_1")
&& GetIsAvailable(NPC_G0T0)
&& GetIsAvailable(NPC_BAO_DUR)
&& (GetGlobalNumber("003EBO_G0t0_Remote") == 0))
{
AurPostString("CS: GOTO REMOTE 1", 5, 15, 5.0);
SetGlobalBoolean("CUT_G0T0_REMOTE_1", TRUE);
nScene = CUTSCENE_CUT_G0T0_REMOTE_1;
}
else if (!GetGlobalBoolean("CUT_G0T0_REMOTE_2")
&& GetIsAvailable(NPC_G0T0)
&& GetIsAvailable(NPC_BAO_DUR)
&& (GetGlobalNumber("003EBO_G0t0_Remote") == 1)
&& (GetGlobalNumber("000_Jedi_Found") > 2))
{
AurPostString("CS: GOTO REMOTE 2", 5, 15, 5.0);
SetGlobalBoolean("CUT_G0T0_REMOTE_2", TRUE);
nScene = CUTSCENE_CUT_G0T0_REMOTE_2;
}
else if (!GetGlobalBoolean("CUT_T3_VS_HK47")
&& GetIsAvailable(NPC_HK_47)
&& GetIsAvailable(NPC_T3_M4)
&& (GetGlobalNumber("003EBO_HK47_T3") == 0))
{
AurPostString("CS: T3 HK47 CONFRONTATION", 5, 15, 5.0);
SetGlobalBoolean("CUT_T3_VS_HK47", TRUE);
nScene = CUTSCENE_CUT_T3_VS_HK47;
}
else if (!GetGlobalBoolean("CUT_DISC_PLAYER_MED")
&& GetIsAvailable(NPC_MIRA)
&& GetIsAvailable(NPC_ATTON)
&& GetIsAvailable(NPC_DISCIPLE)
&& (GetGlobalNumber("003EBO_Disciple_Med") == 1)
&& (GetGlobalNumber("003EBO_Meditate_Event") == 0))
{
AurPostString("CS: DISCIPLE PLAYER MEDITATE", 5, 15, 5.0);
SetGlobalBoolean("CUT_DISC_PLAYER_MED", TRUE);
nScene = CUTSCENE_CUT_DISC_PLAYER_MED;
}
else if (!GetGlobalBoolean("CUT_ATTON_DISC_1")
&& GetIsAvailable(NPC_DISCIPLE)
&& GetIsAvailable(NPC_ATTON)
&& (GetGlobalNumber("003EBO_Disciple_Atton") == 0)
&& (GetInfluenceDiff(NPC_DISCIPLE, NPC_ATTON) >= 15))
{
AurPostString("CS: DISCIPLE ATTON FIGHT 1", 5, 15, 5.0);
SetGlobalNumber("003EBO_ATTDISC_COUNT", 1);
SetGlobalBoolean("CUT_ATTON_DISC_1", TRUE);
nScene = CUTSCENE_CUT_ATTON_DISC_1;
}
else if (!GetGlobalBoolean("CUT_ATTON_DISC_2")
&& GetIsAvailable(NPC_DISCIPLE)
&& GetIsAvailable(NPC_ATTON)
&& (GetGlobalNumber("003EBO_Disciple_Atton") == 1)
&& (GetInfluenceDiff(NPC_DISCIPLE, NPC_ATTON) >= 30)
&& (GetGlobalNumber("003EBO_ATTDISC_COUNT") == 2))
{
AurPostString("CS: DISCIPLE ATTON FIGHT 2", 5, 15, 5.0);
SetGlobalBoolean("CUT_ATTON_DISC_2", TRUE);
nScene = CUTSCENE_CUT_ATTON_DISC_2;
}
else if (!GetGlobalBoolean("CUT_ATTON_DISC_3")
&& GetIsAvailable(NPC_DISCIPLE)
&& GetIsAvailable(NPC_ATTON)
&& (GetGlobalNumber("003EBO_T3_Disciple") == 1)
&& (GetGlobalNumber("003EBO_Disciple_Atton") < 3))
{
AurPostString("CS: DISCIPLE ATTON FIGHT 3", 5, 15, 5.0);
SetGlobalBoolean("CUT_ATTON_DISC_3", TRUE);
nScene = CUTSCENE_CUT_ATTON_DISC_3;
}
else if (!GetGlobalBoolean("CUT_T3_DISC_HOLO")
&& GetIsAvailable(NPC_T3_M4)
&& GetIsAvailable(NPC_DISCIPLE)
&& (GetGlobalNumber("000_Jedi_Found") > 2)
&& (GetGlobalNumber("003EBO_Disciple_Atton") == 2)
&& (GetGlobalNumber("003EBO_T3_Disciple") == 0))
{
AurPostString("CS: T3 DISCIPLE HOLOGRAM", 5, 15, 5.0);
SetGlobalBoolean("CUT_T3_DISC_HOLO", TRUE);
nScene = CUTSCENE_CUT_T3_DISC_HOLO;
}
else if (FALSE && !GetGlobalBoolean("CUT_DISC_TELOS"))
{
AurPostString("CS: DISCIPLE CONTACTS TELOS", 5, 15, 5.0);
SetGlobalBoolean("CUT_DISC_TELOS", TRUE);
nScene = CUTSCENE_CUT_DISC_TELOS;
}
else if (!GetGlobalBoolean("CUT_ATTON_KREIA_OFF")
&& GetIsAvailable(NPC_ATTON)
&& GetIsAvailable(NPC_KREIA)
&& (GetGlobalNumber("003EBO_Atton_End") == 1))
{
AurPostString("CS: ATTON TELLS KREIA OFF", 5, 15, 5.0);
SetGlobalBoolean("CUT_ATTON_KREIA_OFF", TRUE);
nScene = CUTSCENE_CUT_ATTON_KREIA_OFF;
}
else if (!GetGlobalBoolean("CUT_ATTON_KREIA_GIVE")
&& GetIsAvailable(NPC_DISCIPLE)
&& GetIsAvailable(NPC_ATTON)
&& GetIsAvailable(NPC_KREIA)
&& (GetInfluenceDiff(NPC_DISCIPLE, NPC_ATTON) >= 50)
&& (GetGlobalNumber("003EBO_Disciple_Atton") == 3))
{
AurPostString("CS: ATTON GIVES UP PLAYER KREIA", 5, 15, 5.0);
SetGlobalBoolean("CUT_ATTON_KREIA_GIVE", TRUE);
nScene = CUTSCENE_CUT_ATTON_KREIA_GIVE;
}
else if (FALSE && !GetGlobalBoolean("CUT_ATTON_KREIA_TAKE"))
{
AurPostString("CS: ATTON KREIA TAKE OFF", 5, 15, 5.0);
SetGlobalBoolean("CUT_ATTON_KREIA_TAKE", TRUE);
nScene = CUTSCENE_CUT_ATTON_KREIA_TAKE;
}
else if (!GetGlobalBoolean("CUT_BAO_CONFRONT_KRE")
&& GetIsAvailable(NPC_BAO_DUR)
&& GetIsAvailable(NPC_KREIA)
&& (GetGoodEvilValue(GetFirstPC()) < 30)
&& ((GetInfluence(NPC_BAO_DUR) > 80) || (GetInfluence(NPC_BAO_DUR) < 20)))
{
AurPostString("CS: BAODUR CONFRONTS KREIA", 5, 15, 5.0);
SetGlobalBoolean("CUT_BAO_CONFRONT_KRE", TRUE);
nScene = CUTSCENE_CUT_BAO_CONFRONT_KRE;
}
else if (!GetGlobalBoolean("CUT_DISC_WORLD_1")
&& GetIsAvailable(NPC_DISCIPLE)
&& GetIsAvailable(NPC_KREIA)
&& (GetGlobalNumber("003EBO_Disciple_Event") == 0)
&& (PlanetCount() >= 2))
{
AurPostString("CS: DISCIPLE STUDIES WORLDS 1", 5, 15, 5.0);
SetGlobalBoolean("CUT_DISC_WORLD_1", TRUE);
nScene = CUTSCENE_CUT_DISC_WORLD_1;
}
else if (!GetGlobalBoolean("CUT_DISC_WORLD_2")
&& GetIsAvailable(NPC_DISCIPLE)
&& (GetGlobalNumber("003EBO_Disciple_Event") == 1)
&& (PlanetCount() >= 4))
{
AurPostString("CS: DISCIPLE STUDIES WORLDS 2", 5, 15, 5.0);
SetGlobalBoolean("CUT_DISC_WORLD_2", TRUE);
nScene = CUTSCENE_CUT_DISC_WORLD_2;
}
else if (!GetGlobalBoolean("CUT_DISC_FORCE")
&& GetIsAvailable(NPC_DISCIPLE)
&& (GetGlobalNumber("003EBO_Disciple_Event") == 2)
&& (GetGlobalNumber("003EBO_Kreia_Disciple") == 3))
{
AurPostString("CS: DISCIPLE PLAYER FORCE RESONANCE", 5, 15, 5.0);
SetGlobalBoolean("CUT_DISC_FORCE", TRUE);
nScene = CUTSCENE_CUT_DISC_FORCE;
}
else if (!GetGlobalBoolean("CUT_KREIA_DISC_1")
&& GetIsAvailable(NPC_KREIA)
&& GetIsAvailable(NPC_DISCIPLE)
&& (GetGlobalNumber("003EBO_Kreia_Disciple") == 0))
{
AurPostString("CS: KREIA VS DISCIPLE 1", 5, 15, 5.0);
SetGlobalBoolean("CUT_KREIA_DISC_1", TRUE);
nScene = CUTSCENE_CUT_KREIA_DISC_1;
}
else if (!GetGlobalBoolean("CUT_KREIA_DISC_2")
&& GetIsAvailable(NPC_KREIA)
&& GetIsAvailable(NPC_DISCIPLE)
&& (GetGlobalNumber("003EBO_Kreia_Disciple") == 1))
{
AurPostString("CS: KREIA VS DISCIPLE 2", 5, 15, 5.0);
SetGlobalBoolean("CUT_KREIA_DISC_2", TRUE);
nScene = CUTSCENE_CUT_KREIA_DISC_2;
}
else if (!GetGlobalBoolean("CUT_KREIA_DISC_3")
&& GetIsAvailable(NPC_KREIA)
&& GetIsAvailable(NPC_DISCIPLE)
&& (GetGlobalNumber("003EBO_Kreia_Disciple") == 2))
{
AurPostString("CS: KREIA VS DISCIPLE 3", 5, 15, 5.0);
SetGlobalBoolean("CUT_KREIA_DISC_3", TRUE);
nScene = CUTSCENE_CUT_KREIA_DISC_3;
}
else if (!GetGlobalBoolean("CUT_ATTON_BAO_PLAYER")
&& GetIsAvailable(NPC_ATTON)
&& GetIsAvailable(NPC_BAO_DUR)
&& GetIsAvailable(NPC_T3_M4)
&& (GetGlobalBoolean("000_PLAYER_GENDER") == FALSE)
&& (GetInfluence(NPC_ATTON) >= 60))
{
AurPostString("CS: ATTON PLAYER BAODUR", 5, 15, 5.0);
SetGlobalBoolean("CUT_ATTON_BAO_PLAYER", TRUE);
nScene = CUTSCENE_CUT_ATTON_BAO_PLAYER;
}
else if (!GetGlobalBoolean("CUT_BAO_REMOTE_1")
&& GetIsAvailable(NPC_BAO_DUR)
&& (GetIsAvailable(NPC_T3_M4)
&& GetIsAvailable(NPC_G0T0)
&& GetIsAvailable(NPC_HK_47)))
{
AurPostString("CS: BAODUR UPGRADE REMOTE 1", 5, 15, 5.0);
SetGlobalBoolean("CUT_BAO_REMOTE_1", TRUE);
nScene = CUTSCENE_CUT_BAO_REMOTE_1;
}
else if (!GetGlobalBoolean("CUT_BAO_REMOTE_2")
&& GetGlobalBoolean("CUT_BAO_REMOTE_1")
&& GetIsAvailable(NPC_BAO_DUR)
&& (CheckNPCLevel(NPC_BAO_DUR) > 8))
{
AurPostString("CS: BAODUR UPGRADE REMOTE 2", 5, 15, 5.0);
SetGlobalBoolean("CUT_BAO_REMOTE_2", TRUE);
nScene = CUTSCENE_CUT_BAO_REMOTE_2;
}
else if (!GetGlobalBoolean("CUT_BAO_REMOTE_3")
&& GetGlobalBoolean("CUT_BAO_REMOTE_2")
&& GetIsAvailable(NPC_BAO_DUR)
&& (CheckNPCLevel(NPC_BAO_DUR) > 10))
{
AurPostString("CS: BAODUR UPGRADE REMOTE 3", 5, 15, 5.0);
SetGlobalBoolean("CUT_BAO_REMOTE_3", TRUE);
nScene = CUTSCENE_CUT_BAO_REMOTE_3;
}
else if (!GetGlobalBoolean("CUT_BAO_T3")
&& GetIsAvailable(NPC_BAO_DUR)
&& GetIsAvailable(NPC_T3_M4)
&& (GetGlobalNumber("262TEL_Escape_Telos") == 1))
{
AurPostString("CS: BAODUR UPGRADE T3", 5, 15, 5.0);
SetGlobalBoolean("CUT_BAO_T3", TRUE);
nScene = CUTSCENE_CUT_BAO_T3;
}
else if (!GetGlobalBoolean("CUT_BAO_HK47_1")
&& GetIsAvailable(NPC_BAO_DUR)
&& GetIsAvailable(NPC_HK_47)
&& (GetGlobalNumber("000_HK47_Joined") == 1))
{
AurPostString("CS: BAODUR UPGRADE HK47 1", 5, 15, 5.0);
SetGlobalBoolean("CUT_BAO_HK47_1", TRUE);
SetGlobalNumber("000_BAODUR_CS_LEVEL", CheckNPCLevel(NPC_BAO_DUR));
nScene = CUTSCENE_CUT_BAO_HK47_1;
}
else if (!GetGlobalBoolean("CUT_BAO_HK47_2")
&& GetGlobalBoolean("CUT_BAO_HK47_1")
&& GetIsAvailable(NPC_BAO_DUR)
&& GetIsAvailable(NPC_HK_47)
&& (CheckNPCLevel(NPC_BAO_DUR) > GetGlobalNumber("000_BAODUR_CS_LEVEL"))
&& (CheckNPCSkill(NPC_BAO_DUR, SKILL_REPAIR) > 15))
{
AurPostString("CS: BAODUR UPGRADE HK47 2", 5, 15, 5.0);
SetGlobalBoolean("CUT_BAO_HK47_2", TRUE);
nScene = CUTSCENE_CUT_BAO_HK47_2;
}
else if (!GetGlobalBoolean("CUT_BAO_G0T0_1")
&& GetIsAvailable(NPC_BAO_DUR)
&& GetIsAvailable(NPC_G0T0))
{
AurPostString("CS: BAODUR UPGRATE GOTO 1", 5, 15, 5.0);
SetGlobalNumber("003EBO_G0T0_BAO_2", 1);
SetGlobalBoolean("CUT_BAO_G0T0_1", TRUE);
nScene = CUTSCENE_CUT_BAO_G0T0_1;
}
else if (!GetGlobalBoolean("CUT_BAO_G0T0_2")
&& GetGlobalBoolean("CUT_BAO_G0T0_1")
&& GetIsAvailable(NPC_BAO_DUR)
&& GetIsAvailable(NPC_G0T0)
&& (GetGlobalNumber("003EBO_G0T0_BAO_2") == 2))
{
AurPostString("CS: BAODUR UPGRADE GOTO 2", 5, 15, 5.0);
SetGlobalBoolean("CUT_BAO_G0T0_2", TRUE);
nScene = CUTSCENE_CUT_BAO_G0T0_2;
}
else if (!GetGlobalBoolean("CUT_BAO_MALACHOR")
&& GetIsAvailable(NPC_BAO_DUR)
&& GetIsAvailable(NPC_CANDEROUS)
&& (GetInfluence(NPC_BAO_DUR) > 85))
{
AurPostString("CS: BAODUR MALACHOR TALK influence = " + IntToString(GetInfluence(NPC_BAO_DUR)), 5, 15, 5.0);
SetGlobalBoolean("CUT_BAO_MALACHOR", TRUE);
nScene = CUTSCENE_CUT_BAO_MALACHOR;
}
else if (!GetGlobalBoolean("CUT_BAO_VS_MAND_1")
&& GetIsAvailable(NPC_BAO_DUR)
&& GetIsAvailable(NPC_CANDEROUS))
{
AurPostString("CS: BAODUR VS MANDALORE 1", 5, 15, 5.0);
SetGlobalBoolean("CUT_BAO_VS_MAND_1", TRUE);
nScene = CUTSCENE_CUT_BAO_VS_MAND_1;
}
else if (!GetGlobalBoolean("CUT_BAO_VS_MAND_2")
&& GetGlobalBoolean("CUT_BAO_VS_MAND_1")
&& GetIsAvailable(NPC_BAO_DUR)
&& GetIsAvailable(NPC_CANDEROUS)
&& (GetInfluence(NPC_BAO_DUR) > 85)
&& (GetInfluence(NPC_CANDEROUS) > 75))
{
AurPostString("CS: BAODUR VS MANDALORE 2", 5, 15, 5.0);
SetGlobalBoolean("CUT_BAO_VS_MAND_2", TRUE);
nScene = CUTSCENE_CUT_BAO_VS_MAND_2;
}
else {
AurPostString("CS: NO PENDING CUTSCENE", 5, 15, 5.0);
nScene = CUTSCENE_NONE;
}

RunCutscene(nScene);
}

Note: This script is continued in the below post. It's too long to fit into a single forum post.
 stoffe
08-28-2006, 4:20 PM
#3
Note: This script is continued from the above post. It's too long to fit into a single forum post.

k_003ebo_enter.nss (part 2/2)

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Setup and run the specified cutscene.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RunCutscene(int nScene) {
object oPC = GetFirstPC();

if (CUTSCENE_NONE == nScene) {
AurPostString("CS: SPAWNING PARTY NO_PENDING_CUTSCENE", 5, 17, 5.0);
SetGlobalBoolean("003_cutscene_mode", FALSE);
ResetEbonHawk();
DelayedFadeIn(0.0, 1.0, 1.0);
}
else if (nScene == CUTSCENE_CUT_BAODUR_LIGHTSABER) {
AurPostString("CS: BAODUR LIGHTSABER", 5, 17, 5.0);
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_4");

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToObject(GetObjectByTag("WP_player_cut_7")));
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oBao, ActionStartConversation(oPC, "baosaber", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_FIRST_ATTON) {
AurPostString("CS: FIRST ATTON EBO CUT SCENE", 5, 17, 5.0);
object oAtton = GetAndMoveNPCToWaypoint(NPC_ATTON, "WP_gspawn_atton");
object oT3M4 = GetAndMoveNPCToWaypoint(NPC_T3_M4, "WP_t3m4_cut_7");
object oKreia = GetAndMoveNPCToWaypoint(NPC_KREIA, "WP_kreia_cut_6");

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_player_cut_6"))));
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oAtton, ActionStartConversation(oPC, "003Atton", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_SECOND_ATTON) {
AurPostString("CS: SECOND ATTON EBO CUT SCENE", 5, 17, 5.0);
object oAtton = GetAndMoveNPCToWaypoint(NPC_ATTON, "WP_atton_cut_7");
object oT3M4 = GetAndMoveNPCToWaypoint(NPC_T3_M4, "WP_t3m4_cut_7");
object oKreia = GetAndMoveNPCToWaypoint(NPC_KREIA, "WP_kreia_cut_6");

SetGlobalNumber("003EBO_BACKGROUND", 10);
SetBackground();

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_player_cut_6"))));
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oAtton, ActionStartConversation(oPC, "003Atton", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_VISAS_ARRIVES) {
AurPostString("CS: PLAYING SCENE VISAS_ARRIVES", 5, 17, 5.0);
int i = 0;
object oNPC;

for(i = 0; i < 12; ++i) {
oNPC = GetObjectByTag(GetNPCTag(i));
SetMinOneHP(oNPC, TRUE);
}

SetGlobalBoolean("VISAS_ARRIVES_CONV", TRUE);
object oVisas = CreateObject(OBJECT_TYPE_CREATURE, "visascut", GetLocation(GetObjectByTag("wp_visas_sp")));
AssignCommand(oVisas, ClearAllActions());
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oVisas, ActionStartConversation(oPC, "", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_MSG_FROM_KELBORN) {
AurPostString("CS: PLAYING SCENE MESSAGE_FROM_KELBORN", 5, 17, 5.0);
object oT3M4 = GetAndMoveNPCToWaypoint(NPC_T3_M4, "WP_t3m4_cut_6");

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToObject(GetObjectByTag("WP_player_cut_4")));
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oT3M4, ActionStartConversation(oPC, "t3kelbrn", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if ((nScene == CUTSCENE_CUT_ATTON_T3_PAZAAK_1)
|| (nScene == CUTSCENE_CUT_ATTON_T3_PAZAAK_2)
|| (nScene == CUTSCENE_CUT_ATTON_T3_ARGUE))
{
AurPostString("CS: PLAYING SCENE ATTON_T3_PAZAAK_1 or 2 or ARGUE", 5, 17, 5.0);
object oAtton = GetAndMoveNPCToWaypoint(NPC_ATTON, "WP_atton_cut_1");
object oT3M4 = GetAndMoveNPCToWaypoint(NPC_T3_M4, "WP_t3m4_cut_2");

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_player_cut_1"))));
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oT3M4, ActionStartConversation(oPC, "Attt3", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_ATTON_MAID_FIGHT) {
AurPostString("CS: PLAYING SCENE ATTON_HANDMAIDEN_FIGHT", 5, 17, 5.0);
object oAtton = GetAndMoveNPCToWaypoint(NPC_ATTON, "WP_atton_cut_2");
object oMaiden = GetAndMoveNPCToWaypoint(NPC_HANDMAIDEN, "WP_maid_cut_1");
object oInvis = GetObjectByTag("MaidInvis");

AssignCommand(oInvis, ClearAllActions());
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oInvis, ActionStartConversation(oPC, "atthand", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if ((nScene == CUTSCENE_CUT_ATTON_KREIA_OFF)
|| (nScene == CUTSCENE_CUT_ATTON_KREIA_GIVE)
|| (nScene == CUTSCENE_CUT_ATTON_KREIA_TAKE))
{
AurPostString("CS: PLAYING SCENE ATTON_TELLS/GIVESUP/TAKEOFF", 5, 17, 5.0);
object oAtton = GetAndMoveNPCToWaypoint(NPC_ATTON, "WP_atton_cut_5");
object oKreia = GetAndMoveNPCToWaypoint(NPC_KREIA, "WP_kreia_cut_3");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oAtton, ActionStartConversation(oPC, "Attkreia", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_ATTON_BAO_PLAYER) {
AurPostString("CS: PLAYING SCENE ATTON_BAODUR_PLAYER", 5, 17, 5.0);
object oAtton = GetAndMoveNPCToWaypoint(NPC_ATTON, "WP_atton_cut_6");
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_2");
object oRemote = GetAndMovePUPToWaypoint(PUP_SENSORBALL, "WP_remote_cut_3");
object oT3M4 = GetAndMoveNPCToWaypoint(NPC_T3_M4, "WP_t3m4_cut_5");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oAtton, ActionStartConversation(oPC, "baoatt_p", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_CONFRONT_KRE) {
AurPostString("CS: PLAYING SCENE BAODUR_CONFRONT_KREIA", 5, 17, 5.0);
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_1");
object oKreia = GetAndMoveNPCToWaypoint(NPC_KREIA, "WP_kreia_cut_3");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oBao, ActionStartConversation(oPC, "baokreia", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_REMOTE_1) {
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_3");
object oRemote = GetAndMovePUPToWaypoint(PUP_SENSORBALL, "WP_remote_cut_3");
object oDroid;
if (GetIsAvailable(NPC_G0T0))
oDroid = GetAndMoveNPCToWaypoint(NPC_G0T0, "WP_extra_1");
else if (GetIsAvailable(NPC_HK_47))
oDroid = GetAndMoveNPCToWaypoint(NPC_HK_47, "WP_extra_1");
else if (GetIsAvailable(NPC_T3_M4))
oDroid = GetAndMoveNPCToWaypoint(NPC_T3_M4, "WP_extra_1");

AssignCommand(oPC, ClearAllActions());
object oWP = GetObjectByTag("WP_player_extra");
if (GetIsObjectValid(oWP)) {
location lLoc = GetLocation(oWP);
AssignCommand(oPC, ActionJumpToLocation(lLoc));
}
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oBao, ActionStartConversation(oPC, "baorem1", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_REMOTE_2) {
AurPostString("CS: PLAYING SCENE BAODUR_UPGRADE_REMOTE_2", 5, 17, 5.0);
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_3");
object oRemote = GetAndMovePUPToWaypoint(PUP_SENSORBALL, "WP_remote_cut_3");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oBao, ActionStartConversation(oPC, "baorem2", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_REMOTE_3) {
AurPostString("CS: PLAYING SCENE BAODUR_UPGRADE_REMOTE_3", 5, 17, 5.0);
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_3");
object oRemote = GetAndMovePUPToWaypoint(PUP_SENSORBALL, "WP_remote_cut_3");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oBao, ActionStartConversation(oPC, "baorem3", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_T3) {
AurPostString("CS: PLAYING SCENE BAODUR_UPGRADE_T3", 5, 17, 5.0);
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_3");
object oT3M4 = GetAndMoveNPCToWaypoint(NPC_T3_M4, "WP_patient_cut");

AssignCommand(oPC, ClearAllActions());
object oWP = GetObjectByTag("WP_player_extra");
if (GetIsObjectValid(oWP)) {
location lLoc = GetLocation(oWP);
AssignCommand(oPC, ActionJumpToLocation(lLoc));
}
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oBao, ActionStartConversation(oPC, "bao_t3", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_HK47_1) {
AurPostString("CS: PLAYING SCENE BAODUR_UPGRADE_HK47_1", 5, 17, 5.0);
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_3");
object oHK47 = GetAndMoveNPCToWaypoint(NPC_HK_47, "WP_patient_cut");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oBao, ActionStartConversation(oPC, "baohk_1", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_HK47_2) {
AurPostString("CS: PLAYING SCENE BAODUR_UPGRADE_HK47_2", 5, 17, 5.0);
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_3");
object oHK47 = GetAndMoveNPCToWaypoint(NPC_HK_47, "WP_patient_cut");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oBao, ActionStartConversation(oPC, "baohk_2", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_G0T0_1) {
AurPostString("CS: PLAYING SCENE BAODUR_UPGRADE_G0T0_1", 5, 17, 5.0);
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_3");
object oGoto = GetAndMoveNPCToWaypoint(NPC_G0T0, "WP_patient_cut");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oBao, ActionStartConversation(oPC, "bao_g0_1", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_G0T0_2) {
AurPostString("CS: PLAYING SCENE BAODUR_UPGRADE_G0T0_2", 5, 17, 5.0);
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_3");
object oGoto = GetAndMoveNPCToWaypoint(NPC_G0T0, "WP_patient_cut");
object oRemote = GetAndMovePUPToWaypoint(PUP_SENSORBALL, "WP_remote_cut_4");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oBao, ActionStartConversation(oPC, "bao_g0_2", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_MALACHOR) {
AurPostString("CS: PLAYING SCENE BAODUR_MALACHOR_TALK", 5, 17, 5.0);
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_baodur_cut_4");

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_player_cut_7"))));
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oBao, ActionStartConversation(oPC, "bao_malv", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_VS_MAND_1) {
AurPostString("CS: PLAYING SCENE BAODUR_VS_MAND_1", 5, 17, 5.0);
object oCand = GetAndMoveNPCToWaypoint(NPC_CANDEROUS, "WP_disc_cut_1");
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_disc_cut_1");

DelayedFadeIn(0.0, 1.0, 1.0);
AssignCommand(oPC, ClearAllActions());
DelayCommand(1.0, AssignCommand(oCand, ActionStartConversation(oPC, "mand1", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_BAO_VS_MAND_2) {
AurPostString("CS: PLAYING SCENE BAODUR_VS_MAND_2", 5, 17, 5.0);
object oCand = GetAndMoveNPCToWaypoint(NPC_CANDEROUS, "WP_disc_cut_1");
object oBao = GetAndMoveNPCToWaypoint(NPC_BAO_DUR, "WP_disc_cut_1");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oCand, ActionStartConversation(oPC, "mand2", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_DISC_PLAYER_MED) {
AurPostString("CS: PLAYING SCENE DISC_PLAYER_MEDITATE", 5, 17, 5.0);
object oAtton = GetAndMoveNPCToWaypoint(NPC_ATTON, "WP_atton_cut_3");
object oMira = GetAndMoveNPCToWaypoint(NPC_MIRA, "WP_mira_cut_2");
object oDisc = GetAndMoveNPCToWaypoint(NPC_DISCIPLE, "WP_disc_cut_1");

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_player_cut_2"))));

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oAtton, ActionStartConversation(oPC, "Disc4", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if ((nScene == CUTSCENE_CUT_ATTON_DISC_1) || (nScene == CUTSCENE_CUT_ATTON_DISC_2)) {
AurPostString("CS: PLAYING SCENE DISC_ATTON_FIGHT_1OR2", 5, 17, 5.0);
object oAtton = GetAndMoveNPCToWaypoint(NPC_ATTON, "WP_atton_cut_4");
object oDisc = GetAndMoveNPCToWaypoint(NPC_DISCIPLE, "WP_disc_cut_2");

SetLockOrientationInDialog(oAtton, TRUE);
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oAtton, ActionStartConversation(oPC, "003Disci", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_ATTON_DISC_3) {
AurPostString("CS: PLAYING SCENE DISC_ATTON_FIGHT_3", 5, 17, 5.0);
object oAtton = GetAndMoveNPCToWaypoint(NPC_ATTON, "WP_atton_cut_2");
object oDisc = GetAndMoveNPCToWaypoint(NPC_DISCIPLE, "WP_disc_cut_4");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oAtton, ActionStartConversation(oPC, "003Disci", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_DISC_TELOS) {
AurPostString("CS: DISC_CONTACTS_TELOS doesn't exist", 5, 17, 5.0);
}
else if (nScene == CUTSCENE_CUT_DISC_WORLD_1) {
AurPostString("CS: PLAYING SCENE DISC_STUDY_WORLD_1", 5, 17, 5.0);
object oKreia = GetAndMoveNPCToWaypoint(NPC_KREIA, "WP_kreia_cut_3");
object oDisc = GetAndMoveNPCToWaypoint(NPC_DISCIPLE, "WP_disc_cut_5");

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_player_cut_3"))));
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oDisc, ActionStartConversation(oPC, "Disc1", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_DISC_WORLD_2) {
AurPostString("CS: PLAYING SCENE DISC_STUDY_WORLD_2", 5, 17, 5.0);
object oDisc = GetAndMoveNPCToWaypoint(NPC_DISCIPLE, "WP_disc_cut_5");

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_player_cut_5"))));
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oDisc, ActionStartConversation(oPC, "Disc2", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_DISC_FORCE) {
AurPostString("CS: PLAYING SCENE DISC_RESONANCE_FORCE", 5, 17, 5.0);
object oDisc = GetAndMoveNPCToWaypoint(NPC_DISCIPLE, "WP_disc_cut_5");

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_player_cut_5"))));
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oDisc, ActionStartConversation(oPC, "Disc3", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_DISC_REVAN) {
AurPostString("CS: DISC_REVAN doesn't exist", 5, 17, 5.0);
}
else if (nScene == CUTSCENE_CUT_G0T0_HK47_1) {
AurPostString("CS: PLAYING SCENE G0T0_HK47_1", 5, 17, 5.0);
object oGoto = GetAndMoveNPCToWaypoint(NPC_G0T0, "WP_g0t0_cut_1");
object oHK47 = GetAndMoveNPCToWaypoint(NPC_HK_47, "WP_hk47_cut_1");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oGoto, ActionStartConversation(oPC, "g0t0hk47", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_G0T0_REMOTE_1) {
AurPostString("CS: PLAYING SCENE G0T0_REMOTE_1", 5, 17, 5.0);
object oGoto = GetAndMoveNPCToWaypoint(NPC_G0T0, "WP_g0t0_cut_2");
object oRemote = GetAndMovePUPToWaypoint(PUP_SENSORBALL, "WP_remote_cut_1");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oGoto, ActionStartConversation(oPC, "G0T0rem1", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_G0T0_REMOTE_2) {
AurPostString("CS: PLAYING SCENE G0T0_REMOTE_2", 5, 17, 5.0);
object oGoto = GetAndMoveNPCToWaypoint(NPC_G0T0, "WP_g0t0_cut_3");
object oRemote = GetAndMovePUPToWaypoint(PUP_SENSORBALL, "WP_remote_cut_2");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oGoto, ActionStartConversation(oPC, "G0T0rem1", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_KREIA_ATTACKS_T3) {
AurPostString("CS: PLAYING SCENE KREIA_ATTACKS_T3", 5, 17, 5.0);
object oKreia = GetAndMoveNPCToWaypoint(NPC_KREIA, "WP_kreia_cut_1");
object oT3M4 = GetAndMoveNPCToWaypoint(NPC_T3_M4, "WP_t3m4_cut_1");
DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oKreia, ActionStartConversation(oPC, "kreia", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_KREIA_MAID_1) {
AurPostString("CS: PLAYING SCENE KREIA_HANDMAIDEN_DS_1", 5, 17, 5.0);
object oKreia = GetAndMoveNPCToWaypoint(NPC_KREIA, "WP_kreia_cut_2");
object oMaiden = GetAndMoveNPCToWaypoint(NPC_HANDMAIDEN, "WP_maid_cut_4");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oKreia, ActionStartConversation(oPC, "krehand", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_KREIA_MAID_2) {
AurPostString("CS: PLAYING SCENE KREIA_HANDMAIDEN_DS_2", 5, 17, 5.0);
object oKreia = GetAndMoveNPCToWaypoint(NPC_KREIA, "WP_kreia_cut_3");
object oMaiden = GetAndMoveNPCToWaypoint(NPC_HANDMAIDEN, "WP_maid_cut_5");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oKreia, ActionStartConversation(oPC, "krehand2", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_KREIA_DISC_1) {
AurPostString("CS: PLAYING SCENE KREIA_VS_DISC_1", 5, 17, 5.0);
object oKreia = GetAndMoveNPCToWaypoint(NPC_KREIA, "WP_kreia_cut_4");
object oDisc = GetAndMoveNPCToWaypoint(NPC_DISCIPLE, "WP_disc_cut_6");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oKreia, ActionStartConversation(oPC, "kredisc1", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_KREIA_DISC_2) {
AurPostString("CS: PLAYING SCENE KREIA_VS_DISC_2", 5, 17, 5.0);
object oKreia = GetAndMoveNPCToWaypoint(NPC_KREIA, "WP_kreia_cut_3");
object oDisc = GetAndMoveNPCToWaypoint(NPC_DISCIPLE, "WP_disc_cut_7");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oKreia, ActionStartConversation(oPC, "kredisc2", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_KREIA_DISC_3) {
AurPostString("CS: PLAYING SCENE KREIA_VS_DISC_3", 5, 17, 5.0);
object oKreia = GetAndMoveNPCToWaypoint(NPC_KREIA, "WP_kreia_cut_5");
object oDisc = GetAndMoveNPCToWaypoint(NPC_DISCIPLE, "WP_disc_cut_5");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oKreia, ActionStartConversation(oPC, "kredisc3", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_MIRA_MAID) {
AurPostString("CS: PLAYING SCENE MIRA_HANDMAIDEN_TALK", 5, 17, 5.0);
object oMira = GetAndMoveNPCToWaypoint(NPC_MIRA, "WP_mira_cut_1");
object oMaiden = GetAndMoveNPCToWaypoint(NPC_HANDMAIDEN, "WP_maid_cut_3");
object oVisas = GetAndMoveNPCToWaypoint(NPC_VISAS, "WP_visas_cut_1");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oMira, ClearAllActions()));
DelayCommand(1.0, AssignCommand(oMira, ActionStartConversation(oPC, "mirvisha", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));

}
else if (nScene == CUTSCENE_CUT_T3_VS_HK47) {
AurPostString("CS: PLAYING SCENE T3_HK47_CONFRONT", 5, 17, 5.0);
object oT3M4 = GetAndMoveNPCToWaypoint(NPC_T3_M4, "WP_t3m4_cut_3");
object oHK47 = GetAndMoveNPCToWaypoint(NPC_HK_47, "WP_hk47_cut_2");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oT3M4, ActionStartConversation(oPC, "hk47t3m4", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_T3_DISC_HOLO) {
AurPostString("CS: PLAYING SCENE T3_DISC_HOLO", 5, 17, 5.0);
object oT3M4 = GetAndMoveNPCToWaypoint(NPC_T3_M4, "WP_t3m4_cut_4");
object oDisc = GetAndMoveNPCToWaypoint(NPC_DISCIPLE, "WP_disc_cut_3");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oDisc, ActionStartConversation(oPC, "t3disc", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else if (nScene == CUTSCENE_CUT_VISAS_VS_MAID) {
AurPostString("CS: PLAYING SCENE VISAS_HANDMAIDEN_ARGUE", 5, 17, 5.0);
object oMaiden = GetAndMoveNPCToWaypoint(NPC_HANDMAIDEN, "WP_maid_cut_2");
object oVisas = GetAndMoveNPCToWaypoint(NPC_VISAS, "WP_visas_cut_1");

DelayedFadeIn(0.0, 1.0, 1.0);
DelayCommand(1.0, AssignCommand(oMaiden, ActionStartConversation(oPC, "vishand", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
else {
AurPostString("CUTSCENE: SHOULD NOT BE HITTING THIS! REPORT TO ANTHONYD.", 5, 17, 10.0);
SetGlobalBoolean("003_cutscene_mode", FALSE);
ResetEbonHawk();
AssignCommand(oPC, ClearAllActions());
DelayedFadeIn(0.0, 1.0, 1.0);
}
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Utility - Identical to one found in k_align_movie.
// Returns the number of visited planets.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int PlanetCount() {
int i = 0;
if( GetGlobalBoolean("201_First_Enter") )
i++;
if( GetGlobalBoolean("301_First_Enter") )
i++;
if( GetGlobalBoolean("401_First_Enter") )
i++;
if( GetGlobalBoolean("501_First_Enter") )
i++;
if( GetGlobalBoolean("601_First_Enter") )
i++;
if( GetGlobalBoolean("701_First_Enter") )
i++;
return i;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Utility - Check if a NPC has joined the party.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int GetIsAvailable(int nNPC) {
int bTest = GetNPCSelectability(nNPC);
if ((bTest == TRUE) || (bTest == 0))
return TRUE;
else
return FALSE;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Utility - returns difference between two party members
// influence with the player.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int GetInfluenceDiff(int nNPC1, int nNPC2) {
int nInf1 = GetInfluence(nNPC1);
int nInf2 = GetInfluence(nNPC2);

return (nInf1 - nInf2);
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Utility - return character level of specified party member.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int CheckNPCLevel(int nNPC) {
object oNPC = GetObjectByTag(GetNPCTag(nNPC));

if (GetIsObjectValid(oNPC)) {
int nLevel = GetHitDice(oNPC);
return nLevel;
}
return 0;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Utility Returns the points in a skill a party member has.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int CheckNPCSkill(int nNPC, int nType) {
object oNPC = GetObjectByTag(GetNPCTag(nNPC));
int nSkill = 0;

if (GetIsObjectValid(oNPC)) {
nSkill = GetSkillRank(nType, oNPC);
}
return nSkill;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Utility - a completely unnessecary wrapper. Fade from black.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DelayedFadeIn(float fDelay, float fWait, float fLength) {
DelayCommand(fDelay, SetGlobalFadeIn(fWait, fLength));
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Utility - move party member to specified waypoint and return
// object reference to the party member if successful.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
object GetAndMoveNPCToWaypoint(int nNPC, string sTag) {
object oNPC = GetObjectByTag(GetNPCTag(nNPC));
object oWP = GetObjectByTag(sTag);

if (GetIsObjectValid(oWP)) {
AssignCommand(oNPC, ClearAllActions());
AssignCommand(oNPC, ActionJumpToLocation(GetLocation(oWP)));
return oNPC;
}
else {
AurPostString("INVALID WAYPOINT FOR CUTSCENE", 15, 20, 10.0);
return OBJECT_INVALID;
}
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ST: Utility - move Puppet to specified waypoint and return an
// object reference to the puppet if successful.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
object GetAndMovePUPToWaypoint(int nPUP, string sTag) {
object oPUP = GetObjectByTag(GetPuppetTag(nPUP));
object oWP = GetObjectByTag(sTag);

if (GetIsObjectValid(oWP)) {
AssignCommand(oPUP, ClearAllActions());
AssignCommand(oPUP, ActionJumpToLocation(GetLocation(oWP)));
return oPUP;
}
else {
AurPostString("INVALID WAYPOINT FOR CUTSCENE", 15, 20, 10.0);
return OBJECT_INVALID;
}
}
Page: 1 of 1