mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-27 16:56:48 -04:00
1151 lines
36 KiB
Plaintext
1151 lines
36 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// ep3_kachirho_lolo.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.groundquests;
|
|
include library.loot;
|
|
include library.space_quest;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/ep3_kachirho_lolo";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean ep3_kachirho_lolo_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_kachirho_lolo_condition_isReadyForLolo (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "ep3_kachirho_trando_rifle", "talkToLolo");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_kachirho_lolo_condition_hasBowcasterPieces (obj_id player, obj_id npc)
|
|
{
|
|
return space_quest.hasWonQuest(player, "inspect", "ep3_wke_bowcaster_crafting");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_kachirho_lolo_condition_isOnMission (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActive(player, "ep3_kachirho_trando_rifle");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_kachirho_lolo_condition_hasFailedSpaceMission (obj_id player, obj_id npc)
|
|
{
|
|
return space_quest.hasFailedQuest(player, "inspect", "ep3_wke_bowcaster_crafting");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_kachirho_lolo_condition_hasMadeBowcaster (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedTask(player, "ep3_kachirho_trando_rifle", "craftBowcaster");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_kachirho_lolo_condition_cannotSpeakWke (obj_id player, obj_id npc)
|
|
{
|
|
if(hasSkill(player, "combat_smuggler_underworld_01"))
|
|
return false;
|
|
if(hasSkill(player, "social_language_wookiee_comprehend"))
|
|
return false;
|
|
else
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_kachirho_lolo_condition_hasCompletedSpace (obj_id player, obj_id npc)
|
|
{
|
|
return space_quest.hasCompletedQuest(player, "inspect", "ep3_wke_bowcaster_crafting");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void ep3_kachirho_lolo_action_grantSpaceMission (obj_id player, obj_id npc)
|
|
{
|
|
space_quest.grantQuest(player, "inspect", "ep3_wke_bowcaster_crafting");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_kachirho_lolo_action_grantBarrelSchematic (obj_id player, obj_id npc)
|
|
{
|
|
grantSchematic(player, "object/draft_schematic/weapon/component/projectile_rifle_barrel_faux_bowcaster.iff");
|
|
grantSchematic(player, "object/draft_schematic/weapon/appearance/weapon_appearance_rifle_faux_bowcaster.iff");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_kachirho_lolo_action_vocalizeMed (obj_id player, obj_id npc)
|
|
{
|
|
playClientEffectObj(npc, "clienteffect/voc_wookiee_med_4sec.cef", player, "");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_kachirho_lolo_action_grantCraftingComponent (obj_id player, obj_id npc)
|
|
{
|
|
obj_id pInv = utils.getInventoryContainer(player);
|
|
|
|
if(isIdValid(pInv))
|
|
{
|
|
obj_id objItem = createObjectOverloaded("object/tangible/component/weapon/quest/projectile_feed_mechanism_faux_bowcaster.iff",pInv);
|
|
loot.randomizeComponent(objItem, 175, pInv);
|
|
space_quest.setQuestRewarded(player, "inspect", "ep3_wke_bowcaster_crafting");
|
|
}
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int ep3_kachirho_lolo_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: There is nothing more that I can do for you.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Ok, thanks and see you later.
|
|
if (response == "s_255")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Bye bye.
|
|
string_id message = new string_id (c_stringFile, "s_257");
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Can I do that space part again?
|
|
if (response == "s_256")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
ep3_kachirho_lolo_action_grantSpaceMission (player, npc);
|
|
|
|
//-- NPC: Sure.
|
|
string_id message = new string_id (c_stringFile, "s_258");
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: No luck with that pilot? No matter. He is still out there if you would like to give it another shot?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sure, I am ready to take care of him now.
|
|
if (response == "s_105")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
ep3_kachirho_lolo_action_grantSpaceMission (player, npc);
|
|
|
|
//-- NPC: Good luck to you.
|
|
string_id message = new string_id (c_stringFile, "s_108");
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No thanks, maybe later.
|
|
if (response == "s_106")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Take care then.
|
|
string_id message = new string_id (c_stringFile, "s_107");
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yes? What can I do for you on this fine day?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I am looking for a bowcaster. A special bowcaster.
|
|
if (response == "s_101")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: A bowcaster eh? Well, I am afraid that you came to the wrong place. I do not have any in stock at this time. Maybe I could put you on a waiting list.
|
|
string_id message = new string_id (c_stringFile, "s_102");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Actually, Jobarkko sent me to look at the new bowcaster.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_19");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: A bowcaster eh? Well, I am afraid that you came to the wrong place. I do not have any in stock at this time. Maybe I could put you on a waiting list.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Actually, Jobarkko sent me to look at the new bowcaster.
|
|
if (response == "s_19")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: This is just great. I am sorry that Jobarkko wasted your time. The bowcaster is gone. Well...I guess technically not gone. I still have the schematics for it but I am afraid that all of the parts needed to put it together have been taken.
|
|
string_id message = new string_id (c_stringFile, "s_76");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Taken. What do you mean, taken?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_77");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: This is just great. I am sorry that Jobarkko wasted your time. The bowcaster is gone. Well...I guess technically not gone. I still have the schematics for it but I am afraid that all of the parts needed to put it together have been taken.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Taken. What do you mean, taken?
|
|
if (response == "s_77")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Everyone was so excited about this new bowcaster that no one would actually wait for me to put it together. The resistance shows up here before I could assemble the weapon and starts arguing about what to do with it.
|
|
string_id message = new string_id (c_stringFile, "s_78");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: The resistance was fighting amongst themselves?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_79");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 13);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch13 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Everyone was so excited about this new bowcaster that no one would actually wait for me to put it together. The resistance shows up here before I could assemble the weapon and starts arguing about what to do with it.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: The resistance was fighting amongst themselves?
|
|
if (response == "s_79")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: That shouldn't surprise you. How else do you think a relatively small group of Trandoshans can control an entire population.
|
|
string_id message = new string_id (c_stringFile, "s_80");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Well, they are backed by the Empire.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_81");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 14);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch14 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: That shouldn't surprise you. How else do you think a relatively small group of Trandoshans can control an entire population.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Well, they are backed by the Empire.
|
|
if (response == "s_81")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Bah! The Empire hasn't had an effective military in this sector for many years now. They leave the operation to their loyal lap dogs. If they had to operate a full military force in this system to maintain control the cost would out way the reward of the slave labor. But I don't think they will have to worry about that for a long time.
|
|
string_id message = new string_id (c_stringFile, "s_82");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What do you mean?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_83");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 15);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch15 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Bah! The Empire hasn't had an effective military in this sector for many years now. They leave the operation to their loyal lap dogs. If they had to operate a full military force in this system to maintain control the cost would out way the reward of the slave labor. But I don't think they will have to worry about that for a long time.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What do you mean?
|
|
if (response == "s_83")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: The resistance spends most of their time fighting each other rather then fighting the Trandoshans. Everyone wants to be in charge. Take something as simple as that bowcaster. Two factions of the resistance show up and want to see it. Of course, both of them start to argue about what they want it for. One of them wants to sell it to the highest bidder to fund an operation and the other wants to use it help in the fight.
|
|
string_id message = new string_id (c_stringFile, "s_84");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: So what happened to the bowcaster?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_85");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 16);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch16 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: The resistance spends most of their time fighting each other rather then fighting the Trandoshans. Everyone wants to be in charge. Take something as simple as that bowcaster. Two factions of the resistance show up and want to see it. Of course, both of them start to argue about what they want it for. One of them wants to sell it to the highest bidder to fund an operation and the other wants to use it help in the fight.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So what happened to the bowcaster?
|
|
if (response == "s_85")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well they started fighting and made a complete mess out of my store. Both groups grabbed parts of it and made a run for it. Not that those parts will do them any good since I still have the schematic for the gun and the barrel. One group took the feed mechanism parts and tried to ship it off world. The other grabbed the power handler and went back to their camps.
|
|
string_id message = new string_id (c_stringFile, "s_92");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: So how would I make one of these bowcasters?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_93");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 17);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch17 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well they started fighting and made a complete mess out of my store. Both groups grabbed parts of it and made a run for it. Not that those parts will do them any good since I still have the schematic for the gun and the barrel. One group took the feed mechanism parts and tried to ship it off world. The other grabbed the power handler and went back to their camps.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So how would I make one of these bowcasters?
|
|
if (response == "s_93")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I can give you the schematic for the barrel and the bowcaster. They are useless to me now. As for the other stuff you will have to recover them from the Wookiees who took them from me.
|
|
string_id message = new string_id (c_stringFile, "s_94");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Alright. Where can I find these parts?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_95");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 18);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch18 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I can give you the schematic for the barrel and the bowcaster. They are useless to me now. As for the other stuff you will have to recover them from the Wookiees who took them from me.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Alright. Where can I find these parts?
|
|
if (response == "s_95")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I heard that the Wookiee who took the parts for the feed mechanism had hyperdrive problems and is still in the system. You can probably get a lock on his distress signal. It is in pieces but if you can recover it and bring it back to me I will put it together for you. And it would be my guess that the leaders of the other group took the power handlers and issued them to their troops to put into their weapons already.
|
|
string_id message = new string_id (c_stringFile, "s_97");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: So they will have put the handlers in their weapons?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_98");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 19);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch19 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I heard that the Wookiee who took the parts for the feed mechanism had hyperdrive problems and is still in the system. You can probably get a lock on his distress signal. It is in pieces but if you can recover it and bring it back to me I will put it together for you. And it would be my guess that the leaders of the other group took the power handlers and issued them to their troops to put into their weapons already.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So they will have put the handlers in their weapons?
|
|
if (response == "s_98")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: No. Those power handlers are specifically designed for the new bowcaster. But I would be willing to bet that any number of the resistance fighters in the area are carrying them around anyways.
|
|
string_id message = new string_id (c_stringFile, "s_99");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What do I do to put the bowcaster together?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_103");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 20);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_kachirho_lolo_handleBranch20 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: No. Those power handlers are specifically designed for the new bowcaster. But I would be willing to bet that any number of the resistance fighters in the area are carrying them around anyways.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What do I do to put the bowcaster together?
|
|
if (response == "s_103")
|
|
{
|
|
ep3_kachirho_lolo_action_grantBarrelSchematic (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
ep3_kachirho_lolo_action_grantSpaceMission (player, npc);
|
|
|
|
//-- NPC: Make a barrel. Add that in with the power handler and the feed mechanism and you will have a bowcaster. It is extremely simple...even a unskilled weaponsmith could put it together. Well, I told you everything that I can. I hope that Jobarkko isn't to upset with me over this...it wasn't my fault.
|
|
string_id message = new string_id (c_stringFile, "s_104");
|
|
utils.removeScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.ep3_kachirho_lolo");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
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_kachirho_lolo");
|
|
|
|
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_kachirho_lolo_condition_cannotSpeakWke (player, npc))
|
|
{
|
|
ep3_kachirho_lolo_action_vocalizeMed (player, npc);
|
|
|
|
//-- NPC: Rowarro. Grrrrllll. Roorroww.
|
|
string_id message = new string_id (c_stringFile, "s_87");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition_hasCompletedSpace (player, npc))
|
|
{
|
|
//-- NPC: There is nothing more that I can do for you.
|
|
string_id message = new string_id (c_stringFile, "s_254");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Ok, thanks and see you later.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Can I do that space part again?
|
|
boolean hasResponse1 = false;
|
|
if (ep3_kachirho_lolo_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_255");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_256");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "ep3_kachirho_lolo", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition_hasBowcasterPieces (player, npc))
|
|
{
|
|
ep3_kachirho_lolo_action_grantCraftingComponent (player, npc);
|
|
|
|
//-- NPC: Ah, you have the pieces. That is great. I will put them together for you and give you the correct part. Put this part together with the barrel and the power handler to make the bowcaster.
|
|
string_id message = new string_id (c_stringFile, "s_88");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition_hasFailedSpaceMission (player, npc))
|
|
{
|
|
//-- NPC: No luck with that pilot? No matter. He is still out there if you would like to give it another shot?
|
|
string_id message = new string_id (c_stringFile, "s_89");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sure, I am ready to take care of him now.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thanks, maybe later.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_kachirho_lolo_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_105");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_106");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 6);
|
|
|
|
npcStartConversation (player, npc, "ep3_kachirho_lolo", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition_isOnMission (player, npc))
|
|
{
|
|
//-- NPC: I have told you everything I know. If you manage to get those parts for the feed mechanism I will happily put them together for you. Take care.
|
|
string_id message = new string_id (c_stringFile, "s_90");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition_isReadyForLolo (player, npc))
|
|
{
|
|
//-- NPC: Yes? What can I do for you on this fine day?
|
|
string_id message = new string_id (c_stringFile, "s_91");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I am looking for a bowcaster. A special bowcaster.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_101");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_kachirho_lolo.branchId", 10);
|
|
|
|
npcStartConversation (player, npc, "ep3_kachirho_lolo", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_kachirho_lolo_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Sorry...no time to talk. Work, work, work. I always have orders to fill and schedules to keep.
|
|
string_id message = new string_id (c_stringFile, "s_100");
|
|
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_kachirho_lolo")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.ep3_kachirho_lolo.branchId");
|
|
|
|
if (branchId == 2 && ep3_kachirho_lolo_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && ep3_kachirho_lolo_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && ep3_kachirho_lolo_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && ep3_kachirho_lolo_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && ep3_kachirho_lolo_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 13 && ep3_kachirho_lolo_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 14 && ep3_kachirho_lolo_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 15 && ep3_kachirho_lolo_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 16 && ep3_kachirho_lolo_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 17 && ep3_kachirho_lolo_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 18 && ep3_kachirho_lolo_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 19 && ep3_kachirho_lolo_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 20 && ep3_kachirho_lolo_handleBranch20 (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_kachirho_lolo.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|