Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/npe_rakqua_capture.script
T
2013-09-10 23:17:15 -07:00

874 lines
25 KiB
Plaintext

// ======================================================================
//
// npe_rakqua_capture.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.groundquests;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/npe_rakqua_capture";
// ======================================================================
// Script Conditions
// ======================================================================
boolean npe_rakqua_capture_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean npe_rakqua_capture_condition_isTaskActiveQuest (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_officer_try", "freeNeina");
}
// ----------------------------------------------------------------------
boolean npe_rakqua_capture_condition_isHuntActive (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_officer_try", "hunt");
}
// ----------------------------------------------------------------------
boolean npe_rakqua_capture_condition_isReturnActive (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_officer_try", "returnRak");
}
// ----------------------------------------------------------------------
boolean npe_rakqua_capture_condition_haveFiles (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_officer_try_2", "findRak");
}
// ======================================================================
// Script Actions
// ======================================================================
void npe_rakqua_capture_action_giveHuntSignal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "freeNeina");
}
// ----------------------------------------------------------------------
void npe_rakqua_capture_action_talkedRak (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "killComplete");
}
// ----------------------------------------------------------------------
void npe_rakqua_capture_action_gaveFiles (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "giveFiles");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int npe_rakqua_capture_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You're back. What is it this time? We're busy preparing for war!
//-- [RESPONSE NOTE]
//-- PLAYER: That's why I'm here. This madness has to stop!
if (response == "s_27")
{
//-- [NOTE]
if (npe_rakqua_capture_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_accusingly");
//-- NPC: It's not our fault. We're only defending ourselves!
string_id message = new string_id (c_stringFile, "s_28");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Both you and Tansarii have been fooled.
boolean hasResponse0 = false;
if (npe_rakqua_capture_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_29");
utils.setScriptVar (player, "conversation.npe_rakqua_capture.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_rakqua_capture.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_rakqua_capture_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: It's not our fault. We're only defending ourselves!
//-- [RESPONSE NOTE]
//-- PLAYER: Both you and Tansarii have been fooled.
if (response == "s_29")
{
doAnimationAction (player, "shake_head_no");
//-- [NOTE]
if (npe_rakqua_capture_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "pound_fist_palm");
//-- NPC: By whom? Why would I believe you anyway? You've been nothing but trouble for me!
string_id message = new string_id (c_stringFile, "s_30");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You're a wise man. Just look at these files, and you will see.
boolean hasResponse0 = false;
if (npe_rakqua_capture_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_31");
utils.setScriptVar (player, "conversation.npe_rakqua_capture.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_rakqua_capture.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_rakqua_capture_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: By whom? Why would I believe you anyway? You've been nothing but trouble for me!
//-- [RESPONSE NOTE]
//-- PLAYER: You're a wise man. Just look at these files, and you will see.
if (response == "s_31")
{
//-- [NOTE]
if (npe_rakqua_capture_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "rub_chin_thoughtful");
//-- NPC: What is this? This can't possibly be true!
string_id message = new string_id (c_stringFile, "s_32");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm afraid it is. I found these files on your own network.
boolean hasResponse0 = false;
if (npe_rakqua_capture_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_33");
utils.setScriptVar (player, "conversation.npe_rakqua_capture.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_rakqua_capture.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_rakqua_capture_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What is this? This can't possibly be true!
//-- [RESPONSE NOTE]
//-- PLAYER: I'm afraid it is. I found these files on your own network.
if (response == "s_33")
{
//-- [NOTE]
if (npe_rakqua_capture_condition__defaultCondition (player, npc))
{
//-- NPC: This is dire indeed. I will tell my men to stand down while I investigate this. And what about the people on Tansarii? I know they are planning an attack.
string_id message = new string_id (c_stringFile, "s_39");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: It will be handled. You have my word.
boolean hasResponse0 = false;
if (npe_rakqua_capture_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_40");
utils.setScriptVar (player, "conversation.npe_rakqua_capture.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_rakqua_capture.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_rakqua_capture_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: This is dire indeed. I will tell my men to stand down while I investigate this. And what about the people on Tansarii? I know they are planning an attack.
//-- [RESPONSE NOTE]
//-- PLAYER: It will be handled. You have my word.
if (response == "s_40")
{
//-- [NOTE]
if (npe_rakqua_capture_condition__defaultCondition (player, npc))
{
doAnimationAction (player, "bow");
npe_rakqua_capture_action_gaveFiles (player, npc);
//-- NPC: Very well. You have been honest so far, and I'm willing to try anything to avoid this bloodshed. If this proves to be correct, we are all in your debt.
string_id message = new string_id (c_stringFile, "s_41");
utils.removeScriptVar (player, "conversation.npe_rakqua_capture.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_rakqua_capture_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I can't believe it, you actually won...
//-- [RESPONSE NOTE]
//-- PLAYER: You bet I did! Now it's time for you to keep your promise!
if (response == "s_37")
{
doAnimationAction (player, "pose_proudly");
//-- [NOTE]
if (npe_rakqua_capture_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
npe_rakqua_capture_action_talkedRak (player, npc);
//-- NPC: I will honor our agreement and set the girl free. She will be taken to her ship so that she can return to your precious space station. Now leave!
string_id message = new string_id (c_stringFile, "s_38");
utils.removeScriptVar (player, "conversation.npe_rakqua_capture.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_rakqua_capture_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Stop! Why do you come here?
//-- [RESPONSE NOTE]
//-- PLAYER: You have kidnapped a student. I'm here to free her!
if (response == "s_21")
{
//-- [NOTE]
if (npe_rakqua_capture_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shrug_shoulders");
//-- NPC: You must be talking about the human female that came here a while ago. She was prying in to things that were none of her business. Why should we let her go?
string_id message = new string_id (c_stringFile, "s_23");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: She's only a young girl. She didn't know better.
boolean hasResponse0 = false;
if (npe_rakqua_capture_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_25");
utils.setScriptVar (player, "conversation.npe_rakqua_capture.branchId", 11);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_rakqua_capture.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_rakqua_capture_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You must be talking about the human female that came here a while ago. She was prying in to things that were none of her business. Why should we let her go?
//-- [RESPONSE NOTE]
//-- PLAYER: She's only a young girl. She didn't know better.
if (response == "s_25")
{
doAnimationAction (player, "shake_head_no");
//-- [NOTE]
if (npe_rakqua_capture_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_accusingly");
//-- NPC: How do I know that I can trust you? We're being hunted like animals here!
string_id message = new string_id (c_stringFile, "s_42");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Then take me, and set her free!
boolean hasResponse0 = false;
if (npe_rakqua_capture_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_44");
utils.setScriptVar (player, "conversation.npe_rakqua_capture.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_rakqua_capture.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_rakqua_capture_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: How do I know that I can trust you? We're being hunted like animals here!
//-- [RESPONSE NOTE]
//-- PLAYER: Then take me, and set her free!
if (response == "s_44")
{
//-- [NOTE]
if (npe_rakqua_capture_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "rub_chin_thoughtful");
//-- NPC: A noble suggestion. Very well, I will give you a chance...a test of your honor. If you can hunt down and defeat one of my mighty shamans in a fair fight, I will set her free.
string_id message = new string_id (c_stringFile, "s_46");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: If there can't be a peaceful solution, then so be it. I'll do it!
boolean hasResponse0 = false;
if (npe_rakqua_capture_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_48");
utils.setScriptVar (player, "conversation.npe_rakqua_capture.branchId", 13);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_rakqua_capture.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_rakqua_capture_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: A noble suggestion. Very well, I will give you a chance...a test of your honor. If you can hunt down and defeat one of my mighty shamans in a fair fight, I will set her free.
//-- [RESPONSE NOTE]
//-- PLAYER: If there can't be a peaceful solution, then so be it. I'll do it!
if (response == "s_48")
{
doAnimationAction (player, "pound_fist_palm");
//-- [NOTE]
if (npe_rakqua_capture_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "laugh");
npe_rakqua_capture_action_giveHuntSignal (player, npc);
//-- NPC: You will try to do it. I'm sure this is the last I will see of you, so it's been interesting talking to you.
string_id message = new string_id (c_stringFile, "s_50");
utils.removeScriptVar (player, "conversation.npe_rakqua_capture.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.npe_rakqua_capture");
setCondition (self, CONDITION_CONVERSABLE);
setName(self, "Rak'qua Fervent");
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setName(self, "Rak'qua Fervent");
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.npe_rakqua_capture");
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 (npe_rakqua_capture_condition_haveFiles (player, npc))
{
//-- NPC: You're back. What is it this time? We're busy preparing for war!
string_id message = new string_id (c_stringFile, "s_26");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: That's why I'm here. This madness has to stop!
boolean hasResponse0 = false;
if (npe_rakqua_capture_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_27");
utils.setScriptVar (player, "conversation.npe_rakqua_capture.branchId", 1);
npcStartConversation (player, npc, "npe_rakqua_capture", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_rakqua_capture_condition_isReturnActive (player, npc))
{
doAnimationAction (npc, "slump_head");
//-- NPC: I can't believe it, you actually won...
string_id message = new string_id (c_stringFile, "s_36");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You bet I did! Now it's time for you to keep your promise!
boolean hasResponse0 = false;
if (npe_rakqua_capture_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.npe_rakqua_capture.branchId", 7);
npcStartConversation (player, npc, "npe_rakqua_capture", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_rakqua_capture_condition_isHuntActive (player, npc))
{
doAnimationAction (npc, "shake_head_no");
//-- NPC: I won't set her free until you've defeated one of my mighty shamans!
string_id message = new string_id (c_stringFile, "s_35");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_rakqua_capture_condition_isTaskActiveQuest (player, npc))
{
doAnimationAction (npc, "stop");
//-- NPC: Stop! Why do you come here?
string_id message = new string_id (c_stringFile, "s_19");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You have kidnapped a student. I'm here to free her!
boolean hasResponse0 = false;
if (npe_rakqua_capture_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_21");
utils.setScriptVar (player, "conversation.npe_rakqua_capture.branchId", 10);
npcStartConversation (player, npc, "npe_rakqua_capture", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_rakqua_capture_condition__defaultCondition (player, npc))
{
//-- NPC: Be gone!
string_id message = new string_id (c_stringFile, "s_52");
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 != "npe_rakqua_capture")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.npe_rakqua_capture.branchId");
if (branchId == 1 && npe_rakqua_capture_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && npe_rakqua_capture_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && npe_rakqua_capture_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && npe_rakqua_capture_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && npe_rakqua_capture_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && npe_rakqua_capture_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && npe_rakqua_capture_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && npe_rakqua_capture_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && npe_rakqua_capture_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && npe_rakqua_capture_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.npe_rakqua_capture.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================