Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/trig_longo.script
T

1095 lines
32 KiB
Plaintext

// ======================================================================
//
// trig_longo.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// 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.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/trig_longo";
// ======================================================================
// Script Conditions
// ======================================================================
boolean trig_longo_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean trig_longo_condition_isNotImmunized (obj_id player, obj_id npc)
{
faceTo(npc, player);
return (groundquests.isTaskActive(player, "outbreak_quest_01_imperial", "codyInnoculate")
|| groundquests.isTaskActive(player, "outbreak_quest_01_rebel", "codyInnoculate")
|| groundquests.isTaskActive(player, "outbreak_quest_01_neutral", "codyInnoculate")
);
}
// ----------------------------------------------------------------------
boolean trig_longo_condition_hasTrigTask (obj_id player, obj_id npc)
{
faceTo(npc, player);
return groundquests.isTaskActive(player, "outbreak_quest_01_b_imperial", "talkToTrig")
|| groundquests.isTaskActive(player, "outbreak_quest_01_b_rebel", "talkToTrig")
|| groundquests.isTaskActive(player, "outbreak_quest_01_b_neutral", "talkToTrig");
}
// ----------------------------------------------------------------------
boolean trig_longo_condition_hasDeletedQuest2 (obj_id player, obj_id npc)
{
faceTo(npc, player);
return (groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_imperial")
&& !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_imperial"))
|| (groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_rebel")
&& !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_rebel"))
|| (groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_neutral")
&& !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_neutral"));
}
// ----------------------------------------------------------------------
boolean trig_longo_condition_hasCompletedQuestLine (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "outbreak_quest_final_imperial")
|| groundquests.hasCompletedQuest(player, "outbreak_quest_final_neutral")
|| groundquests.hasCompletedQuest(player, "outbreak_quest_final_rebel");
}
// ----------------------------------------------------------------------
boolean trig_longo_condition_hasDeliveredRadioEpsilon (obj_id player, obj_id npc)
{
faceTo(npc, player);
return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_03");
}
// ----------------------------------------------------------------------
boolean trig_longo_condition_hasCompletedQuest2 (obj_id player, obj_id npc)
{
faceTo(npc, player);
return groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")
|| groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")
|| groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral");
}
// ----------------------------------------------------------------------
boolean trig_longo_condition_isNeutral (obj_id player, obj_id npc)
{
faceTo(npc, player);
return groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral");
}
// ----------------------------------------------------------------------
boolean trig_longo_condition_isRebel (obj_id player, obj_id npc)
{
faceTo(npc, player);
return groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel");
}
// ======================================================================
// Script Actions
// ======================================================================
void trig_longo_action_updatedQuestWaypoint (obj_id player, obj_id npc)
{
faceTo(npc, player);
/*
location loc = new location(-7409, 570, -7345, "dathomir");
obj_id wedgeWpt = createWaypointInDatapad(player, loc);
setWaypointName(wedgeWpt, "Research and Prison Facility");
setWaypointActive(wedgeWpt, true);
*/
groundquests.sendSignal(player, "spokenToTrigQuest01");
}
// ----------------------------------------------------------------------
void trig_longo_action_giveQuest2 (obj_id player, obj_id npc)
{
if(groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial")
&& groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_imperial")
&& !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_imperial"))
{
groundquests.grantQuest(player, "outbreak_quest_02_imperial");
return;
}
if (groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel")
&& groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_rebel")
&& !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_rebel"))
{
groundquests.grantQuest(player, "outbreak_quest_02_rebel");
return;
}
if (groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")
&& groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_neutral")
&& !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_neutral"))
{
groundquests.grantQuest(player, "outbreak_quest_02_neutral");
return;
}
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int trig_longo_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I don't recognize you. You look a little clean to be from the quarantine zone.
//-- [RESPONSE NOTE]
//-- PLAYER: I just arrived. Who are you?
if (response == "s_61")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
//-- NPC: I'm Trig. I work with Doctor Cody. Are you another volunteer sent by the Empire?
string_id message = new string_id (c_stringFile, "s_62");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes.
boolean hasResponse0 = false;
if (trig_longo_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No, I'm here on behalf of the Alliance.
boolean hasResponse1 = false;
if (trig_longo_condition_isRebel (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I'm representing another party.
boolean hasResponse2 = false;
if (trig_longo_condition_isNeutral (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_63");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_27");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_33");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int trig_longo_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I'm Trig. I work with Doctor Cody. Are you another volunteer sent by the Empire?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes.
if (response == "s_63")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
//-- NPC: I've seen a few of you. More than I can count actually. I send them all to the Research and Prison Facility.
string_id message = new string_id (c_stringFile, "s_64");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Doctor Cody mentioned there may be other survivors.
boolean hasResponse0 = false;
if (trig_longo_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_65");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No, I'm here on behalf of the Alliance.
if (response == "s_27")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
//-- NPC: Well then, you must know Han Solo. He was the one that dropped us here to help out. I guess he is waiting for us to give him a call in case things get a little too bad here.
string_id message = new string_id (c_stringFile, "s_31");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Doctor Cody mentioned you have heard of survivors?
boolean hasResponse0 = false;
if (trig_longo_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_32");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I'm representing another party.
if (response == "s_33")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
//-- NPC: Oh? Well no one asks many questions here. Just yesterday I saw an Imperial Officer sharing rations with Rebel Scouts.
string_id message = new string_id (c_stringFile, "s_35");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Doctor Cody mentioned you have heard of survivors?
boolean hasResponse0 = false;
if (trig_longo_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_37");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 13);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int trig_longo_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I've seen a few of you. More than I can count actually. I send them all to the Research and Prison Facility.
//-- [RESPONSE NOTE]
//-- PLAYER: Doctor Cody mentioned there may be other survivors.
if (response == "s_65")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
//-- NPC: There are other camps just like this. The only location I know coordinates to is a hold out camp of Stormtrooper 'Ims' at the Research and Prison Facility. Ground zero to the virus.
string_id message = new string_id (c_stringFile, "s_66");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Ims?
boolean hasResponse0 = false;
if (trig_longo_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_67");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int trig_longo_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: There are other camps just like this. The only location I know coordinates to is a hold out camp of Stormtrooper 'Ims' at the Research and Prison Facility. Ground zero to the virus.
//-- [RESPONSE NOTE]
//-- PLAYER: Ims?
if (response == "s_67")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "slump_head");
//-- NPC: Immunes. There is a small possibility of being naturally immune to the virus as long as you avoid being bitten. Doctor Cody and I are examples of immunes. My brother as well, but he was bitten...that was a long time ago.
string_id message = new string_id (c_stringFile, "s_68");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I see.
boolean hasResponse0 = false;
if (trig_longo_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_75");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int trig_longo_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Immunes. There is a small possibility of being naturally immune to the virus as long as you avoid being bitten. Doctor Cody and I are examples of immunes. My brother as well, but he was bitten...that was a long time ago.
//-- [RESPONSE NOTE]
//-- PLAYER: I see.
if (response == "s_75")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
//-- NPC: Any other questions?
string_id message = new string_id (c_stringFile, "s_77");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So you and Doctor Cody have seen this before?
boolean hasResponse0 = false;
if (trig_longo_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Any idea where the Research and Prison Facility is?
boolean hasResponse1 = false;
if (trig_longo_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_79");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_85");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int trig_longo_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Any other questions?
//-- [RESPONSE NOTE]
//-- PLAYER: So you and Doctor Cody have seen this before?
if (response == "s_79")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
//-- NPC: Yes, in space. Apparently the thrusters of the ship we were on failed, the crew found an abandoned Star Destroyer for parts...only it wasn't really abandoned. Only a handful of us survived the ordeal. I guess Doctor Cody wanted to help avoid the same here on Dathomir.
string_id message = new string_id (c_stringFile, "s_81");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So you and Doctor Cody have seen this before?
boolean hasResponse0 = false;
if (trig_longo_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Any idea where the Research and Prison Facility is?
boolean hasResponse1 = false;
if (trig_longo_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_79");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_85");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Any idea where the Research and Prison Facility is?
if (response == "s_85")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
trig_longo_action_updatedQuestWaypoint (player, npc);
//-- NPC: Here you are. I hear there are other camps in the quarantine zone but I don't know their location. Maris can help you with those locations. Good Luck!
string_id message = new string_id (c_stringFile, "s_93");
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int trig_longo_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Yes, in space. Apparently the thrusters of the ship we were on failed, the crew found an abandoned Star Destroyer for parts...only it wasn't really abandoned. Only a handful of us survived the ordeal. I guess Doctor Cody wanted to help avoid the same here on Dathomir.
//-- [RESPONSE NOTE]
//-- PLAYER: So you and Doctor Cody have seen this before?
if (response == "s_79")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
//-- NPC: Yes, in space. Apparently the thrusters of the ship we were on failed, the crew found an abandoned Star Destroyer for parts...only it wasn't really abandoned. Only a handful of us survived the ordeal. I guess Doctor Cody wanted to help avoid the same here on Dathomir.
string_id message = new string_id (c_stringFile, "s_81");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So you and Doctor Cody have seen this before?
boolean hasResponse0 = false;
if (trig_longo_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Any idea where the Research and Prison Facility is?
boolean hasResponse1 = false;
if (trig_longo_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_79");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_85");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Any idea where the Research and Prison Facility is?
if (response == "s_85")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
trig_longo_action_updatedQuestWaypoint (player, npc);
//-- NPC: Here you are. I hear there are other camps in the quarantine zone but I don't know their location. Maris can help you with those locations. Good Luck!
string_id message = new string_id (c_stringFile, "s_93");
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int trig_longo_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well then, you must know Han Solo. He was the one that dropped us here to help out. I guess he is waiting for us to give him a call in case things get a little too bad here.
//-- [RESPONSE NOTE]
//-- PLAYER: Doctor Cody mentioned you have heard of survivors?
if (response == "s_32")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
//-- NPC: There are other camps just like this. The only location I know coordinates to is a hold out camp of Stormtrooper 'Ims' at the Research and Prison Facility. Ground zero to the virus.
string_id message = new string_id (c_stringFile, "s_66");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Ims?
boolean hasResponse0 = false;
if (trig_longo_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_67");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int trig_longo_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Oh? Well no one asks many questions here. Just yesterday I saw an Imperial Officer sharing rations with Rebel Scouts.
//-- [RESPONSE NOTE]
//-- PLAYER: Doctor Cody mentioned you have heard of survivors?
if (response == "s_37")
{
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
//-- NPC: There are other camps just like this. The only location I know coordinates to is a hold out camp of Stormtrooper 'Ims' at the Research and Prison Facility. Ground zero to the virus.
string_id message = new string_id (c_stringFile, "s_66");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Ims?
boolean hasResponse0 = false;
if (trig_longo_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_67");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.trig_longo");
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);
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.trig_longo");
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 (trig_longo_condition_hasCompletedQuestLine (player, npc))
{
//-- NPC: I can't believe you came back to see us after you evacuated the research facility of all those scientists. I thought you'd be too busy with parades or whatever heroes do...guess your work here isn't done.
string_id message = new string_id (c_stringFile, "s_26");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (trig_longo_condition_hasCompletedQuest2 (player, npc))
{
//-- NPC: So you located that camp at the research facility? You have guts!
string_id message = new string_id (c_stringFile, "s_24");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (trig_longo_condition_hasDeletedQuest2 (player, npc))
{
trig_longo_action_giveQuest2 (player, npc);
//-- NPC: We've talked already right? I think you were on your way to the prison facility.
string_id message = new string_id (c_stringFile, "s_22");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (trig_longo_condition_hasTrigTask (player, npc))
{
//-- NPC: I don't recognize you. You look a little clean to be from the quarantine zone.
string_id message = new string_id (c_stringFile, "s_59");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I just arrived. Who are you?
boolean hasResponse0 = false;
if (trig_longo_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_61");
utils.setScriptVar (player, "conversation.trig_longo.branchId", 4);
npcStartConversation (player, npc, "trig_longo", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (trig_longo_condition_isNotImmunized (player, npc))
{
//-- NPC: You should speak to Doctor Cody to get the anti-virus. It won't hold off this new strain of the virus forever, but if you continue to renew the anti-virus, it will protect you.
string_id message = new string_id (c_stringFile, "s_73");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (trig_longo_condition_hasDeliveredRadioEpsilon (player, npc))
{
//-- NPC: Maris told me you delivered the last radio to camp epsilon at the research facility. You are quite the hero.
string_id message = new string_id (c_stringFile, "s_25");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (trig_longo_condition__defaultCondition (player, npc))
{
//-- NPC: We don't have much room but you are more than welcome to stay. Hopefully we'll all be rescued soon.
string_id message = new string_id (c_stringFile, "s_60");
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 != "trig_longo")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.trig_longo.branchId");
if (branchId == 4 && trig_longo_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && trig_longo_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && trig_longo_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && trig_longo_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && trig_longo_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && trig_longo_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && trig_longo_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && trig_longo_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && trig_longo_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.trig_longo.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================