mirror of
https://bitbucket.org/seefoe/dsrc.git
synced 2026-07-31 01:15:55 -04:00
848 lines
23 KiB
Plaintext
848 lines
23 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// elder_robe_exchange.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/elder_robe_exchange";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean elder_robe_exchange_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean elder_robe_exchange_condition_hasElderRobe (obj_id player, obj_id npc)
|
|
{
|
|
return (utils.playerHasStaticItemInBankOrInventory(player, "item_jedi_robe_dark_04_04") ||
|
|
utils.playerHasStaticItemInBankOrInventory(player, "item_jedi_robe_light_04_04"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean elder_robe_exchange_condition_isOnRobeQuest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActive(player, "jedi_gift_exchange");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean elder_robe_exchange_condition_turnInRobeQuest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedTask(player, "jedi_gift_exchange", "GatherRelics");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean elder_robe_exchange_condition_completeRobeQuest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "jedi_gift_exchange");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean elder_robe_exchange_condition_hasGivenRobe (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.isTaskActive(player, "jedi_gift_exchange", "TalkAgainLight") );
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void elder_robe_exchange_action_grantRobeQuest (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player,"jedi_gift_exchange");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void elder_robe_exchange_action_sendSignalComplete (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "elder_robe_exchange_signal");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
string elder_robe_exchange_tokenTO_tokenTO0001 (obj_id player, obj_id npc)
|
|
{
|
|
return getPlayerName(player);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int elder_robe_exchange_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Welcome back %TU, your robe is looking ratty again.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: It is very special to me.
|
|
if (response == "s_14")
|
|
{
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I may just be able to get you a replacement, of course you would have to do me a favor in return.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I am listening.
|
|
boolean hasResponse0 = false;
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thank you.
|
|
boolean hasResponse1 = false;
|
|
if (elder_robe_exchange_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_19");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_34");
|
|
|
|
utils.setScriptVar (player, "conversation.elder_robe_exchange.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Again, how is this any concern of yours?
|
|
if (response == "s_38")
|
|
{
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I may just be able to get you a replacement, of course you would have to do me a favor in return.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I am listening.
|
|
boolean hasResponse0 = false;
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thank you.
|
|
boolean hasResponse1 = false;
|
|
if (elder_robe_exchange_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_19");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_34");
|
|
|
|
utils.setScriptVar (player, "conversation.elder_robe_exchange.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int elder_robe_exchange_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: That is an interesting robe, if I may say so myself.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How is that any concern of yours?
|
|
if (response == "s_10")
|
|
{
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Yours is looking a bit ratty...
|
|
string_id message = new string_id (c_stringFile, "s_12");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: It is very special to me.
|
|
boolean hasResponse0 = false;
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Again, how is this any concern of yours?
|
|
boolean hasResponse1 = false;
|
|
if (elder_robe_exchange_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_14");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_38");
|
|
|
|
utils.setScriptVar (player, "conversation.elder_robe_exchange.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't know what you are talking about.
|
|
if (response == "s_40")
|
|
{
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well that is too bad, isn't it?
|
|
string_id message = new string_id (c_stringFile, "s_42");
|
|
utils.removeScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int elder_robe_exchange_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yours is looking a bit ratty...
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: It is very special to me.
|
|
if (response == "s_14")
|
|
{
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I may just be able to get you a replacement, of course you would have to do me a favor in return.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I am listening.
|
|
boolean hasResponse0 = false;
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thank you.
|
|
boolean hasResponse1 = false;
|
|
if (elder_robe_exchange_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_19");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_34");
|
|
|
|
utils.setScriptVar (player, "conversation.elder_robe_exchange.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Again, how is this any concern of yours?
|
|
if (response == "s_38")
|
|
{
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I may just be able to get you a replacement, of course you would have to do me a favor in return.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I am listening.
|
|
boolean hasResponse0 = false;
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thank you.
|
|
boolean hasResponse1 = false;
|
|
if (elder_robe_exchange_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_19");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_34");
|
|
|
|
utils.setScriptVar (player, "conversation.elder_robe_exchange.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int elder_robe_exchange_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I may just be able to get you a replacement, of course you would have to do me a favor in return.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I am listening.
|
|
if (response == "s_19")
|
|
{
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: There are some...pieces I need collected. You will need to travel quite a bit to retrieve them all for me.
|
|
string_id message = new string_id (c_stringFile, "s_21");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Alright, I'm in.
|
|
boolean hasResponse0 = false;
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Sounds like too much work to me.
|
|
boolean hasResponse1 = false;
|
|
if (elder_robe_exchange_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_22");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_26");
|
|
|
|
utils.setScriptVar (player, "conversation.elder_robe_exchange.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No thank you.
|
|
if (response == "s_34")
|
|
{
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Suit yourself.
|
|
string_id message = new string_id (c_stringFile, "s_36");
|
|
utils.removeScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int elder_robe_exchange_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: There are some...pieces I need collected. You will need to travel quite a bit to retrieve them all for me.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Alright, I'm in.
|
|
if (response == "s_22")
|
|
{
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
elder_robe_exchange_action_grantRobeQuest (player, npc);
|
|
|
|
//-- NPC: I'll upload all of the relevant information to your datapad.
|
|
string_id message = new string_id (c_stringFile, "s_24");
|
|
utils.removeScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sounds like too much work to me.
|
|
if (response == "s_26")
|
|
{
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Suit yourself.
|
|
string_id message = new string_id (c_stringFile, "s_32");
|
|
utils.removeScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isTangible (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.elder_robe_exchange");
|
|
|
|
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.elder_robe_exchange");
|
|
|
|
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 (elder_robe_exchange_condition_completeRobeQuest (player, npc))
|
|
{
|
|
//-- NPC: Welcome back %TU, your robe is looking ratty again.
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: It is very special to me.
|
|
boolean hasResponse0 = false;
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Again, how is this any concern of yours?
|
|
boolean hasResponse1 = false;
|
|
if (elder_robe_exchange_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_14");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_38");
|
|
|
|
utils.setScriptVar (player, "conversation.elder_robe_exchange.branchId", 6);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
npcStartConversation (player, npc, "elder_robe_exchange", 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 (elder_robe_exchange_condition_hasGivenRobe (player, npc))
|
|
{
|
|
elder_robe_exchange_action_sendSignalComplete (player, npc);
|
|
|
|
//-- NPC: Here you go %TU, I hope you enjoy your new robe!
|
|
string_id message = new string_id (c_stringFile, "s_31");
|
|
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 (elder_robe_exchange_condition_turnInRobeQuest (player, npc))
|
|
{
|
|
//-- NPC: It is good to see that you have returned safe, %TU. I see that you have brought what I asked for. Now just give me your robe and I will have a new one for you momentarily.
|
|
string_id message = new string_id (c_stringFile, "s_27");
|
|
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 (elder_robe_exchange_condition_isOnRobeQuest (player, npc))
|
|
{
|
|
//-- NPC: You need to bring me those items I asked for, before I will help you.
|
|
string_id message = new string_id (c_stringFile, "s_29");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition_hasElderRobe (player, npc))
|
|
{
|
|
doAnimationAction (npc, "beckon");
|
|
|
|
//-- NPC: That is an interesting robe, if I may say so myself.
|
|
string_id message = new string_id (c_stringFile, "s_8");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How is that any concern of yours?
|
|
boolean hasResponse0 = false;
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I don't know what you are talking about.
|
|
boolean hasResponse1 = false;
|
|
if (elder_robe_exchange_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_10");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_40");
|
|
|
|
utils.setScriptVar (player, "conversation.elder_robe_exchange.branchId", 5);
|
|
|
|
npcStartConversation (player, npc, "elder_robe_exchange", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (elder_robe_exchange_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Greetings.
|
|
string_id message = new string_id (c_stringFile, "s_44");
|
|
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 != "elder_robe_exchange")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
if (branchId == 1 && elder_robe_exchange_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && elder_robe_exchange_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && elder_robe_exchange_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && elder_robe_exchange_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && elder_robe_exchange_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.elder_robe_exchange.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|