mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
900 lines
27 KiB
Plaintext
900 lines
27 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// scientist_collection.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.collection;
|
|
include library.conversation;
|
|
include library.groundquests;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/scientist_collection";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean scientist_collection_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_isSlotOne (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_1");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_isSlotTen (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_10");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_isSlotNine (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_9");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_isSlotEight (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_8");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_isSlotSeven (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_7");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_isSlotSix (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_6");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_isSlotFive (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_5");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_isSlotFour (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_4");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_isSlotThree (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_3");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_isSlotTwo (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_2");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_playerHasQuestAndCollection (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return groundquests.isQuestActive(player, "u16_nym_themepark_question_scientist_collection")
|
|
&& getCollectionSlotValue(player, "nym_question_scientist_activation") > 0;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_ifNothing (obj_id player, obj_id npc)
|
|
{
|
|
return (!scientist_collection_condition_isSlotEight(player, npc) && !scientist_collection_condition_isSlotNine(player, npc) && !scientist_collection_condition_isSlotTen(player, npc) && !scientist_collection_condition_isSlotOne(player, npc)
|
|
&& !scientist_collection_condition_isSlotTwo(player, npc) && !scientist_collection_condition_isSlotThree(player, npc) && !scientist_collection_condition_isSlotFour(player, npc) && !scientist_collection_condition_isSlotFive(player, npc)
|
|
&& !scientist_collection_condition_isSlotSix(player, npc) && !scientist_collection_condition_isSlotSeven(player, npc));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean scientist_collection_condition_playerAlreadyQuestioned (obj_id player, obj_id npc)
|
|
{
|
|
if(!scientist_collection_condition_playerHasQuestAndCollection(player, npc))
|
|
return false;
|
|
|
|
string baseSlotName = getStringObjVar(npc, "collection.slotName");
|
|
if(baseSlotName == null || baseSlotName.length() <= 0)
|
|
return false;
|
|
|
|
string[] splitSlotNames = split(baseSlotName, ':');
|
|
if(splitSlotNames == null || splitSlotNames.length < 0)
|
|
return false;
|
|
|
|
string slotName = splitSlotNames[1];
|
|
if(slotName == null || slotName.length() <= 0)
|
|
return false;
|
|
|
|
return hasCompletedCollectionSlot(player, slotName);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void scientist_collection_action_awardSlotOne (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_1"))
|
|
{
|
|
modifyCollectionSlotValue(player, "icon_nyms_question_scientist_1", 1);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void scientist_collection_action_awardSlotTwo (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_2"))
|
|
{
|
|
modifyCollectionSlotValue(player, "icon_nyms_question_scientist_2", 1);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void scientist_collection_action_awardSlotThree (obj_id player, obj_id npc)
|
|
{ if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_3"))
|
|
{
|
|
modifyCollectionSlotValue(player, "icon_nyms_question_scientist_3", 1);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void scientist_collection_action_awardSlotFour (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_4"))
|
|
{
|
|
modifyCollectionSlotValue(player, "icon_nyms_question_scientist_4", 1);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void scientist_collection_action_awardSlotFive (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_5"))
|
|
{
|
|
modifyCollectionSlotValue(player, "icon_nyms_question_scientist_5", 1);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void scientist_collection_action_awardSlotSix (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_6"))
|
|
{
|
|
modifyCollectionSlotValue(player, "icon_nyms_question_scientist_6", 1);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void scientist_collection_action_awardSlotSeven (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_7"))
|
|
{
|
|
modifyCollectionSlotValue(player, "icon_nyms_question_scientist_7", 1);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void scientist_collection_action_awardSlotEight (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_8"))
|
|
{
|
|
modifyCollectionSlotValue(player, "icon_nyms_question_scientist_8", 1);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void scientist_collection_action_awardSlotNine (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_9"))
|
|
{
|
|
modifyCollectionSlotValue(player, "icon_nyms_question_scientist_9", 1);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void scientist_collection_action_awardSlotTen (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_10"))
|
|
{
|
|
modifyCollectionSlotValue(player, "icon_nyms_question_scientist_10", 1);
|
|
}
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int scientist_collection_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I'm not telling you anything.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes, you are.
|
|
if (response == "s_6")
|
|
{
|
|
doAnimationAction (player, "backhand_threaten");
|
|
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "taken_aback");
|
|
|
|
//-- NPC: Uh...
|
|
string_id message = new string_id (c_stringFile, "s_8");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Tell me about the facility.
|
|
boolean hasResponse0 = false;
|
|
if (scientist_collection_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_10");
|
|
|
|
utils.setScriptVar (player, "conversation.scientist_collection.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int scientist_collection_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Uh...
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Tell me about the facility.
|
|
if (response == "s_10")
|
|
{
|
|
doAnimationAction (player, "point_accusingly");
|
|
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "scared");
|
|
|
|
//-- NPC: We make weapons...don't hurt me!
|
|
string_id message = new string_id (c_stringFile, "s_12");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What do you do?
|
|
boolean hasResponse0 = false;
|
|
if (scientist_collection_condition_isSlotOne (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Where is the main computer system?
|
|
boolean hasResponse1 = false;
|
|
if (scientist_collection_condition_isSlotTwo (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: Who is in charge here?
|
|
boolean hasResponse2 = false;
|
|
if (scientist_collection_condition_isSlotThree (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: Who programmed the Droidekas?
|
|
boolean hasResponse3 = false;
|
|
if (scientist_collection_condition_isSlotFour (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: Where are the IMGGCU?
|
|
boolean hasResponse4 = false;
|
|
if (scientist_collection_condition_isSlotFive (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
//-- PLAYER: Tell me about grenades.
|
|
boolean hasResponse5 = false;
|
|
if (scientist_collection_condition_isSlotSix (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse5 = true;
|
|
}
|
|
|
|
//-- PLAYER: Tell me about rifles.
|
|
boolean hasResponse6 = false;
|
|
if (scientist_collection_condition_isSlotSeven (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse6 = true;
|
|
}
|
|
|
|
//-- PLAYER: Tell me about carbines.
|
|
boolean hasResponse7 = false;
|
|
if (scientist_collection_condition_isSlotEight (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse7 = true;
|
|
}
|
|
|
|
//-- PLAYER: Tell me about melee weapons.
|
|
boolean hasResponse8 = false;
|
|
if (scientist_collection_condition_isSlotNine (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse8 = true;
|
|
}
|
|
|
|
//-- PLAYER: Tell me about experimental weapons.
|
|
boolean hasResponse9 = false;
|
|
if (scientist_collection_condition_isSlotTen (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse9 = true;
|
|
}
|
|
|
|
//-- PLAYER: Well, you aren't helpful are you?
|
|
boolean hasResponse10 = false;
|
|
if (scientist_collection_condition_ifNothing (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse10 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_14");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_17");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_20");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_26");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_30");
|
|
|
|
if (hasResponse5)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_54");
|
|
|
|
if (hasResponse6)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_58");
|
|
|
|
if (hasResponse7)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_62");
|
|
|
|
if (hasResponse8)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_66");
|
|
|
|
if (hasResponse9)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_70");
|
|
|
|
if (hasResponse10)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_73");
|
|
|
|
utils.setScriptVar (player, "conversation.scientist_collection.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int scientist_collection_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We make weapons...don't hurt me!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What do you do?
|
|
if (response == "s_14")
|
|
{
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
scientist_collection_action_awardSlotOne (player, npc);
|
|
|
|
//-- NPC: I'm a scientist, that is why I wear a lab coat. We specialize in different areas such as explosives, chemicals, gasses and so on. We're all here to develop weaponry.
|
|
string_id message = new string_id (c_stringFile, "s_21");
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Where is the main computer system?
|
|
if (response == "s_17")
|
|
{
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
scientist_collection_action_awardSlotTwo (player, npc);
|
|
|
|
//-- NPC: The main computer system? It is down on the bottom level. Please don't hurt it. Many of us have several months of research on it.
|
|
string_id message = new string_id (c_stringFile, "s_22");
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Who is in charge here?
|
|
if (response == "s_20")
|
|
{
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
scientist_collection_action_awardSlotThree (player, npc);
|
|
|
|
//-- NPC: Udo Barnet of the mercenaries is probably the person that most likely fills those shoes. The scientists have their own rank based on seniority, but even the most senior still defer to Barnet.
|
|
string_id message = new string_id (c_stringFile, "s_24");
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Who programmed the Droidekas?
|
|
if (response == "s_26")
|
|
{
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
scientist_collection_action_awardSlotFour (player, npc);
|
|
|
|
//-- NPC: I, I don't know. The Imperials? They are just delivered. Even repairs and maintenance is done off site. I swear it is the truth!
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Where are the IMGGCU?
|
|
if (response == "s_30")
|
|
{
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
scientist_collection_action_awardSlotFive (player, npc);
|
|
|
|
//-- NPC: We just finished a new prototype. There is a container full of them in a storage room below.
|
|
string_id message = new string_id (c_stringFile, "s_32");
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Tell me about grenades.
|
|
if (response == "s_54")
|
|
{
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
scientist_collection_action_awardSlotSix (player, npc);
|
|
|
|
//-- NPC: We develop new grenade technologies at this facility. Recently, we received orders to research a new non-lethal gas grenade.
|
|
string_id message = new string_id (c_stringFile, "s_56");
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Tell me about rifles.
|
|
if (response == "s_58")
|
|
{
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
scientist_collection_action_awardSlotSeven (player, npc);
|
|
|
|
//-- NPC: We have received the funding to research a new blaster sniper rifle that consists of 3 separate pieces that can be much easier to conceal. Probably a special operations type weapon.
|
|
string_id message = new string_id (c_stringFile, "s_60");
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Tell me about carbines.
|
|
if (response == "s_62")
|
|
{
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
scientist_collection_action_awardSlotEight (player, npc);
|
|
|
|
//-- NPC: We aren't currently working on carbines here. We have a grant for rifle development and another to reverse engineer a Gungan Assault Cannon.
|
|
string_id message = new string_id (c_stringFile, "s_64");
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Tell me about melee weapons.
|
|
if (response == "s_66")
|
|
{
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
scientist_collection_action_awardSlotNine (player, npc);
|
|
|
|
//-- NPC: There are no melee weapons in development at this facility.
|
|
string_id message = new string_id (c_stringFile, "s_68");
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Tell me about experimental weapons.
|
|
if (response == "s_70")
|
|
{
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
scientist_collection_action_awardSlotTen (player, npc);
|
|
|
|
//-- NPC: We worked on something we called the 'Anti-Fear Virus'. Basically an airborne pathogen that would make Tie Fighter pilots and Stormtroopers fearless. Unfortunately, it affected their motor skills, making them slow to react. Despite it being deemed as complete scientific failure, the Empire still uses it on its personnel.
|
|
string_id message = new string_id (c_stringFile, "s_72");
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Well, you aren't helpful are you?
|
|
if (response == "s_73")
|
|
{
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: No...my conversation is broken....and it is Jaskell that did it!
|
|
string_id message = new string_id (c_stringFile, "s_74");
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isTangible (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.scientist_collection");
|
|
|
|
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.scientist_collection");
|
|
|
|
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 (scientist_collection_condition_playerAlreadyQuestioned (player, npc))
|
|
{
|
|
doAnimationAction (npc, "apologize");
|
|
|
|
//-- NPC: I've already told you everything I know.
|
|
string_id message = new string_id (c_stringFile, "s_49");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition_playerHasQuestAndCollection (player, npc))
|
|
{
|
|
doAnimationAction (npc, "blame");
|
|
|
|
//-- NPC: I'm not telling you anything.
|
|
string_id message = new string_id (c_stringFile, "s_4");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes, you are.
|
|
boolean hasResponse0 = false;
|
|
if (scientist_collection_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_6");
|
|
|
|
utils.setScriptVar (player, "conversation.scientist_collection.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "scientist_collection", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (scientist_collection_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I don't have to tell you anything!
|
|
string_id message = new string_id (c_stringFile, "s_46");
|
|
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 != "scientist_collection")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
if (branchId == 2 && scientist_collection_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && scientist_collection_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && scientist_collection_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.scientist_collection.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|