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

1087 lines
30 KiB
Plaintext

// ======================================================================
//
// lifeday_vendor.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.buff;
include library.chat;
include library.conversation;
include library.groundquests;
include library.holiday;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/lifeday_vendor";
// ======================================================================
// Script Conditions
// ======================================================================
boolean lifeday_vendor_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean lifeday_vendor_condition_questNotCompleted (obj_id player, obj_id npc)
{
if (groundquests.hasCompletedQuest(player, "lifeday_stap_1"))
return false;
if (groundquests.isQuestActive(player, "lifeday_stap_1"))
return false;
return true;
}
// ----------------------------------------------------------------------
boolean lifeday_vendor_condition_questReturned (obj_id player, obj_id npc)
{
if ( groundquests.isTaskActive(player, "lifeday_stap_1", "talkSaun_needsStap") )
return true;
if ( groundquests.isTaskActive(player, "lifeday_stap_1", "talkSaun_hasStap") )
return true;
return false;
}
// ----------------------------------------------------------------------
boolean lifeday_vendor_condition_questCompleted (obj_id player, obj_id npc)
{
if (groundquests.hasCompletedQuest(player, "lifeday_stap_1"))
return true;
return false;
}
// ======================================================================
// Script Actions
// ======================================================================
void lifeday_vendor_action_showTokenVendorUI (obj_id player, obj_id npc)
{
dictionary d = new dictionary();
d.put("player", player);
messageTo(npc, "showInventorySUI", d, 0, false);
return;
}
// ----------------------------------------------------------------------
void lifeday_vendor_action_giveQuest (obj_id player, obj_id npc)
{
if ( groundquests.hasCompletedQuest(player, "lifeday_stap_1") )
{
groundquests.clearQuest(player, "lifeday_stap_1");
}
groundquests.grantQuest(player, "lifeday_stap_1");
}
// ----------------------------------------------------------------------
void lifeday_vendor_action_finishQuest (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "talkedSaun");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int lifeday_vendor_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Great to see you %TU! Any luck finding the missing candy?
//-- [RESPONSE NOTE]
//-- PLAYER: I'm afraid it was stolen and eaten Saun.
if (response == "s_15")
{
doAnimationAction (player, "slump_head");
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shake_head_disgust");
//-- NPC: Oh no, that's terrible! Who would do such a thing?
string_id message = new string_id (c_stringFile, "s_17");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I promised I wouldn't say but he's paid the price for his crime.
boolean hasResponse0 = false;
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: A slob of a Stormtrooper with no shame!
boolean hasResponse1 = false;
if (lifeday_vendor_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_18");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_19");
utils.setScriptVar (player, "conversation.lifeday_vendor.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.lifeday_vendor.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int lifeday_vendor_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Oh no, that's terrible! Who would do such a thing?
//-- [RESPONSE NOTE]
//-- PLAYER: I promised I wouldn't say but he's paid the price for his crime.
if (response == "s_18")
{
doAnimationAction (player, "shake_head_no");
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
lifeday_vendor_action_finishQuest (player, npc);
//-- NPC: I see, well then I will respect that and investigate no further. I will find another gift for the children out of my supplies that will hopefully be as appreciated. I want to thank you for your help anyway %TU and wish you a happy Life Day.
string_id message = new string_id (c_stringFile, "s_20");
utils.removeScriptVar (player, "conversation.lifeday_vendor.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: A slob of a Stormtrooper with no shame!
if (response == "s_19")
{
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
doAnimationAction (player, "pound_fist_palm");
//-- NPC: A Stormtrooper? They're even worse than I thought!
string_id message = new string_id (c_stringFile, "s_21");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I agree. I made him pay for his crime at least.
boolean hasResponse0 = false;
if (lifeday_vendor_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_22");
utils.setScriptVar (player, "conversation.lifeday_vendor.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.lifeday_vendor.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int lifeday_vendor_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: A Stormtrooper? They're even worse than I thought!
//-- [RESPONSE NOTE]
//-- PLAYER: I agree. I made him pay for his crime at least.
if (response == "s_22")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
lifeday_vendor_action_finishQuest (player, npc);
//-- NPC: I don't want to hear any details but I'm glad to hear that. I will find another gift for the children out of my supplies, that will hopefully be as appreciated. I want to thank you for your help anyway %TU and wish you a happy Life Day.
string_id message = new string_id (c_stringFile, "s_23");
utils.removeScriptVar (player, "conversation.lifeday_vendor.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 lifeday_vendor_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Happy Life Day %TU! Would you perhaps be interested in helping me again?
//-- [RESPONSE NOTE]
//-- PLAYER: What can I do for you?
if (response == "s_42")
{
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
//-- NPC: I ordered more cases of delicious Life Day candy from Keren on Naboo but once again they seem to have been delayed. I'm worried something might have happened.
string_id message = new string_id (c_stringFile, "s_44");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: It was probably the same person that took them the first time.
boolean hasResponse0 = false;
if (lifeday_vendor_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_46");
utils.setScriptVar (player, "conversation.lifeday_vendor.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.lifeday_vendor.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I can't right now, I wanted to see what you were selling?
if (response == "s_43")
{
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
lifeday_vendor_action_showTokenVendorUI (player, npc);
//-- NPC: Of course, no problem.
string_id message = new string_id (c_stringFile, "s_45");
utils.removeScriptVar (player, "conversation.lifeday_vendor.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int lifeday_vendor_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I ordered more cases of delicious Life Day candy from Keren on Naboo but once again they seem to have been delayed. I'm worried something might have happened.
//-- [RESPONSE NOTE]
//-- PLAYER: It was probably the same person that took them the first time.
if (response == "s_46")
{
doAnimationAction (player, "shake_head_disgust");
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "rub_chin_thoughtful");
//-- NPC: You may be right. But all the same, I think you should start in Keren and investigate from there.
string_id message = new string_id (c_stringFile, "s_47");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: But I suspect I already know where that trail will lead.
boolean hasResponse0 = false;
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Okay, I'll start in Keren once again.
boolean hasResponse1 = false;
if (lifeday_vendor_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_48");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_49");
utils.setScriptVar (player, "conversation.lifeday_vendor.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.lifeday_vendor.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int lifeday_vendor_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You may be right. But all the same, I think you should start in Keren and investigate from there.
//-- [RESPONSE NOTE]
//-- PLAYER: But I suspect I already know where that trail will lead.
if (response == "s_48")
{
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
//-- NPC: And I suspect that if you were to go and immediately confront that person, all he would say is 'Can't you see I'm busy? Move along.' And nothing more. So, as in all things, it is best if we start at the beginning.
string_id message = new string_id (c_stringFile, "s_50");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Very well. I'll start at the beginning.
boolean hasResponse0 = false;
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: This is just silly. I think I'll go do something else.
boolean hasResponse1 = false;
if (lifeday_vendor_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_52");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_53");
utils.setScriptVar (player, "conversation.lifeday_vendor.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.lifeday_vendor.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Okay, I'll start in Keren once again.
if (response == "s_49")
{
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "clap_rousing");
lifeday_vendor_action_giveQuest (player, npc);
//-- NPC: That's fantastic %TU! The candy was for the poor children of this town so I feel awful that I couldn't deliver. You should start by talking to the Shipping Master at the Keren starport. Good luck and happy Life Day %NU!
string_id message = new string_id (c_stringFile, "s_56");
utils.removeScriptVar (player, "conversation.lifeday_vendor.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 lifeday_vendor_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: And I suspect that if you were to go and immediately confront that person, all he would say is 'Can't you see I'm busy? Move along.' And nothing more. So, as in all things, it is best if we start at the beginning.
//-- [RESPONSE NOTE]
//-- PLAYER: Very well. I'll start at the beginning.
if (response == "s_52")
{
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "clap_rousing");
lifeday_vendor_action_giveQuest (player, npc);
//-- NPC: That's fantastic %TU! The candy was for the poor children of this town so I feel awful that I couldn't deliver. You should start by talking to the Shipping Master at the Keren starport. Good luck and happy Life Day %NU!
string_id message = new string_id (c_stringFile, "s_56");
utils.removeScriptVar (player, "conversation.lifeday_vendor.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: This is just silly. I think I'll go do something else.
if (response == "s_53")
{
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
//-- NPC: As you wish, %TU. Though if you ask me, life requires a certain amount of silliness. Have a wonderful Life Day.
string_id message = new string_id (c_stringFile, "s_54");
utils.removeScriptVar (player, "conversation.lifeday_vendor.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 lifeday_vendor_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Happy Life Day %TU! I hear you're good at solving problems and I have one I could use some help with. Would you perhaps be interested?
//-- [RESPONSE NOTE]
//-- PLAYER: What can I do for you?
if (response == "s_37")
{
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
//-- NPC: I ordered two cases of delicious Life Day candy from Keren on Naboo but they should have been here by now. I'm worried something might have happened.
string_id message = new string_id (c_stringFile, "s_39");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I can look in to it.
boolean hasResponse0 = false;
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm sorry, I can't go to Naboo right now.
boolean hasResponse1 = false;
if (lifeday_vendor_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_51");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_58");
utils.setScriptVar (player, "conversation.lifeday_vendor.branchId", 13);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.lifeday_vendor.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I can't right now, I wanted to see what you were selling?
if (response == "s_62")
{
doAnimationAction (player, "shake_head_no");
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
lifeday_vendor_action_showTokenVendorUI (player, npc);
//-- NPC: Of course, no problem.
string_id message = new string_id (c_stringFile, "s_64");
utils.removeScriptVar (player, "conversation.lifeday_vendor.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int lifeday_vendor_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I ordered two cases of delicious Life Day candy from Keren on Naboo but they should have been here by now. I'm worried something might have happened.
//-- [RESPONSE NOTE]
//-- PLAYER: I can look in to it.
if (response == "s_51")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "clap_rousing");
lifeday_vendor_action_giveQuest (player, npc);
//-- NPC: That's fantastic %TU! The candy was for the poor children of this town so I feel awful that I couldn't deliver. You should start by talking to the Shipping Master at the Keren starport. Good luck and happy Life Day %NU!
string_id message = new string_id (c_stringFile, "s_56");
utils.removeScriptVar (player, "conversation.lifeday_vendor.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I'm sorry, I can't go to Naboo right now.
if (response == "s_58")
{
doAnimationAction (player, "shake_head_no");
//-- [NOTE]
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
//-- NPC: I understand %TU, you're a busy person.
string_id message = new string_id (c_stringFile, "s_60");
utils.removeScriptVar (player, "conversation.lifeday_vendor.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;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.lifeday_vendor");
setCondition (self, CONDITION_CONVERSABLE);
setCondition(self, CONDITION_SPACE_INTERESTING);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition(self, CONDITION_SPACE_INTERESTING);
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.lifeday_vendor");
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 (lifeday_vendor_condition_questReturned (player, npc))
{
doAnimationAction (npc, "greet");
doAnimationAction (player, "greet");
//-- NPC: Great to see you %TU! Any luck finding the missing candy?
string_id message = new string_id (c_stringFile, "s_14");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm afraid it was stolen and eaten Saun.
boolean hasResponse0 = false;
if (lifeday_vendor_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_15");
utils.setScriptVar (player, "conversation.lifeday_vendor.branchId", 1);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "lifeday_vendor", 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 (lifeday_vendor_condition_questCompleted (player, npc))
{
doAnimationAction (npc, "greet");
doAnimationAction (player, "greet");
//-- NPC: Happy Life Day %TU! Would you perhaps be interested in helping me again?
string_id message = new string_id (c_stringFile, "s_41");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What can I do for you?
boolean hasResponse0 = false;
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I can't right now, I wanted to see what you were selling?
boolean hasResponse1 = false;
if (lifeday_vendor_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_42");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_43");
utils.setScriptVar (player, "conversation.lifeday_vendor.branchId", 6);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "lifeday_vendor", 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 (lifeday_vendor_condition_questNotCompleted (player, npc))
{
doAnimationAction (npc, "greet");
doAnimationAction (player, "greet");
//-- NPC: Happy Life Day %TU! I hear you're good at solving problems and I have one I could use some help with. Would you perhaps be interested?
string_id message = new string_id (c_stringFile, "s_35");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What can I do for you?
boolean hasResponse0 = false;
if (lifeday_vendor_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I can't right now, I wanted to see what you were selling?
boolean hasResponse1 = false;
if (lifeday_vendor_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_37");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_62");
utils.setScriptVar (player, "conversation.lifeday_vendor.branchId", 12);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "lifeday_vendor", 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 (lifeday_vendor_condition__defaultCondition (player, npc))
{
doAnimationAction (player, "greet");
lifeday_vendor_action_showTokenVendorUI (player, npc);
//-- NPC: Happy Life Day! Check out my holiday wares!
string_id message = new string_id (c_stringFile, "s_66");
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 != "lifeday_vendor")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.lifeday_vendor.branchId");
if (branchId == 1 && lifeday_vendor_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && lifeday_vendor_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && lifeday_vendor_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && lifeday_vendor_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && lifeday_vendor_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && lifeday_vendor_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && lifeday_vendor_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && lifeday_vendor_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && lifeday_vendor_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.lifeday_vendor.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================