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

982 lines
28 KiB
Plaintext

// ======================================================================
//
// lf_killmite.script
//
//
//
// Created with SwgConversationEditor 1.29 - 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/lf_killmite";
// ======================================================================
// Script Conditions
// ======================================================================
boolean lf_killmite_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean lf_killmite_condition_ifquestiscompleted (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/lf_deadmite");
boolean tasksCompleted = true;
tasksCompleted &= questIsTaskComplete(questId, 0, player);
tasksCompleted &= questIsTaskComplete(questId, 1, player);
tasksCompleted &= questIsTaskComplete(questId, 2, player);
tasksCompleted &= questIsTaskComplete(questId, 3, player);
tasksCompleted &= questIsTaskComplete(questId, 4, player);
tasksCompleted &= questIsTaskComplete(questId, 5, player);
return tasksCompleted;
}
// ----------------------------------------------------------------------
boolean lf_killmite_condition_ifquestinprogress (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/lf_deadmite");
return questIsQuestActive(questId, player);
}
// ----------------------------------------------------------------------
boolean lf_killmite_condition_questtaken (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/lf_deadmite");
return questIsQuestActive(questId, player) || questIsQuestComplete(questId, player);
}
// ----------------------------------------------------------------------
boolean lf_killmite_condition_questrewarded (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/lf_deadmite");
return questIsQuestComplete(questId, player);
}
// ======================================================================
// Script Actions
// ======================================================================
void lf_killmite_action_givequest (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/lf_deadmite");
groundquests.grantQuest(questId, player, npc, true);
obj_id top=getTopMostContainer(player);
location loc = getLocation(top);
loc.x = 3572;
loc.y = 91;
loc.z = 5424;
obj_id waypoint = createWaypointInDatapad(player, loc);
setObjVar(player, "quest.general.quest/lf_deadmite.waypoint", waypoint);
setWaypointName(waypoint, "Giant Mite Cave");
setWaypointActive(waypoint, true);
obj_id top1=getTopMostContainer(player);
location loc1 = getLocation(top1);
loc1.x = 5335;
loc1.y = 80;
loc1.z = 5637;
obj_id waypoint1 = createWaypointInDatapad(player, loc1);
setObjVar(player, "quest.general.quest/lf_deadmite.questgiver", waypoint1);
setWaypointName(waypoint1, "Risha Sinan");
}
// ----------------------------------------------------------------------
void lf_killmite_action_faceplayer (obj_id player, obj_id npc)
{
faceTo(npc, player);
}
// ----------------------------------------------------------------------
void lf_killmite_action_giverewardcraft (obj_id player, obj_id npc)
{
obj_id waypoint = getObjIdObjVar(player, "quest.general.quest/lf_deadmite.waypoint");
if (waypoint != null)
{
destroyWaypointInDatapad(waypoint, player);
}
removeObjVar(player, "quest.general.quest/lf_deadmite.waypoint");
obj_id waypoint1 = getObjIdObjVar(player, "quest.general.quest/lf_deadmite.questgiver");
if (waypoint1 != null)
{
destroyWaypointInDatapad(waypoint1, player);
}
removeObjVar(player, "quest.general.quest/lf_deadmite.questgiver");
int questId = questGetQuestId("quest/lf_deadmite");
questCompleteTask(questId, 6, player);
obj_id playerInventory = utils.getInventoryContainer( player );
string templateName = "object/tangible/loot/loot_schematic/bubble_tank_schematic.iff";
createObject( templateName, playerInventory, "" );
}
// ----------------------------------------------------------------------
void lf_killmite_action_giverewardcombat (obj_id player, obj_id npc)
{
obj_id waypoint = getObjIdObjVar(player, "quest.general.quest/lf_deadmite.waypoint");
if (waypoint != null)
{
destroyWaypointInDatapad(waypoint, player);
}
removeObjVar(player, "quest.general.quest/lf_deadmite.waypoint");
obj_id waypoint1 = getObjIdObjVar(player, "quest.general.quest/lf_deadmite.questgiver");
if (waypoint1 != null)
{
destroyWaypointInDatapad(waypoint1, player);
}
removeObjVar(player, "quest.general.quest/lf_deadmite.questgiver");
int questId = questGetQuestId("quest/lf_deadmite");
questCompleteTask(questId, 6, player);
obj_id playerInventory = utils.getInventoryContainer( player );
string templateName = "object/tangible/skill_buff/skill_buff_pistol_accuracy.iff";
createObject( templateName, playerInventory, "" );
}
// ----------------------------------------------------------------------
void lf_killmite_action_givewaypoint (obj_id player, obj_id npc)
{
obj_id waypoint = getObjIdObjVar(player, "quest.general.quest/lf_deadmite.waypoint");
if (waypoint != null)
{
destroyWaypointInDatapad(waypoint, player); // Always use this function. Unless something has changed.
}
obj_id top=getTopMostContainer(player);
location loc = getLocation(top);
loc.x = 3572;
loc.y = 91;
loc.z = 5424;
waypoint = createWaypointInDatapad(player, loc);
setObjVar(player, "quest.general.quest/lf_deadmite.waypoint", waypoint);
setWaypointName(waypoint, "Giant Mite Cave");
setWaypointActive(waypoint, true);
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int lf_killmite_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hello! Sorry to bother you, but do you have some time to check out a mite nest?
//-- [RESPONSE NOTE]
//-- PLAYER: I suppose I have the time.
if (response == "s_161")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
//-- NPC: Thank you. To the west is a giant bark mite cave. I can show you where. I need specimens. Once you get there, I'll transmit the specimens that I need and how many of each.
string_id message = new string_id (c_stringFile, "s_164");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would be happy to help you out.
boolean hasResponse0 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: And I'll get paid for this, I assume?
boolean hasResponse1 = false;
if (lf_killmite_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_167");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_172");
utils.setScriptVar (player, "conversation.lf_killmite.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Not right now.
if (response == "s_177")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
//-- NPC: That's a shame. Come back to me if you change your mind.
string_id message = new string_id (c_stringFile, "s_180");
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Maybe. Would you tell me more about it?
if (response == "s_183")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
//-- NPC: Bark mites! Fascinating little creatures, but they absolutely destroy the greenery! I recently found a mutant variant that may yield information that may lead to a chemical that will repel these insects.
string_id message = new string_id (c_stringFile, "s_185");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I suppose I have the time.
boolean hasResponse0 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Not right now.
boolean hasResponse1 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Maybe. Would you tell me more about it?
boolean hasResponse2 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_161");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_177");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_183");
utils.setScriptVar (player, "conversation.lf_killmite.branchId", 1);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int lf_killmite_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Thank you. To the west is a giant bark mite cave. I can show you where. I need specimens. Once you get there, I'll transmit the specimens that I need and how many of each.
//-- [RESPONSE NOTE]
//-- PLAYER: I would be happy to help you out.
if (response == "s_167")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
lf_killmite_action_givequest (player, npc);
//-- NPC: Excellent. I am glad to see that someone supports science around here. I'll transfer credits into your bank account as I get usable readings. Hopefully I can get my hands on something extra special by the time you get back.
string_id message = new string_id (c_stringFile, "s_169");
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: And I'll get paid for this, I assume?
if (response == "s_172")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
lf_killmite_action_givequest (player, npc);
//-- NPC: Of course. I cannot expect others to love science the way I do. I'll transfer credits into your bank account as I get usable readings. Perhaps I will get my hands on something extra special by the time you get back.
string_id message = new string_id (c_stringFile, "s_175");
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int lf_killmite_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Bark mites! Fascinating little creatures, but they absolutely destroy the greenery! I recently found a mutant variant that may yield information that may lead to a chemical that will repel these insects.
//-- [RESPONSE NOTE]
//-- PLAYER: I suppose I have the time.
if (response == "s_161")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
//-- NPC: Thank you. To the west is a giant bark mite cave. I can show you where. I need specimens. Once you get there, I'll transmit the specimens that I need and how many of each.
string_id message = new string_id (c_stringFile, "s_164");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would be happy to help you out.
boolean hasResponse0 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: And I'll get paid for this, I assume?
boolean hasResponse1 = false;
if (lf_killmite_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_167");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_172");
utils.setScriptVar (player, "conversation.lf_killmite.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Not right now.
if (response == "s_177")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
//-- NPC: That's a shame. Come back to me if you change your mind.
string_id message = new string_id (c_stringFile, "s_180");
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Maybe. Would you tell me more about it?
if (response == "s_183")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
//-- NPC: Bark mites! Fascinating little creatures, but they absolutely destroy the greenery! I recently found a mutant variant that may yield information that may lead to a chemical that will repel these insects.
string_id message = new string_id (c_stringFile, "s_185");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I suppose I have the time.
boolean hasResponse0 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Not right now.
boolean hasResponse1 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Maybe. Would you tell me more about it?
boolean hasResponse2 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_161");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_177");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_183");
utils.setScriptVar (player, "conversation.lf_killmite.branchId", 1);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int lf_killmite_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: How did you fare?
//-- [RESPONSE NOTE]
//-- PLAYER: I got all the samples that you wanted. Didn't you get my data transfers?
if (response == "s_191")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
//-- NPC: Oh goodness. Of course I did. I'm a little scatterbrained these days. Fantastic work. Are you interested in science and engineering?
string_id message = new string_id (c_stringFile, "s_193");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes! I love creating things.
boolean hasResponse0 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Actually, I prefer hunting.
boolean hasResponse1 = false;
if (lf_killmite_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_196");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_201");
utils.setScriptVar (player, "conversation.lf_killmite.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I'm not done yet.
if (response == "s_207")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
//-- NPC: Of course not. I should know that by my notes. Good luck with the rest of your hunting!
string_id message = new string_id (c_stringFile, "s_209");
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I got lost. Do you have the location of the cave?
if (response == "s_212")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
//-- NPC: Certainly! I know what you mean. If I don't keep things perfectly organized, I can't find a darn thing.
string_id message = new string_id (c_stringFile, "s_215");
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int lf_killmite_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Oh goodness. Of course I did. I'm a little scatterbrained these days. Fantastic work. Are you interested in science and engineering?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes! I love creating things.
if (response == "s_196")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
lf_killmite_action_giverewardcraft (player, npc);
//-- NPC: Wonderful! I have this schematic for you then. I'm not sure if it's your particular field, but it should be worth something.
string_id message = new string_id (c_stringFile, "s_199");
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Actually, I prefer hunting.
if (response == "s_201")
{
//-- [NOTE]
if (lf_killmite_condition__defaultCondition (player, npc))
{
lf_killmite_action_giverewardcombat (player, npc);
//-- NPC: Well, we all have our paths to walk, don't we? This should help you out while you hunt!
string_id message = new string_id (c_stringFile, "s_204");
utils.removeScriptVar (player, "conversation.lf_killmite.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.lf_killmite");
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
setName (self, "Risha Sinan");
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
setName (self, "Risha Sinan");
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
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.lf_killmite");
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 (!lf_killmite_condition_questtaken (player, npc))
{
lf_killmite_action_faceplayer (player, npc);
//-- NPC: Hello! Sorry to bother you, but do you have some time to check out a mite nest?
string_id message = new string_id (c_stringFile, "s_159");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I suppose I have the time.
boolean hasResponse0 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Not right now.
boolean hasResponse1 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Maybe. Would you tell me more about it?
boolean hasResponse2 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_161");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_177");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_183");
utils.setScriptVar (player, "conversation.lf_killmite.branchId", 1);
npcStartConversation (player, npc, "lf_killmite", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (lf_killmite_condition_ifquestinprogress (player, npc))
{
lf_killmite_action_faceplayer (player, npc);
//-- NPC: How did you fare?
string_id message = new string_id (c_stringFile, "s_188");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I got all the samples that you wanted. Didn't you get my data transfers?
boolean hasResponse0 = false;
if (lf_killmite_condition_ifquestiscompleted (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm not done yet.
boolean hasResponse1 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I got lost. Do you have the location of the cave?
boolean hasResponse2 = false;
if (lf_killmite_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_191");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_207");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_212");
utils.setScriptVar (player, "conversation.lf_killmite.branchId", 7);
npcStartConversation (player, npc, "lf_killmite", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (lf_killmite_condition_questrewarded (player, npc))
{
lf_killmite_action_faceplayer (player, npc);
//-- NPC: Hello! It's good to see you again.
string_id message = new string_id (c_stringFile, "s_217");
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 != "lf_killmite")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.lf_killmite.branchId");
if (branchId == 1 && lf_killmite_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && lf_killmite_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && lf_killmite_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && lf_killmite_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && lf_killmite_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.lf_killmite.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================