mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
1867 lines
52 KiB
Plaintext
1867 lines
52 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// npe_artisan_questgiver.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// Created with SwgConversationEditor 1.34 - 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/npe_artisan_questgiver";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean npe_artisan_questgiver_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_artisan_questgiver_condition_playerOnFirstQuest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActive(player, "npe_artisan_1");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_artisan_questgiver_condition_playerOnFirstQuestRewardStep (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "npe_artisan_1", "returnSignal");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_artisan_questgiver_condition_playerFinishedFirstQuest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "npe_artisan_1");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_artisan_questgiver_condition_playeronSecondQuest (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.isQuestActive(player, "npe_artisan_2a")||groundquests.isQuestActive(player, "npe_artisan_2b"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_artisan_questgiver_condition_playerCompletedSecondQuest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "npe_artisan_2b");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_artisan_questgiver_condition_playerfailed2b (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "npe_artisan_2a")&&!groundquests.isQuestActive(player, "npe_artisan_2b"));
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void npe_artisan_questgiver_action_facePlayer (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_artisan_questgiver_action_givePlayerArtisan1 (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "npe_artisan_1");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_artisan_questgiver_action_givePlayerArtisan2a (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "npe_artisan_2a");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_artisan_questgiver_action_givePlayerArtisan2b (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "npe_artisan_2b");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_artisan_questgiver_action_SignalQ1Reward (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "npe_artisan_1_reward");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_artisan_questgiver_action_SignalQ2bReward (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "npe_artisan_2b_reward");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int npe_artisan_questgiver_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Hello again, %TU. We have a very serious problem and desperately need your help.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Can you tell me more?
|
|
if (response == "s_29")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Yes, quickly. The station is under attack and the shields are failing. They are failing RIGHT NOW!
|
|
string_id message = new string_id (c_stringFile, "s_33");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What can I do?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: That's it. I'm out of here.
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_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_34");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_35");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll do it!
|
|
if (response == "s_30")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: The droid needs a part. I have a schematic for you. Get the parts you need in the armory again.
|
|
string_id message = new string_id (c_stringFile, "s_37");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will.
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_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_38");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Find someone else. I can't do it right now.
|
|
if (response == "s_31")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I hope that 'someone else' will be more cooperative than you are.
|
|
string_id message = new string_id (c_stringFile, "s_32");
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yes, quickly. The station is under attack and the shields are failing. They are failing RIGHT NOW!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What can I do?
|
|
if (response == "s_34")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: The droid needs a part. I have a schematic for you. Get the parts you need in the armory again.
|
|
string_id message = new string_id (c_stringFile, "s_37");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will.
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_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_38");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: That's it. I'm out of here.
|
|
if (response == "s_35")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Selfish people like you are ruining the galaxy.
|
|
string_id message = new string_id (c_stringFile, "s_36");
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: The droid needs a part. I have a schematic for you. Get the parts you need in the armory again.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will.
|
|
if (response == "s_38")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_artisan_questgiver_action_givePlayerArtisan2a (player, npc);
|
|
|
|
//-- NPC: Go now! There isn't much time left!
|
|
string_id message = new string_id (c_stringFile, "s_39");
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Have you finished?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes. The droids are installing the pieces now.
|
|
if (response == "s_22")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_artisan_questgiver_action_SignalQ1Reward (player, npc);
|
|
|
|
//-- NPC: Wonderful! Thank you for your help. Please accept this as a reward.
|
|
string_id message = new string_id (c_stringFile, "s_23");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thank you.
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_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.npe_artisan_questgiver.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm not done yet.
|
|
if (response == "s_25")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Is there something that I can help you with?
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How do I get the parts that I need?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Once I have the parts, how do I make the armor?
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm all set.
|
|
boolean hasResponse2 = false;
|
|
if (npe_artisan_questgiver_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_41");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_42");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_43");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Wonderful! Thank you for your help. Please accept this as a reward.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thank you.
|
|
if (response == "s_24")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: If you need more work, just let me know.
|
|
string_id message = new string_id (c_stringFile, "s_27");
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Is there something that I can help you with?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How do I get the parts that I need?
|
|
if (response == "s_41")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Go over to the armory. I've left a set of waypoints for the objects that you need. All you need to do is select the objects you need and choose to pick them up.
|
|
string_id message = new string_id (c_stringFile, "s_44");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How do I get the parts that I need?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Once I have the parts, how do I make the armor?
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm all set.
|
|
boolean hasResponse2 = false;
|
|
if (npe_artisan_questgiver_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_41");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_42");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_43");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Once I have the parts, how do I make the armor?
|
|
if (response == "s_42")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: First, use the schematic. Then open your generic crafting tool. You will find the option in the Miscellaneous section. Select the Reinforced Armor piece and you will see what you need.
|
|
string_id message = new string_id (c_stringFile, "s_45");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Ok. What next?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_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.npe_artisan_questgiver.branchId", 13);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm all set.
|
|
if (response == "s_43")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Great. Get to work!
|
|
string_id message = new string_id (c_stringFile, "s_48");
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Go over to the armory. I've left a set of waypoints for the objects that you need. All you need to do is select the objects you need and choose to pick them up.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How do I get the parts that I need?
|
|
if (response == "s_41")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Go over to the armory. I've left a set of waypoints for the objects that you need. All you need to do is select the objects you need and choose to pick them up.
|
|
string_id message = new string_id (c_stringFile, "s_44");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How do I get the parts that I need?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Once I have the parts, how do I make the armor?
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm all set.
|
|
boolean hasResponse2 = false;
|
|
if (npe_artisan_questgiver_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_41");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_42");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_43");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Once I have the parts, how do I make the armor?
|
|
if (response == "s_42")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: First, use the schematic. Then open your generic crafting tool. You will find the option in the Miscellaneous section. Select the Reinforced Armor piece and you will see what you need.
|
|
string_id message = new string_id (c_stringFile, "s_45");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Ok. What next?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_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.npe_artisan_questgiver.branchId", 13);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm all set.
|
|
if (response == "s_43")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Great. Get to work!
|
|
string_id message = new string_id (c_stringFile, "s_48");
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch13 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: First, use the schematic. Then open your generic crafting tool. You will find the option in the Miscellaneous section. Select the Reinforced Armor piece and you will see what you need.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Ok. What next?
|
|
if (response == "s_46")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Next, you will have an chance to pull items from your inventory into the tool. It will show you what is needed and what has been filled. Once your get the item that you need, create the item.
|
|
string_id message = new string_id (c_stringFile, "s_47");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How do I get the parts that I need?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Once I have the parts, how do I make the armor?
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm all set.
|
|
boolean hasResponse2 = false;
|
|
if (npe_artisan_questgiver_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_41");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_42");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_43");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch14 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Next, you will have an chance to pull items from your inventory into the tool. It will show you what is needed and what has been filled. Once your get the item that you need, create the item.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How do I get the parts that I need?
|
|
if (response == "s_41")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Go over to the armory. I've left a set of waypoints for the objects that you need. All you need to do is select the objects you need and choose to pick them up.
|
|
string_id message = new string_id (c_stringFile, "s_44");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How do I get the parts that I need?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Once I have the parts, how do I make the armor?
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm all set.
|
|
boolean hasResponse2 = false;
|
|
if (npe_artisan_questgiver_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_41");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_42");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_43");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Once I have the parts, how do I make the armor?
|
|
if (response == "s_42")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: First, use the schematic. Then open your generic crafting tool. You will find the option in the Miscellaneous section. Select the Reinforced Armor piece and you will see what you need.
|
|
string_id message = new string_id (c_stringFile, "s_45");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Ok. What next?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_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.npe_artisan_questgiver.branchId", 13);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm all set.
|
|
if (response == "s_43")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Great. Get to work!
|
|
string_id message = new string_id (c_stringFile, "s_48");
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch16 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Hey, you there, I need your help.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What can I do?
|
|
if (response == "s_4")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You won't believe this, but a hole...a HOLE was punched in the station's armor. It has been patched, of course, but we need real reinforcement.
|
|
string_id message = new string_id (c_stringFile, "s_9");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How did it happen?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'll do whatever you need.
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_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_11");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 17);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I am not 'you there'.
|
|
if (response == "s_6")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Fine. %TU I need your help.
|
|
string_id message = new string_id (c_stringFile, "s_7");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thank you. What can I do to help?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_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_8");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 23);
|
|
|
|
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.npe_artisan_questgiver.branchId");
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
chat.chat (npc, player, pp);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch17 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You won't believe this, but a hole...a HOLE was punched in the station's armor. It has been patched, of course, but we need real reinforcement.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How did it happen?
|
|
if (response == "s_10")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well, I have to assume that you know that we're being attacked, but you may not have known that a small group of pirates went into the lower holds to look for something. They got into a blaster fight with the guards.
|
|
string_id message = new string_id (c_stringFile, "s_12");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: A blaster shouldn't affect the station's armor plating.
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_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_13");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 18);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll do whatever you need.
|
|
if (response == "s_11")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Great. There are stockpiles of the items needed to make the station armor in the armory. Get the items that you need and make 3 armor pieces. Then take the pieces to [npc name], the engineer that is fixing the station.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll go now!
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_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_19");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 21);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch18 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well, I have to assume that you know that we're being attacked, but you may not have known that a small group of pirates went into the lower holds to look for something. They got into a blaster fight with the guards.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: A blaster shouldn't affect the station's armor plating.
|
|
if (response == "s_13")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: A disruptor rifle will. That's enough talk about it though... the station is in trouble and I need you to help fix it!
|
|
string_id message = new string_id (c_stringFile, "s_14");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll do it!
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thanks. I don't go near space vacuums.
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_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_15");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_16");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 19);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch19 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: A disruptor rifle will. That's enough talk about it though... the station is in trouble and I need you to help fix it!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll do it!
|
|
if (response == "s_15")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Great. There are stockpiles of the items needed to make the station armor in the armory. Get the items that you need and make 3 armor pieces. Then take the pieces to [npc name], the engineer that is fixing the station.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll go now!
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_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_19");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 21);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No thanks. I don't go near space vacuums.
|
|
if (response == "s_16")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Ok, but if no one goes to help, enjoy breathing while it lasts.
|
|
string_id message = new string_id (c_stringFile, "s_17");
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch21 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Great. There are stockpiles of the items needed to make the station armor in the armory. Get the items that you need and make 3 armor pieces. Then take the pieces to [npc name], the engineer that is fixing the station.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll go now!
|
|
if (response == "s_19")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_artisan_questgiver_action_givePlayerArtisan1 (player, npc);
|
|
|
|
//-- NPC: Thank you. Return to me when you are done.
|
|
string_id message = new string_id (c_stringFile, "s_20");
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_artisan_questgiver_handleBranch23 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Fine. %TU I need your help.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thank you. What can I do to help?
|
|
if (response == "s_8")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You won't believe this, but a hole...a HOLE was punched in the station's armor. It has been patched, of course, but we need real reinforcement.
|
|
string_id message = new string_id (c_stringFile, "s_9");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How did it happen?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'll do whatever you need.
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_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_11");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 17);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.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.npe_artisan_questgiver");
|
|
|
|
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.npe_artisan_questgiver");
|
|
|
|
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 (npe_artisan_questgiver_condition_playeronSecondQuest (player, npc))
|
|
{
|
|
//-- NPC: Don't talk to me anymore. Go help fix the generator!
|
|
string_id message = new string_id (c_stringFile, "s_40");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition_playerFinishedFirstQuest (player, npc))
|
|
{
|
|
//-- NPC: Hello again, %TU. We have a very serious problem and desperately need your help.
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Can you tell me more?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'll do it!
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: Find someone else. I can't do it right now.
|
|
boolean hasResponse2 = false;
|
|
if (npe_artisan_questgiver_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_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_30");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_31");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 2);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
npcStartConversation (player, npc, "npe_artisan_questgiver", 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 (npe_artisan_questgiver_condition_playerOnFirstQuest (player, npc))
|
|
{
|
|
//-- NPC: Have you finished?
|
|
string_id message = new string_id (c_stringFile, "s_21");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes. The droids are installing the pieces now.
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition_playerOnFirstQuestRewardStep (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm not done yet.
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_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_25");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 8);
|
|
|
|
npcStartConversation (player, npc, "npe_artisan_questgiver", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Hey, you there, I need your help.
|
|
string_id message = new string_id (c_stringFile, "s_3");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What can I do?
|
|
boolean hasResponse0 = false;
|
|
if (npe_artisan_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I am not 'you there'.
|
|
boolean hasResponse1 = false;
|
|
if (npe_artisan_questgiver_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_4");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_6");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_artisan_questgiver.branchId", 16);
|
|
|
|
npcStartConversation (player, npc, "npe_artisan_questgiver", message, responses);
|
|
}
|
|
else
|
|
{
|
|
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 != "npe_artisan_questgiver")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
if (branchId == 2 && npe_artisan_questgiver_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && npe_artisan_questgiver_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && npe_artisan_questgiver_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && npe_artisan_questgiver_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && npe_artisan_questgiver_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && npe_artisan_questgiver_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && npe_artisan_questgiver_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 13 && npe_artisan_questgiver_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 14 && npe_artisan_questgiver_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 16 && npe_artisan_questgiver_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 17 && npe_artisan_questgiver_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 18 && npe_artisan_questgiver_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 19 && npe_artisan_questgiver_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 21 && npe_artisan_questgiver_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 23 && npe_artisan_questgiver_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.npe_artisan_questgiver.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|