mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
880 lines
25 KiB
Plaintext
880 lines
25 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// ep3_chewbacca.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.conversation;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/ep3_chewbacca";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean ep3_chewbacca_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_chewbacca_condition_doesnt_know_Shiryyywook (obj_id player, obj_id npc)
|
|
{
|
|
return utils.canSpeakWookiee(player,npc);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void ep3_chewbacca_action_grantSkill_Shiryyywook (obj_id player, obj_id npc)
|
|
{
|
|
playMusic(player, "sound/music_acq_academic.snd");
|
|
grantSkill(player, "social_language_wookiee_comprehend");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int ep3_chewbacca_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: My home has changed a lot since I was last here. The Empire has exerted much tighter control... and while they've modernized much of Kachirho, they've also dragged their war along with them!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm looking for adventure.
|
|
if (response == "s_384")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Have you visited the great tree here in Kachirho? There are many prominent figures there - many that can show you the way to high adventure on Kashyyyk.
|
|
string_id message = new string_id (c_stringFile, "s_386");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Good idea!
|
|
boolean hasResponse0 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No. Not yet.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_388");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_392");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_chewbacca.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Modern? This place?
|
|
if (response == "s_396")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Sure! You see the starport over there? The Imperial communications tower? Trandoshan's can now trod freely all around the city. It is a shame to see my world fallen so low.
|
|
string_id message = new string_id (c_stringFile, "s_398");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: You dislike technology?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: This place looks pretty primitive to me.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_400");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_440");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_chewbacca.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Ah! The war's not so bad.
|
|
if (response == "s_444")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Really? What makes you say that? I can only imagine that you are unfamiliar with the far-reaching impact of the horror of this conflict! Perhaps you have been in a coma of some sort?
|
|
string_id message = new string_id (c_stringFile, "s_446");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: The Empire will win this war.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: The Empire is doomed.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I don't care about the war.
|
|
boolean hasResponse2 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_404");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_420");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_436");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_chewbacca.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_chewbacca_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Have you visited the great tree here in Kachirho? There are many prominent figures there - many that can show you the way to high adventure on Kashyyyk.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Good idea!
|
|
if (response == "s_388")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You should also talk to my friend here, Vryyyr. He is an accomplished hunter and native of Kashyyyk!
|
|
string_id message = new string_id (c_stringFile, "s_390");
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No. Not yet.
|
|
if (response == "s_392")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Then I recommend it! You should also talk to my friend here, Vryyyr. He is an accomplished hunter and native of Kashyyyk!
|
|
string_id message = new string_id (c_stringFile, "s_394");
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_chewbacca_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Sure! You see the starport over there? The Imperial communications tower? Trandoshan's can now trod freely all around the city. It is a shame to see my world fallen so low.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You dislike technology?
|
|
if (response == "s_400")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Of course not! But I am sickened to see what they have done to my home world. The Empire and their trandoshan lackeys are everywhere. They have no business here.
|
|
string_id message = new string_id (c_stringFile, "s_402");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: The Empire will win this war.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: The Empire is doomed.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I don't care about the war.
|
|
boolean hasResponse2 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_404");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_420");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_436");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_chewbacca.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: This place looks pretty primitive to me.
|
|
if (response == "s_440")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Yes. You're right. Overall you will find Kashyyyk to be a very primitive planet. My people do not favor advanced technology. While they have some impressive engineering, they don't embrace modern technology as the Galactic Empire does.
|
|
string_id message = new string_id (c_stringFile, "s_442");
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_chewbacca_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Of course not! But I am sickened to see what they have done to my home world. The Empire and their trandoshan lackeys are everywhere. They have no business here.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: The Empire will win this war.
|
|
if (response == "s_404")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: And you think this will be a good thing for the galaxy?
|
|
string_id message = new string_id (c_stringFile, "s_406");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: The best thing.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No. It will ruin us all.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: [Glare at him with intensity.]
|
|
boolean hasResponse2 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_408");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_412");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_416");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_chewbacca.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: The Empire is doomed.
|
|
if (response == "s_420")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I do hope so. To get my people out of chains if for nothing else.
|
|
string_id message = new string_id (c_stringFile, "s_422");
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't care about the war.
|
|
if (response == "s_436")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Fortunate for you. I wish I could forget about it.
|
|
string_id message = new string_id (c_stringFile, "s_438");
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_chewbacca_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: And you think this will be a good thing for the galaxy?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: The best thing.
|
|
if (response == "s_408")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You are free to have your own opinion. Of course, if the Empire wins then you will not have that freedom.
|
|
string_id message = new string_id (c_stringFile, "s_410");
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No. It will ruin us all.
|
|
if (response == "s_412")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: They have already ruined my people. We were once proud and independent. Now just look at us...broken. Everywhere I look is sadness.
|
|
string_id message = new string_id (c_stringFile, "s_414");
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: [Glare at him with intensity.]
|
|
if (response == "s_416")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Maybe we shouldn't talk politics.
|
|
string_id message = new string_id (c_stringFile, "s_418");
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_chewbacca_handleBranch14 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Really? What makes you say that? I can only imagine that you are unfamiliar with the far-reaching impact of the horror of this conflict! Perhaps you have been in a coma of some sort?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: The Empire will win this war.
|
|
if (response == "s_404")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: And you think this will be a good thing for the galaxy?
|
|
string_id message = new string_id (c_stringFile, "s_406");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: The best thing.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No. It will ruin us all.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: [Glare at him with intensity.]
|
|
boolean hasResponse2 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_408");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_412");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_416");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_chewbacca.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: The Empire is doomed.
|
|
if (response == "s_420")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I do hope so. To get my people out of chains if for nothing else.
|
|
string_id message = new string_id (c_stringFile, "s_422");
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't care about the war.
|
|
if (response == "s_436")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Fortunate for you. I wish I could forget about it.
|
|
string_id message = new string_id (c_stringFile, "s_438");
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.ep3_chewbacca");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable(self, true);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable(self, true);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo)
|
|
{
|
|
int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null);
|
|
menu_info_data menuInfoData = menuInfo.getMenuItemById (menu);
|
|
menuInfoData.setServerNotify (false);
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
faceTo(self, player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnIncapacitated (obj_id killer)
|
|
{
|
|
clearCondition (self, CONDITION_CONVERSABLE);
|
|
detachScript (self, "conversation.ep3_chewbacca");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Triggers
|
|
// ======================================================================
|
|
|
|
//-- This function should move to base_class.java
|
|
boolean npcStartConversation(obj_id player, obj_id npc, string convoName, string_id greetingId, prose_package greetingProse, string_id[] responses)
|
|
{
|
|
Object[] objects = new Object[responses.length];
|
|
System.arraycopy(responses, 0, objects, 0, responses.length);
|
|
return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
trigger OnStartNpcConversation (obj_id player)
|
|
{
|
|
obj_id npc = self;
|
|
|
|
if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player))
|
|
return SCRIPT_OVERRIDE;
|
|
|
|
//-- [NOTE]
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: My home has changed a lot since I was last here. The Empire has exerted much tighter control... and while they've modernized much of Kachirho, they've also dragged their war along with them!
|
|
string_id message = new string_id (c_stringFile, "s_382");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm looking for adventure.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Modern? This place?
|
|
boolean hasResponse1 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: Ah! The war's not so bad.
|
|
boolean hasResponse2 = false;
|
|
if (ep3_chewbacca_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_384");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_396");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_444");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_chewbacca.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "ep3_chewbacca", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response)
|
|
{
|
|
if (conversationId != "ep3_chewbacca")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
if (branchId == 1 && ep3_chewbacca_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && ep3_chewbacca_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && ep3_chewbacca_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && ep3_chewbacca_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && ep3_chewbacca_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 14 && ep3_chewbacca_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.ep3_chewbacca.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|