mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
2151 lines
62 KiB
Plaintext
2151 lines
62 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// qtqc_phase_2.script
|
|
// Copyright 2003, Sony Online Entertainment
|
|
//
|
|
//
|
|
// DO NOT EDIT THIS AUTO-GENERATED FILE. PLEASE USE THE CONVERATION EDITOR!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.community_crafting;
|
|
include library.fs_dyn_village;
|
|
include library.fs_quests_cc;
|
|
include library.quests;
|
|
include library.sui;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/qtqc_phase_2";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean qtqc_phase_2_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean qtqc_phase_2_condition_isPlayerCommunityCrafting (obj_id player, obj_id npc)
|
|
{
|
|
obj_id craftingTracker = utils.getObjIdScriptVar(npc, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER);
|
|
if (isIdValid(craftingTracker))
|
|
{
|
|
if (community_crafting.isSessionActive(craftingTracker) &&
|
|
community_crafting.isPlayerCrafting(craftingTracker, player))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean qtqc_phase_2_condition_isCommunityCraftingEnabled (obj_id player, obj_id npc)
|
|
{
|
|
return fs_quests_cc.testCommunityCraftingEnabled (npc, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean qtqc_phase_2_condition_canAddPlayer (obj_id player, obj_id npc)
|
|
{
|
|
obj_id craftingTracker = utils.getObjIdScriptVar(npc, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER);
|
|
if (isIdValid(craftingTracker))
|
|
{
|
|
if (community_crafting.isSessionActive(craftingTracker) &&
|
|
community_crafting.getNumPlayersCrafting(craftingTracker) < community_crafting.MAX_PLAYERS_PER_PROJECT &&
|
|
!community_crafting.isPlayerCrafting(player))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean qtqc_phase_2_condition_isTrackingQuality (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getBooleanScriptVar(npc, fs_quests_cc.SCRIPTVAR_TRACKING_QUALITY);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean qtqc_phase_2_condition_isTrackingQuantity (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getBooleanScriptVar(npc, fs_quests_cc.SCRIPTVAR_TRACKING_QUANTITY);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean qtqc_phase_2_condition_isTrackingSlots (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getBooleanScriptVar(npc, fs_quests_cc.SCRIPTVAR_TRACKING_SLOTS);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean qtqc_phase_2_condition_playerNeedsSchematics (obj_id player, obj_id npc)
|
|
{
|
|
obj_id craftingTracker = utils.getObjIdScriptVar(npc, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER);
|
|
if (isIdValid(craftingTracker))
|
|
{
|
|
if (quests.isActive(quharek_phase_2.QUEST_STEP_01, player) &&
|
|
!community_crafting.isPlayerCrafting(craftingTracker, player))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean qtqc_phase_2_condition_needsOneMoreItem (obj_id player, obj_id npc)
|
|
{
|
|
return qtqc_phase_2_tokenDI_ingredientsNeeded(player, npc) == 1;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean qtqc_phase_2_condition_needsNoMoreItems (obj_id player, obj_id npc)
|
|
{
|
|
return qtqc_phase_2_tokenDI_ingredientsNeeded(player, npc) < 1;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean qtqc_phase_2_condition_needsMoreThanOneItem (obj_id player, obj_id npc)
|
|
{
|
|
return qtqc_phase_2_tokenDI_ingredientsNeeded(player, npc) > 1;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void qtqc_phase_2_action_addPlayerToProject (obj_id player, obj_id npc)
|
|
{
|
|
obj_id craftingTracker = utils.getObjIdScriptVar(npc, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER);
|
|
if (isIdValid(craftingTracker))
|
|
{
|
|
boolean result = community_crafting.grantSchematicToPlayer(craftingTracker, player);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_openMyInventoryToPlayer (obj_id player, obj_id npc)
|
|
{
|
|
obj_id inventory = utils.getInventoryContainer(npc);
|
|
if (isIdValid(inventory))
|
|
{
|
|
// set our inventory owner to null for a bit so the player can open it
|
|
if (queueCommand(player, ##"openContainer", inventory, "", COMMAND_PRIORITY_IMMEDIATE))
|
|
{
|
|
// start checking that the player hasn't moved away from us
|
|
dictionary params = new dictionary();
|
|
params.put("npc", npc);
|
|
messageTo(player, "handleViewingNpcInventory", params, 15, false);
|
|
}
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerSlot1Quality (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 1, true, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerProjectAttributes (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectAttribs(npc, player, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerSlot2Quality (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 2, true, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerSlot4Quality (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 4, true, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerSlot5Quality (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 5, true, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerProjectQuality (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 0, true, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerSlot3Quality (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 3, true, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerSlot1Quantity (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 1, false, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerSlot2Quantity (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 2, false, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerSlot4Quantity (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 4, false, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerSlot5Quantity (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 5, false, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerProjectQuantity (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 0, false, 2);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void qtqc_phase_2_action_showPlayerSlot3Quantity (obj_id player, obj_id npc)
|
|
{
|
|
fs_quests_cc.showPlayerProjectStats(npc, player, 3, false, 2);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
int qtqc_phase_2_tokenDI_ingredientsNeeded (obj_id player, obj_id npc)
|
|
{
|
|
obj_id craftingTracker = utils.getObjIdScriptVar(npc, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER);
|
|
if (isIdValid(craftingTracker))
|
|
{
|
|
return community_crafting.getNumIngredientsNeededByPlayer(craftingTracker, player);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
/*********************************************************************************/
|
|
// Constants
|
|
|
|
const string OBJVAR_LAST_PHASE = community_crafting.OBJVAR_COMMUNITY_CRAFTING_BASE + ".lastPhase";
|
|
|
|
const string SCRIPTVAR_MY_ID = "community_crafting.qtqc";
|
|
|
|
const string SCRIPT_INVENTORY = "systems.crafting.community_crafting.npc_inventory";
|
|
|
|
|
|
/*********************************************************************************/
|
|
// Triggers
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.qtqc_phase_2");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
initializeMe(self);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
initializeMe(self);
|
|
|
|
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.qtqc_phase_2");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|
|
/*********************************************************************************/
|
|
// Utility functions
|
|
|
|
void initializeMe (obj_id self)
|
|
{
|
|
setName(self, new string_id("npc_name", "qtqc"));
|
|
|
|
// make sure my inventory object has the script attached to it so that
|
|
// I can let players add ingredients to the project
|
|
obj_id inventory = utils.getInventoryContainer(self);
|
|
if (isIdValid(inventory))
|
|
{
|
|
if (!hasScript(inventory, SCRIPT_INVENTORY))
|
|
attachScript(inventory, SCRIPT_INVENTORY);
|
|
}
|
|
|
|
// see if we know about the master village object, and ask for it if we don't
|
|
if (!utils.hasScriptVar(self, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER))
|
|
{
|
|
requestVillageMaster(self);
|
|
}
|
|
else
|
|
{
|
|
if (initializeCraftingQuest(self))
|
|
cacheProjectData(self);
|
|
}
|
|
}
|
|
|
|
void requestVillageMaster(obj_id self)
|
|
{
|
|
if (!utils.hasScriptVar(self, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER))
|
|
{
|
|
messageTo(self, "handleRetryGetVillageManager", null, 60.0f, false);
|
|
fs_dyn_village.getRegisteredObjIdFromClusterWideData(
|
|
fs_dyn_village.CLUSTER_OBJID_KEY_MASTER, "handleGetVillageManager", self);
|
|
}
|
|
}
|
|
|
|
messageHandler handleGetVillageManager()
|
|
{
|
|
boolean rslt = false;
|
|
string key = "";
|
|
if (params.containsKey("key"))
|
|
{
|
|
key = params.getString("key");
|
|
}
|
|
|
|
if (params.containsKey("success"))
|
|
{
|
|
rslt = params.getBoolean("success");
|
|
}
|
|
|
|
if (rslt && key != null && key.length() > 0)
|
|
{
|
|
obj_id id = null;
|
|
if (params.containsKey(key))
|
|
{
|
|
id = params.getObjId(key);
|
|
if (isIdValid(id))
|
|
{
|
|
utils.setScriptVar(self, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER, id);
|
|
debugServerConsoleMsg(self, "Object key '" + key + "' was registered as " + id);
|
|
if (initializeCraftingQuest(self))
|
|
cacheProjectData(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
}
|
|
debugServerConsoleMsg(self, "Failed to find obj id '" + key + "' cluster wide data. Id might not have been registered yet.");
|
|
messageTo(self, "handleRetryGetVillageManager", null, 30, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler handleRetryGetVillageManager()
|
|
{
|
|
requestVillageMaster(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
boolean initializeCraftingQuest(obj_id self)
|
|
{
|
|
if (!utils.hasScriptVar(self, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER))
|
|
{
|
|
debugServerConsoleMsg(null, "WARNING: initializeCraftingQuest no crafting tracker");
|
|
return false;
|
|
}
|
|
obj_id villageId = utils.getObjIdScriptVar(self, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER);
|
|
if (!isIdValid(villageId))
|
|
{
|
|
debugServerConsoleMsg(null, "WARNING: initializeCraftingQuest no village");
|
|
return false;
|
|
}
|
|
if (!villageId.isInitialized())
|
|
{
|
|
messageTo(self, "handleReinitialize", null, 5, false);
|
|
return false;
|
|
}
|
|
|
|
utils.setScriptVar(villageId, SCRIPTVAR_MY_ID, self);
|
|
|
|
obj_id inventory = utils.getInventoryContainer(self);
|
|
if (isIdValid(inventory))
|
|
{
|
|
setObjVar(inventory, community_crafting.OBJVAR_COMMUNITY_CRAFTING_TRACKER, villageId);
|
|
}
|
|
|
|
int currentPhase = getIntObjVar(villageId, fs_dyn_village. OBJVAR_CURRENT_PHASE);
|
|
utils.setScriptVar(self, fs_quests_cc.SCRIPTVAR_VILLAGE_PHASE, currentPhase);
|
|
return currentPhase == 2;
|
|
}
|
|
|
|
messageHandler handleReinitialize()
|
|
{
|
|
if (initializeCraftingQuest(self))
|
|
cacheProjectData(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
void cacheProjectData (obj_id self)
|
|
{
|
|
obj_id craftingTracker = utils.getObjIdScriptVar(self, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER);
|
|
if (!isIdValid(craftingTracker))
|
|
return;
|
|
|
|
if (!community_crafting.isSessionActive(craftingTracker))
|
|
{
|
|
messageTo(self, "handleReinitialize", null, 30, false);
|
|
return;
|
|
}
|
|
|
|
obj_id inventory = utils.getInventoryContainer(self);
|
|
if (isIdValid(inventory))
|
|
{
|
|
setObjVar(inventory, fs_quests_cc.SCRIPTVAR_CRAFTING_TRACKER, craftingTracker);
|
|
}
|
|
|
|
utils.setScriptVar(self, fs_quests_cc.SCRIPTVAR_TRACKING_QUALITY, community_crafting.getIsTrackingQuality(craftingTracker));
|
|
utils.setScriptVar(self, fs_quests_cc.SCRIPTVAR_TRACKING_QUANTITY, community_crafting.getIsTrackingQuantity(craftingTracker));
|
|
utils.setScriptVar(self, fs_quests_cc.SCRIPTVAR_TRACKING_SLOTS, community_crafting.getIsTrackingSlots(craftingTracker));
|
|
utils.setScriptVar(self, fs_quests_cc.SCRIPTVAR_TRACKING_NUM_SLOTS, community_crafting.getNumSlots(craftingTracker));
|
|
}
|
|
|
|
int getNumSlots(obj_id self)
|
|
{
|
|
return utils.getIntScriptVar(self, fs_quests_cc.SCRIPTVAR_TRACKING_NUM_SLOTS);
|
|
}
|
|
|
|
// ======================================================================
|
|
// 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)
|
|
{
|
|
if (ai_lib.isInCombat (self) || ai_lib.isInCombat (player))
|
|
return SCRIPT_OVERRIDE;
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition_isCommunityCraftingEnabled (player, self))
|
|
{
|
|
//-- NPC: What would you like to do?
|
|
string_id message = new string_id (c_stringFile, "s_67afc98f");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I need the schematics for the village defenses.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition_playerNeedsSchematics (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Tell me about these special resources again.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isPlayerCommunityCrafting (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to add an ingredient to the village defenses.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isPlayerCommunityCrafting (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: How many more items do I need to contribute?
|
|
boolean hasResponse3 = false;
|
|
if (qtqc_phase_2_condition_isPlayerCommunityCrafting (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to get the status of the village defenses.
|
|
boolean hasResponse4 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_3a6af75d");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_20141151");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_ebcb651f");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_2ce1f012");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_baf57f52");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 1);
|
|
|
|
npcStartConversation (player, self, "qtqc_phase_2", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (self, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (!qtqc_phase_2_condition_isCommunityCraftingEnabled (player, self))
|
|
{
|
|
//-- NPC: There is no crafting project currently being run. Please come back later.
|
|
string_id message = new string_id (c_stringFile, "s_bc2ccc0e");
|
|
chat.chat (self, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnStartNpcConversation were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response)
|
|
{
|
|
if (conversationId != "qtqc_phase_2")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
int branchId = getIntObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What would you like to do?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I need the schematics for the village defenses.
|
|
if (branchId == 1 && response == "s_3a6af75d")
|
|
{
|
|
qtqc_phase_2_action_addPlayerToProject (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition_isPlayerCommunityCrafting (player, self))
|
|
{
|
|
//-- NPC: You have been given the schematics needed for the project. They can be accessed via the 'mission/community crafting' categories of your crafting tool. When you have an ingredient ready, see me to add it to the project.
|
|
string_id message = new string_id (c_stringFile, "s_6ef148af");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I don't recognize the resources needed by the schematics.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++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_adcf90d8");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (!qtqc_phase_2_condition_isPlayerCommunityCrafting (player, self))
|
|
{
|
|
//-- NPC: I'm sorry, something went wrong; you could not be given the project schematics.
|
|
string_id message = new string_id (c_stringFile, "s_31b4836a");
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'What would you like to do?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What would you like to do?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Tell me about these special resources again.
|
|
if (branchId == 1 && response == "s_20141151")
|
|
{
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: There are people who are working for Eozlin who are gathering special resources. You must get the resources from them to craft the items needed for the defenses. There are also reports that the Sith Shadows are using them to build their bases. The resources are Ardanium II, Endrine, and Rudic.
|
|
string_id message = new string_id (c_stringFile, "s_4f3fd2ab");
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'What would you like to do?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What would you like to do?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'd like to add an ingredient to the village defenses.
|
|
if (branchId == 1 && response == "s_ebcb651f")
|
|
{
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
qtqc_phase_2_action_openMyInventoryToPlayer (player, self);
|
|
|
|
//-- NPC: Please put the ingredients you want to add into my inventory.
|
|
string_id message = new string_id (c_stringFile, "s_739cd87c");
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'What would you like to do?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What would you like to do?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How many more items do I need to contribute?
|
|
if (branchId == 1 && response == "s_2ce1f012")
|
|
{
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition_needsOneMoreItem (player, self))
|
|
{
|
|
//-- NPC: You need to give one more item.
|
|
string_id message = new string_id (c_stringFile, "s_9750fd54");
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition_needsMoreThanOneItem (player, self))
|
|
{
|
|
//-- NPC: You need to give %DI more items.
|
|
string_id message = new string_id (c_stringFile, "s_bf623b9");
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (self);
|
|
pp.digitInteger = qtqc_phase_2_tokenDI_ingredientsNeeded (player, self);
|
|
|
|
npcSpeak (player, pp);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition_needsNoMoreItems (player, self))
|
|
{
|
|
//-- NPC: You don't need to give any more items, although you can to help the project.
|
|
string_id message = new string_id (c_stringFile, "s_74be10c7");
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'What would you like to do?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What would you like to do?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'd like to get the status of the village defenses.
|
|
if (branchId == 1 && response == "s_baf57f52")
|
|
{
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'What would you like to do?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You have been given the schematics needed for the project. They can be accessed via the 'mission/community crafting' categories of your crafting tool. When you have an ingredient ready, see me to add it to the project.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't recognize the resources needed by the schematics.
|
|
if (branchId == 2 && response == "s_adcf90d8")
|
|
{
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: There are people who are working for Eozlin who are gathering special resources. You must get the resources from them to craft the items needed for the defenses. There are also reports that the Sith Shadows are using them to build their bases.
|
|
string_id message = new string_id (c_stringFile, "s_cdaf165d");
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'You have been given the schematics needed for the project. They can be accessed via the 'mission/community crafting' categories of your crafting tool. When you have an ingredient ready, see me to add it to the project.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
if (branchId == 10 && response == "s_ff02a401")
|
|
{
|
|
qtqc_phase_2_action_showPlayerProjectAttributes (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'What would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
if (branchId == 10 && response == "s_39019ea3")
|
|
{
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition_isTrackingSlots (player, self))
|
|
{
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_4ccd023a");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Refined Endrine
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Refined Rudic
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: Refined Ardanium II
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: Reinforced Wall Module
|
|
boolean hasResponse3 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: Small Turret
|
|
boolean hasResponse4 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
//-- PLAYER: The overall project.
|
|
boolean hasResponse5 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse5 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_2a94bc85");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_ca02afa6");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_87a5e151");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_36cd5966");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_574683dc");
|
|
|
|
if (hasResponse5)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_a489b2f6");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'What would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
if (branchId == 10 && response == "s_c57c793")
|
|
{
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_4ccd023a");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Refined Endrine
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Refined Rudic
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: Refined Ardanium II
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: Reinforced Wall Module
|
|
boolean hasResponse3 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: Small Turret
|
|
boolean hasResponse4 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
//-- PLAYER: The overall project
|
|
boolean hasResponse5 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse5 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_2a94bc85");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_ca02afa6");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_87a5e151");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_36cd5966");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_574683dc");
|
|
|
|
if (hasResponse5)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_212d314f");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'What would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Refined Endrine
|
|
if (branchId == 11 && response == "s_2a94bc85")
|
|
{
|
|
qtqc_phase_2_action_showPlayerSlot1Quality (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Refined Rudic
|
|
if (branchId == 11 && response == "s_ca02afa6")
|
|
{
|
|
qtqc_phase_2_action_showPlayerSlot2Quality (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Refined Ardanium II
|
|
if (branchId == 11 && response == "s_87a5e151")
|
|
{
|
|
qtqc_phase_2_action_showPlayerSlot3Quality (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Reinforced Wall Module
|
|
if (branchId == 11 && response == "s_36cd5966")
|
|
{
|
|
qtqc_phase_2_action_showPlayerSlot4Quality (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Small Turret
|
|
if (branchId == 11 && response == "s_574683dc")
|
|
{
|
|
qtqc_phase_2_action_showPlayerSlot5Quality (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: The overall project.
|
|
if (branchId == 11 && response == "s_a489b2f6")
|
|
{
|
|
qtqc_phase_2_action_showPlayerProjectQuality (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Refined Endrine
|
|
if (branchId == 12 && response == "s_2a94bc85")
|
|
{
|
|
qtqc_phase_2_action_showPlayerSlot1Quantity (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Refined Rudic
|
|
if (branchId == 12 && response == "s_ca02afa6")
|
|
{
|
|
qtqc_phase_2_action_showPlayerSlot2Quantity (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Refined Ardanium II
|
|
if (branchId == 12 && response == "s_87a5e151")
|
|
{
|
|
qtqc_phase_2_action_showPlayerSlot3Quantity (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Reinforced Wall Module
|
|
if (branchId == 12 && response == "s_36cd5966")
|
|
{
|
|
qtqc_phase_2_action_showPlayerSlot4Quantity (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Small Turret
|
|
if (branchId == 12 && response == "s_574683dc")
|
|
{
|
|
qtqc_phase_2_action_showPlayerSlot5Quantity (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Which ingredient would you like to know about?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: The overall project
|
|
if (branchId == 12 && response == "s_212d314f")
|
|
{
|
|
qtqc_phase_2_action_showPlayerProjectQuantity (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What would you like to know about?
|
|
string_id message = new string_id (c_stringFile, "s_261bbc0d");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'd like to see the project's current attributes.
|
|
boolean hasResponse0 = false;
|
|
if (qtqc_phase_2_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the quality of the ingredients people are giving.
|
|
boolean hasResponse1 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuality (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to know about the amount of ingredients people are giving.
|
|
boolean hasResponse2 = false;
|
|
if (qtqc_phase_2_condition_isTrackingQuantity (player, self))
|
|
{
|
|
++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_ff02a401");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39019ea3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c57c793");
|
|
|
|
setObjVar (player, "conversation.qtqc_phase_2.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Which ingredient would you like to know about?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
removeObjVar (player, "conversation.qtqc_phase_2.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|