mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
803 lines
22 KiB
Plaintext
803 lines
22 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// cale_serasai.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/cale_serasai";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean cale_serasai_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean cale_serasai_condition_isAmbassador (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "speakToAmbassador");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean cale_serasai_condition_deliverMessage (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "deliverMessage");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean cale_serasai_condition_moveThroughKill (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "killTheHenchmen");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean cale_serasai_condition_speakLastTime (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "speakToAmbassadorTwo")
|
|
|| (groundquests.hasCompletedQuest(player, "u16_nym_themepark_negotiate_peace")
|
|
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_rescue_sheeli"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean cale_serasai_condition_hasNotCompletedWave (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "killTheHenchmen");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean cale_serasai_condition_failedExtraction (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli_fail", "failedExtraction");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void cale_serasai_action_signalMessageReceived (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "hasDeliveredMessage");
|
|
|
|
LOG("nym_wave_event", "sending wave signal");
|
|
|
|
dictionary dict = new dictionary();
|
|
dict.put("player", player);
|
|
messageTo(npc, "waveEventControllerNPCStart", dict, 2, false);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void cale_serasai_action_giveRescueMission (obj_id player, obj_id npc)
|
|
{
|
|
//groundquests.grantQuest(player, "u16_nym_themepark_rescue_sheeli");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void cale_serasai_action_signalAmbassador (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "hasSpokenToAmbassador");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void cale_serasai_action_signalKill (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "hasKilledTheHenchmen");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void cale_serasai_action_signalSpokenLastTime (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "hasSpokenToAmbassadorTwo");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void cale_serasai_action_clearFail (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "hasSpokenCaleRemoveFail");
|
|
cale_serasai_action_giveRescueMission(player,npc);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int cale_serasai_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Look...you made your point. I don't want any more trouble. I've sent a com to release Choster's sister. Now please leave me alone.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Oh? What about the peace agreement?
|
|
if (response == "s_18")
|
|
{
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "udaman");
|
|
|
|
cale_serasai_action_giveRescueMission (player, npc);
|
|
|
|
//-- NPC: We'll be in contact.
|
|
string_id message = new string_id (c_stringFile, "s_19");
|
|
utils.removeScriptVar (player, "conversation.cale_serasai.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int cale_serasai_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You have a response from Nym?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I do.
|
|
if (response == "s_14")
|
|
{
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: What does the pirate say.
|
|
string_id message = new string_id (c_stringFile, "s_20");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Hand over Choster's sister for a ransom.
|
|
boolean hasResponse0 = false;
|
|
if (cale_serasai_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_35");
|
|
|
|
utils.setScriptVar (player, "conversation.cale_serasai.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.cale_serasai.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int cale_serasai_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What does the pirate say.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Hand over Choster's sister for a ransom.
|
|
if (response == "s_35")
|
|
{
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "slit_throat");
|
|
|
|
//-- NPC: Let me guess. You just made that up didn't you? We want Choster. If we don't get Choster, the female Twi'lek dies!
|
|
string_id message = new string_id (c_stringFile, "s_36");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm not going to let you do that!
|
|
boolean hasResponse0 = false;
|
|
if (cale_serasai_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.cale_serasai.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.cale_serasai.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int cale_serasai_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Let me guess. You just made that up didn't you? We want Choster. If we don't get Choster, the female Twi'lek dies!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm not going to let you do that!
|
|
if (response == "s_37")
|
|
{
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "thumb_down");
|
|
|
|
cale_serasai_action_signalMessageReceived (player, npc);
|
|
|
|
//-- NPC: We'll see. Attack!
|
|
string_id message = new string_id (c_stringFile, "s_38");
|
|
utils.removeScriptVar (player, "conversation.cale_serasai.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int cale_serasai_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Are you the 'emissary' for Nym? By the way everyone talks, I expected the spacer they call %TU to be a bit bigger.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm here. Talk peace.
|
|
if (response == "s_24")
|
|
{
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod_head_once");
|
|
|
|
//-- NPC: Straight to business. I like that. Okay, here is the deal. You pass us Choster, we'll sign a cease fire agreement.
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Choster? Never heard of him.
|
|
boolean hasResponse0 = false;
|
|
if (cale_serasai_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.cale_serasai.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.cale_serasai.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int cale_serasai_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Straight to business. I like that. Okay, here is the deal. You pass us Choster, we'll sign a cease fire agreement.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Choster? Never heard of him.
|
|
if (response == "s_29")
|
|
{
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "shake_head_no");
|
|
|
|
//-- NPC: Don't lie. We know you used him to get past the security system in our hideout. You'll hand him over then we'll sign an agreement. We'll even give you a good faith gift in credits.
|
|
string_id message = new string_id (c_stringFile, "s_30");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Nym won't go for it.
|
|
boolean hasResponse0 = false;
|
|
if (cale_serasai_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.cale_serasai.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.cale_serasai.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int cale_serasai_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Don't lie. We know you used him to get past the security system in our hideout. You'll hand him over then we'll sign an agreement. We'll even give you a good faith gift in credits.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Nym won't go for it.
|
|
if (response == "s_32")
|
|
{
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well, we have Choster's sister. So either way, someone is going to pay. Hand over Choster or we kill the sister...I doubt you want her blood on your hands, %TU.
|
|
string_id message = new string_id (c_stringFile, "s_34");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Let me contact Nym.
|
|
boolean hasResponse0 = false;
|
|
if (cale_serasai_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.cale_serasai.branchId", 11);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
npcSpeak (player, pp);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.cale_serasai.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 cale_serasai_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well, we have Choster's sister. So either way, someone is going to pay. Hand over Choster or we kill the sister...I doubt you want her blood on your hands, %TU.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Let me contact Nym.
|
|
if (response == "s_40")
|
|
{
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition__defaultCondition (player, npc))
|
|
{
|
|
cale_serasai_action_signalAmbassador (player, npc);
|
|
|
|
//-- NPC: Take your time.
|
|
string_id message = new string_id (c_stringFile, "s_42");
|
|
utils.removeScriptVar (player, "conversation.cale_serasai.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isTangible (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.cale_serasai");
|
|
|
|
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.cale_serasai");
|
|
|
|
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 (cale_serasai_condition_speakLastTime (player, npc))
|
|
{
|
|
doAnimationAction (npc, "scared");
|
|
|
|
cale_serasai_action_signalSpokenLastTime (player, npc);
|
|
|
|
//-- NPC: Look...you made your point. I don't want any more trouble. I've sent a com to release Choster's sister. Now please leave me alone.
|
|
string_id message = new string_id (c_stringFile, "s_11");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Oh? What about the peace agreement?
|
|
boolean hasResponse0 = false;
|
|
if (cale_serasai_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_18");
|
|
|
|
utils.setScriptVar (player, "conversation.cale_serasai.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "cale_serasai", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition_hasNotCompletedWave (player, npc))
|
|
{
|
|
cale_serasai_action_signalMessageReceived (player, npc);
|
|
|
|
//-- NPC: Ha ha ha! You are back? Get him boys!
|
|
string_id message = new string_id (c_stringFile, "s_43");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition_deliverMessage (player, npc))
|
|
{
|
|
//-- NPC: You have a response from Nym?
|
|
string_id message = new string_id (c_stringFile, "s_13");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I do.
|
|
boolean hasResponse0 = false;
|
|
if (cale_serasai_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_14");
|
|
|
|
utils.setScriptVar (player, "conversation.cale_serasai.branchId", 4);
|
|
|
|
npcStartConversation (player, npc, "cale_serasai", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition_isAmbassador (player, npc))
|
|
{
|
|
doAnimationAction (npc, "sigh_deeply");
|
|
|
|
//-- NPC: Are you the 'emissary' for Nym? By the way everyone talks, I expected the spacer they call %TU to be a bit bigger.
|
|
string_id message = new string_id (c_stringFile, "s_22");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm here. Talk peace.
|
|
boolean hasResponse0 = false;
|
|
if (cale_serasai_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.cale_serasai.branchId", 8);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
npcStartConversation (player, npc, "cale_serasai", null, pp, responses);
|
|
}
|
|
else
|
|
{
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
chat.chat (npc, player, null, null, pp);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (cale_serasai_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: We don't need strangers around here. I suggest you leave.
|
|
string_id message = new string_id (c_stringFile, "s_46");
|
|
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 != "cale_serasai")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.cale_serasai.branchId");
|
|
|
|
if (branchId == 1 && cale_serasai_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && cale_serasai_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && cale_serasai_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && cale_serasai_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && cale_serasai_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && cale_serasai_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && cale_serasai_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && cale_serasai_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.cale_serasai.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|