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

613 lines
18 KiB
Plaintext

// ======================================================================
//
// talus_nashal_ravi.script
//
//
//
// 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/talus_nashal_ravi";
// ======================================================================
// Script Conditions
// ======================================================================
boolean talus_nashal_ravi_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean talus_nashal_ravi_condition_onGatherMissions (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "talus_nashal_find_weakness", "selonian_gather_missions");
}
// ----------------------------------------------------------------------
boolean talus_nashal_ravi_condition_onThumb (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "talus_nashal_under_thumb", "selonian_find_food") ||
groundquests.isTaskActive(player, "talus_nashal_under_thumb", "selonian_find_hide") ||
groundquests.isTaskActive(player, "talus_nashal_under_thumb", "selonian_find_electronics") ||
groundquests.isTaskActive(player, "talus_nashal_under_thumb", "selonian_destroy_cache"));
}
// ----------------------------------------------------------------------
boolean talus_nashal_ravi_condition_onReturnRavi (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "talus_nashal_under_thumb", "selonian_return_ravi");
}
// ----------------------------------------------------------------------
boolean talus_nashal_ravi_condition_completeThumb (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "talus_nashal_under_thumb");
}
// ======================================================================
// Script Actions
// ======================================================================
void talus_nashal_ravi_action_grantThumb (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "talus_nashal_under_thumb");
}
// ----------------------------------------------------------------------
void talus_nashal_ravi_action_signalThumb (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "selonian_return_ravi");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int talus_nashal_ravi_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Selonian propriety maintains...
//-- [RESPONSE NOTE]
//-- PLAYER: Protocol has been maintained. I have taken care of everything you asked.
if (response == "s_28")
{
doAnimationAction (player, "point_down");
//-- [NOTE]
if (talus_nashal_ravi_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "thank");
doAnimationAction (player, "accept_affection");
talus_nashal_ravi_action_signalThumb (player, npc);
//-- NPC: Kiki is right. You are a friend of the Selonians. Here is the proper reward for your efforts. Please speak to Kiki now.
string_id message = new string_id (c_stringFile, "s_31");
utils.removeScriptVar (player, "conversation.talus_nashal_ravi.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I know! I know! Selnoian propriety dictates, demands, and maintains. Blast it!!
if (response == "s_29")
{
doAnimationAction (player, "gesticulate_wildly");
//-- [NOTE]
if (talus_nashal_ravi_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
talus_nashal_ravi_action_signalThumb (player, npc);
//-- NPC: If you know it, then follow it.
string_id message = new string_id (c_stringFile, "s_30");
utils.removeScriptVar (player, "conversation.talus_nashal_ravi.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_ravi_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Ravi Thienta. Kiki said you are helping the den?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes. Is there something you needed me to do in the smugglers' base?
if (response == "s_16")
{
doAnimationAction (player, "bow");
//-- [NOTE]
if (talus_nashal_ravi_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "rub_chin_thoughtful");
//-- NPC: Several things. Please record these as protocol dictates I must limit my contact with you and I do not wish to repeat myself.
string_id message = new string_id (c_stringFile, "s_18");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Hold on then. Let me get my datapad out...alright. Go ahead.
boolean hasResponse0 = false;
if (talus_nashal_ravi_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.talus_nashal_ravi.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.talus_nashal_ravi.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_ravi_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Several things. Please record these as protocol dictates I must limit my contact with you and I do not wish to repeat myself.
//-- [RESPONSE NOTE]
//-- PLAYER: Hold on then. Let me get my datapad out...alright. Go ahead.
if (response == "s_20")
{
doAnimationAction (player, "paper");
//-- [NOTE]
if (talus_nashal_ravi_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
doAnimationAction (player, "survey");
//-- NPC: The pirates do all they can to keep us dependant on them. I need three things which the pirates have kept from us. Food, our basic wilderness materials, and parts needed to repair our electrical equipment which is deteriorated past the point of usefulness.
string_id message = new string_id (c_stringFile, "s_22");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Food, materials, parts. Anything else?
boolean hasResponse0 = false;
if (talus_nashal_ravi_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_24");
utils.setScriptVar (player, "conversation.talus_nashal_ravi.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.talus_nashal_ravi.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_ravi_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The pirates do all they can to keep us dependant on them. I need three things which the pirates have kept from us. Food, our basic wilderness materials, and parts needed to repair our electrical equipment which is deteriorated past the point of usefulness.
//-- [RESPONSE NOTE]
//-- PLAYER: Food, materials, parts. Anything else?
if (response == "s_24")
{
doAnimationAction (player, "paper");
//-- [NOTE]
if (talus_nashal_ravi_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
doAnimationAction (player, "nod");
//-- NPC: Selonians eschew technological weapons in favor of combat with our natural weapons. Destroy the smugglers' weapon cache to return the advantage to us when we fight these oppressors.
string_id message = new string_id (c_stringFile, "s_26");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Shouldn't be too difficult. I'll be back later.
boolean hasResponse0 = false;
if (talus_nashal_ravi_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.talus_nashal_ravi.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.talus_nashal_ravi.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_ravi_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Selonians eschew technological weapons in favor of combat with our natural weapons. Destroy the smugglers' weapon cache to return the advantage to us when we fight these oppressors.
//-- [RESPONSE NOTE]
//-- PLAYER: Shouldn't be too difficult. I'll be back later.
if (response == "s_32")
{
doAnimationAction (player, "thumb_up");
//-- [NOTE]
if (talus_nashal_ravi_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
talus_nashal_ravi_action_grantThumb (player, npc);
//-- NPC: Please return only when you have completed all these tasks as protocol limits the amount of interaction I am allowed with outsiders.
string_id message = new string_id (c_stringFile, "s_34");
utils.removeScriptVar (player, "conversation.talus_nashal_ravi.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.talus_nashal_ravi");
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
return SCRIPT_CONTINUE;
}
trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo)
{
int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null);
menu_info_data menuInfoData = menuInfo.getMenuItemById (menu);
menuInfoData.setServerNotify (false);
setCondition (self, CONDITION_CONVERSABLE);
faceTo( self, player );
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.talus_nashal_ravi");
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 (talus_nashal_ravi_condition_completeThumb (player, npc))
{
doAnimationAction (npc, "bow5");
//-- NPC: Kiki is the advisor to our den mother. It is appropriate for you to speak with her now. I believe it is acceptable for me to express my gratitude for your help. I do so now.
string_id message = new string_id (c_stringFile, "s_4");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (talus_nashal_ravi_condition_onReturnRavi (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: Selonian propriety maintains...
string_id message = new string_id (c_stringFile, "s_6");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Protocol has been maintained. I have taken care of everything you asked.
boolean hasResponse0 = false;
if (talus_nashal_ravi_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I know! I know! Selnoian propriety dictates, demands, and maintains. Blast it!!
boolean hasResponse1 = false;
if (talus_nashal_ravi_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_28");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
utils.setScriptVar (player, "conversation.talus_nashal_ravi.branchId", 2);
npcStartConversation (player, npc, "talus_nashal_ravi", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (talus_nashal_ravi_condition_onThumb (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: Selonian propriety maintains that we should not speak unless you have completed your task.
string_id message = new string_id (c_stringFile, "s_12");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (talus_nashal_ravi_condition_onGatherMissions (player, npc))
{
doAnimationAction (npc, "bow4");
//-- NPC: Ravi Thienta. Kiki said you are helping the den?
string_id message = new string_id (c_stringFile, "s_14");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes. Is there something you needed me to do in the smugglers' base?
boolean hasResponse0 = false;
if (talus_nashal_ravi_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_16");
utils.setScriptVar (player, "conversation.talus_nashal_ravi.branchId", 6);
npcStartConversation (player, npc, "talus_nashal_ravi", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (talus_nashal_ravi_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "dismiss");
//-- NPC: Protocol dictates that I not speak with you. Speak to Kiki, the den mother's advisor.
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 != "talus_nashal_ravi")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.talus_nashal_ravi.branchId");
if (branchId == 2 && talus_nashal_ravi_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && talus_nashal_ravi_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && talus_nashal_ravi_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && talus_nashal_ravi_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && talus_nashal_ravi_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.talus_nashal_ravi.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================