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

675 lines
20 KiB
Plaintext

// ======================================================================
//
// camp_delta_leader.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.features;
include library.groundquests;
include library.space_quest;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/camp_delta_leader";
// ======================================================================
// Script Conditions
// ======================================================================
boolean camp_delta_leader_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean camp_delta_leader_condition_hasRadio (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findBossInCharge");
}
// ----------------------------------------------------------------------
boolean camp_delta_leader_condition_hasBaton (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "outbreak_stun_baton_hidden_content", "hasBaton");
}
// ======================================================================
// Script Actions
// ======================================================================
void camp_delta_leader_action_deliverRadioSignal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasFoundBossCampDelta");
}
// ----------------------------------------------------------------------
void camp_delta_leader_action_hasDeliveredBaton (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasDeliveredBaton");
if(!hasCompletedCollectionSlot(player, "hidden_content_stun_baton"))
{
modifyCollectionSlotValue(player, "hidden_content_stun_baton", 1);
}
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int camp_delta_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_20")
{
//-- [NOTE]
if (camp_delta_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "celebrate1");
camp_delta_leader_action_hasDeliveredBaton (player, npc);
//-- NPC: Well...now that looks a lot like my stun baton. Let me take a look at it. Well now...I don't know where you found it, but you did. I can't wait to use it again.
string_id message = new string_id (c_stringFile, "s_21");
utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_delta_leader_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Report to supply if you need anything. You'll be taking up a defensive position at the fort entrance.
//-- [RESPONSE NOTE]
//-- PLAYER: I have a radio for you.
if (response == "s_32")
{
//-- [NOTE]
if (camp_delta_leader_condition__defaultCondition (player, npc))
{
//-- NPC: A working radio? Call in our position, we need to get out of here.
string_id message = new string_id (c_stringFile, "s_33");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Feel free to try. But don't get your hopes up.
boolean hasResponse0 = false;
if (camp_delta_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_delta_leader.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_delta_leader_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: A working radio? Call in our position, we need to get out of here.
//-- [RESPONSE NOTE]
//-- PLAYER: Feel free to try. But don't get your hopes up.
if (response == "s_75")
{
//-- [NOTE]
if (camp_delta_leader_condition__defaultCondition (player, npc))
{
//-- NPC: So it is as bad as I thought then. We'll never get out of here alive. Do me a favor...don't share this with anyone here. Morale is already really low.
string_id message = new string_id (c_stringFile, "s_76");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Don't be so quick to give up hope. Medical and food supplies are being dropped.
boolean hasResponse0 = false;
if (camp_delta_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_78");
utils.setScriptVar (player, "conversation.camp_delta_leader.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_delta_leader_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: So it is as bad as I thought then. We'll never get out of here alive. Do me a favor...don't share this with anyone here. Morale is already really low.
//-- [RESPONSE NOTE]
//-- PLAYER: Don't be so quick to give up hope. Medical and food supplies are being dropped.
if (response == "s_78")
{
//-- [NOTE]
if (camp_delta_leader_condition__defaultCondition (player, npc))
{
//-- NPC: Well I suppose the Empire wouldn't bother unless they had a plan.
string_id message = new string_id (c_stringFile, "s_79");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Right. By the way, your call sign is 'camp delta.'
boolean hasResponse0 = false;
if (camp_delta_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_81");
utils.setScriptVar (player, "conversation.camp_delta_leader.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_delta_leader_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well I suppose the Empire wouldn't bother unless they had a plan.
//-- [RESPONSE NOTE]
//-- PLAYER: Right. By the way, your call sign is 'camp delta.'
if (response == "s_81")
{
//-- [NOTE]
if (camp_delta_leader_condition__defaultCondition (player, npc))
{
camp_delta_leader_action_deliverRadioSignal (player, npc);
//-- NPC: Roger.
string_id message = new string_id (c_stringFile, "s_82");
utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_delta_leader_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You'll need a few more weapons if you plan on surviving the next wave of attacks. Get with supply to scavenge something.
//-- [RESPONSE NOTE]
//-- PLAYER: So you been in the quarantine zone long?
if (response == "s_53")
{
//-- [NOTE]
if (camp_delta_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (player, "explain");
//-- NPC: I was one of the grunts stationed at this forward post before it all began. Watched my whole squad get sick, die and then stand up hungry.
string_id message = new string_id (c_stringFile, "s_64");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You didn't run?
boolean hasResponse0 = false;
if (camp_delta_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_delta_leader.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_delta_leader_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I was one of the grunts stationed at this forward post before it all began. Watched my whole squad get sick, die and then stand up hungry.
//-- [RESPONSE NOTE]
//-- PLAYER: You didn't run?
if (response == "s_65")
{
//-- [NOTE]
if (camp_delta_leader_condition__defaultCondition (player, npc))
{
//-- NPC: I dropped a CryoBan and while they stood there frozen, I beat them into to small pieces with a stun baton.
string_id message = new string_id (c_stringFile, "s_66");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Uh...
boolean hasResponse0 = false;
if (camp_delta_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_delta_leader.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int camp_delta_leader_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I dropped a CryoBan and while they stood there frozen, I beat them into to small pieces with a stun baton.
//-- [RESPONSE NOTE]
//-- PLAYER: Uh...
if (response == "s_67")
{
//-- [NOTE]
if (camp_delta_leader_condition__defaultCondition (player, npc))
{
//-- NPC: Now that I think of it, where did I put that baton?
string_id message = new string_id (c_stringFile, "s_68");
utils.removeScriptVar (player, "conversation.camp_delta_leader.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
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;
}
// ======================================================================
// 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_delta_leader_condition_hasBaton (player, npc))
{
//-- NPC: Hello.
string_id message = new string_id (c_stringFile, "s_19");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I have something for you.
boolean hasResponse0 = false;
if (camp_delta_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_20");
utils.setScriptVar (player, "conversation.camp_delta_leader.branchId", 1);
npcStartConversation (player, npc, "camp_delta_leader", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (camp_delta_leader_condition_hasRadio (player, npc))
{
//-- NPC: Report to supply if you need anything. You'll be taking up a defensive position at the fort entrance.
string_id message = new string_id (c_stringFile, "s_31");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I have a radio for you.
boolean hasResponse0 = false;
if (camp_delta_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_delta_leader.branchId", 3);
npcStartConversation (player, npc, "camp_delta_leader", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (camp_delta_leader_condition__defaultCondition (player, npc))
{
//-- NPC: You'll need a few more weapons if you plan on surviving the next wave of attacks. Get with supply to scavenge something.
string_id message = new string_id (c_stringFile, "s_34");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So you been in the quarantine zone long?
boolean hasResponse0 = false;
if (camp_delta_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_delta_leader.branchId", 8);
npcStartConversation (player, npc, "camp_delta_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_delta_leader")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.camp_delta_leader.branchId");
if (branchId == 1 && camp_delta_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && camp_delta_leader_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && camp_delta_leader_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && camp_delta_leader_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && camp_delta_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && camp_delta_leader_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && camp_delta_leader_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && camp_delta_leader_handleBranch10 (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_delta_leader.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================