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

748 lines
23 KiB
Plaintext

// ======================================================================
//
// camp_gamma_leader.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.features;
include library.groundquests;
include library.space_quest;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/camp_gamma_leader";
// ======================================================================
// Script Conditions
// ======================================================================
boolean camp_gamma_leader_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean camp_gamma_leader_condition_hasRadio (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "outbreak_radio_delivery_02", "findBossInCharge");
}
// ----------------------------------------------------------------------
boolean camp_gamma_leader_condition_hasCamera (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "outbreak_scout_camera_hidden_content", "hasCamera");
}
// ======================================================================
// Script Actions
// ======================================================================
void camp_gamma_leader_action_deliverRadioSignal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasFoundBossCampGamma");
}
// ----------------------------------------------------------------------
void camp_gamma_leader_action_hasDeliveredCamera (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasDeliveredCamera");
if(!hasCompletedCollectionSlot(player, "hidden_content_camera"))
{
modifyCollectionSlotValue(player, "hidden_content_camera", 1);
}
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int camp_gamma_leader_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hello.
//-- [RESPONSE NOTE]
//-- PLAYER: I have something for you.
if (response == "s_22")
{
//-- [NOTE]
if (camp_gamma_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "thank");
camp_gamma_leader_action_hasDeliveredCamera (player, npc);
//-- NPC: A smashed scout camera? Hey...wait a second. This is the scout unit we were here to rescue. Wow. Well, at least I have something to show for the trouble. Thanks, %TU.
string_id message = new string_id (c_stringFile, "s_23");
utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_gamma_leader_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Report to the medic in the camp if you have any injuries...or if you are feeling sick in any way.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm not sick or injured, I have a radio for you.
if (response == "s_32")
{
//-- [NOTE]
if (camp_gamma_leader_condition__defaultCondition (player, npc))
{
//-- NPC: A radio? Well, I suppose talking to the Empire beats talking to the hasty walls. Maybe they'll drop supplies.
string_id message = new string_id (c_stringFile, "s_33");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Check in with camp alpha. Your call sign is 'camp gamma.'
boolean hasResponse0 = false;
if (camp_gamma_leader_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.camp_gamma_leader.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_gamma_leader_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: A radio? Well, I suppose talking to the Empire beats talking to the hasty walls. Maybe they'll drop supplies.
//-- [RESPONSE NOTE]
//-- PLAYER: Check in with camp alpha. Your call sign is 'camp gamma.'
if (response == "s_75")
{
//-- [NOTE]
if (camp_gamma_leader_condition__defaultCondition (player, npc))
{
camp_gamma_leader_action_deliverRadioSignal (player, npc);
//-- NPC: Will do.
string_id message = new string_id (c_stringFile, "s_76");
utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_gamma_leader_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Can I help you?
//-- [RESPONSE NOTE]
//-- PLAYER: How did you get stuck in the quarantine zone?
if (response == "s_53")
{
//-- [NOTE]
if (camp_gamma_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (player, "explain");
//-- NPC: I was part of a rescue team of 5 dropped in before the walls went up. We lost a squad of scouts...never did find them. Anyway, we were on foot at the last known location when they attacked.
string_id message = new string_id (c_stringFile, "s_64");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: The undead?
boolean hasResponse0 = false;
if (camp_gamma_leader_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.camp_gamma_leader.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_gamma_leader_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I was part of a rescue team of 5 dropped in before the walls went up. We lost a squad of scouts...never did find them. Anyway, we were on foot at the last known location when they attacked.
//-- [RESPONSE NOTE]
//-- PLAYER: The undead?
if (response == "s_65")
{
//-- [NOTE]
if (camp_gamma_leader_condition__defaultCondition (player, npc))
{
//-- NPC: Yeah...at first we just thought they were Stormtroopers, considering...well, considering they were Stormtroopers, but they weren't attacking. Just screaming at us in unison. Really strange...anyway. We didn't waste a moment before laying down surpressive fire.
string_id message = new string_id (c_stringFile, "s_66");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Did it do any good?
boolean hasResponse0 = false;
if (camp_gamma_leader_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.camp_gamma_leader.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_gamma_leader_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Yeah...at first we just thought they were Stormtroopers, considering...well, considering they were Stormtroopers, but they weren't attacking. Just screaming at us in unison. Really strange...anyway. We didn't waste a moment before laying down surpressive fire.
//-- [RESPONSE NOTE]
//-- PLAYER: Did it do any good?
if (response == "s_67")
{
//-- [NOTE]
if (camp_gamma_leader_condition__defaultCondition (player, npc))
{
//-- NPC: Not really. We would shoot them down and they'd pop back up. Alpha team maneuvered to flank but they were right on top of them...they didn't care about flanking or suppressive fire...since of course they don't die. A few of us managed to run but even that didn't help.
string_id message = new string_id (c_stringFile, "s_68");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: They surrounded you?
boolean hasResponse0 = false;
if (camp_gamma_leader_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_69");
utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_gamma_leader_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Not really. We would shoot them down and they'd pop back up. Alpha team maneuvered to flank but they were right on top of them...they didn't care about flanking or suppressive fire...since of course they don't die. A few of us managed to run but even that didn't help.
//-- [RESPONSE NOTE]
//-- PLAYER: They surrounded you?
if (response == "s_69")
{
//-- [NOTE]
if (camp_gamma_leader_condition__defaultCondition (player, npc))
{
//-- NPC: No. Actually we made it back to an extraction point not far from here. Set up a defensive position and laid low. That was when the others got sick. You probably know what happened next.
string_id message = new string_id (c_stringFile, "s_70");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: The extraction never came?
boolean hasResponse0 = false;
if (camp_gamma_leader_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_71");
utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_gamma_leader_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: No. Actually we made it back to an extraction point not far from here. Set up a defensive position and laid low. That was when the others got sick. You probably know what happened next.
//-- [RESPONSE NOTE]
//-- PLAYER: The extraction never came?
if (response == "s_71")
{
//-- [NOTE]
if (camp_gamma_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "cover_eyes");
//-- NPC: I called it off. As soon as the first one of my unit stood up and started eating the other, I wasn't about to risk it. I thought I was a gonner...but the sickness never took me.
string_id message = new string_id (c_stringFile, "s_72");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Well, looks like you are keeping everyone alive here.
boolean hasResponse0 = false;
if (camp_gamma_leader_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_73");
utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 11);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_gamma_leader_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I called it off. As soon as the first one of my unit stood up and started eating the other, I wasn't about to risk it. I thought I was a gonner...but the sickness never took me.
//-- [RESPONSE NOTE]
//-- PLAYER: Well, looks like you are keeping everyone alive here.
if (response == "s_73")
{
//-- [NOTE]
if (camp_gamma_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "catchbreath");
//-- NPC: Maybe, but for how long?
string_id message = new string_id (c_stringFile, "s_74");
utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
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;
}
// ======================================================================
// 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 (camp_gamma_leader_condition_hasCamera (player, npc))
{
//-- NPC: Hello.
string_id message = new string_id (c_stringFile, "s_21");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I have something for you.
boolean hasResponse0 = false;
if (camp_gamma_leader_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_22");
utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 1);
npcStartConversation (player, npc, "camp_gamma_leader", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (camp_gamma_leader_condition_hasRadio (player, npc))
{
//-- NPC: Report to the medic in the camp if you have any injuries...or if you are feeling sick in any way.
string_id message = new string_id (c_stringFile, "s_31");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm not sick or injured, I have a radio for you.
boolean hasResponse0 = false;
if (camp_gamma_leader_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.camp_gamma_leader.branchId", 3);
npcStartConversation (player, npc, "camp_gamma_leader", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (camp_gamma_leader_condition__defaultCondition (player, npc))
{
//-- NPC: Can I help you?
string_id message = new string_id (c_stringFile, "s_34");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: How did you get stuck in the quarantine zone?
boolean hasResponse0 = false;
if (camp_gamma_leader_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_53");
utils.setScriptVar (player, "conversation.camp_gamma_leader.branchId", 6);
npcStartConversation (player, npc, "camp_gamma_leader", 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 != "camp_gamma_leader")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.camp_gamma_leader.branchId");
if (branchId == 1 && camp_gamma_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && camp_gamma_leader_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && camp_gamma_leader_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && camp_gamma_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && camp_gamma_leader_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && camp_gamma_leader_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && camp_gamma_leader_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && camp_gamma_leader_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && camp_gamma_leader_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.camp_gamma_leader.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================