mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
1046 lines
35 KiB
Plaintext
1046 lines
35 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// combat_quest_p3.script
|
|
// Copyright 2003, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// DO NOT EDIT THIS AUTO-GENERATED FILE. PLEASE USE THE CONVERATION EDITOR!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.create;
|
|
include library.fs_counterstrike;
|
|
include library.fs_dyn_village;
|
|
include library.fs_quests;
|
|
include library.quests;
|
|
include library.trace;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/combat_quest_p3";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean combat_quest_p3_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean combat_quest_p3_condition_canTurnInFrequencyDp (obj_id player, obj_id npc)
|
|
{
|
|
obj_id disks[] = utils.getAllItemsPlayerHasByTemplate(player, "object/tangible/loot/quest/force_sensitive/camp_frequency_datapad.iff");
|
|
if(disks == null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
for(int i = 0; i < disks.length; i++)
|
|
{
|
|
if(fs_counterstrike.getPhaseItemPercentDecay(disks[i], 3) < 100)
|
|
{
|
|
return quests.isActive("fs_cs_intro", player);
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean combat_quest_p3_condition_isOnQuest (obj_id player, obj_id npc)
|
|
{
|
|
return fs_counterstrike.isOnCsQuest(player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean combat_quest_p3_condition_canTurnInWaypoint (obj_id player, obj_id npc)
|
|
{
|
|
obj_id disks[] = utils.getAllItemsPlayerHasByTemplate(player, "object/tangible/loot/quest/force_sensitive/camp_waypoint_datapad.iff");
|
|
if(disks == null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
for(int i = 0; i < disks.length; i++)
|
|
{
|
|
if(fs_counterstrike.getPhaseItemPercentDecay(disks[i], 3) < 100)
|
|
{
|
|
return quests.isActive("fs_cs_intro", player);
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean combat_quest_p3_condition_canTalkToNpc (obj_id player, obj_id npc)
|
|
{
|
|
//LOG("fs_quest", "IsEligible: " + fs_quests.isVillageEligible(player));
|
|
//LOG("fs_quest", "HasQuestAccepted: " + fs_quests.hasQuestAccepted(player));
|
|
if((fs_quests.isVillageEligible(player) && (!fs_quests.hasQuestAccepted(player) && !fs_quests.hasQuestCompleted(player))) || fs_counterstrike.isOnCsQuest(player))
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean combat_quest_p3_condition_hasCompeletedQuest (obj_id player, obj_id npc)
|
|
{
|
|
return fs_quests.hasQuestCompleted(player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean combat_quest_p3_condition_hasAcceptedNonCSQuest (obj_id player, obj_id npc)
|
|
{
|
|
LOG("fs_quest", "hasQuestAccepted=" + fs_quests.hasQuestAccepted(player));
|
|
LOG("fs_quest", "hasQuestCompleted=" + fs_quests.hasQuestCompleted(player));
|
|
LOG("fs_quest", "isOnCsQuest=" + fs_counterstrike.isOnCsQuest(player));
|
|
|
|
return (fs_quests.hasQuestAccepted(player) && !fs_quests.hasQuestCompleted(player)) &&
|
|
!fs_counterstrike.isOnCsQuest(player);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void combat_quest_p3_action_GiveQuest (obj_id player, obj_id npc)
|
|
{
|
|
attachScript(player, "systems.fs_quest.fs_cs_player");
|
|
quests.activate("fs_cs_intro", player, npc);
|
|
fs_quests.setQuestAccepted(player);
|
|
sendSystemMessage(player, new string_id("fs_quest_village", "fs_cs_accepted"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void combat_quest_p3_action_giveRemote (obj_id player, obj_id npc)
|
|
{
|
|
Vector phaseNames = new Vector();
|
|
obj_id villageMaster = getObjIdObjVar(npc, fs_dyn_village.OBJVAR_MY_MASTER_OBJECT);
|
|
if(hasObjVar(villageMaster, fs_counterstrike.OBJVAR_PHASE_CAMP_NAMES))
|
|
{
|
|
phaseNames = getResizeableStringArrayObjVar(villageMaster, fs_counterstrike.OBJVAR_PHASE_CAMP_NAMES);
|
|
}
|
|
|
|
if(phaseNames == null || phaseNames.size() < 1)
|
|
{
|
|
trace.log(fs_dyn_village.LOG_CHAN, "fs_counterstrike::giveRemote: locations are null or empty.",
|
|
player, trace.TL_ERROR_LOG);
|
|
return;
|
|
}
|
|
|
|
obj_id inv = getObjectInSlot(player, "inventory");
|
|
if(isIdValid(inv))
|
|
{
|
|
obj_id[] objects = utils.getContents(inv, false);
|
|
boolean foundDisk = false;
|
|
for (int i = 0; i < objects.length; i++)
|
|
{
|
|
if(getTemplateName(objects[i]).equals("object/tangible/loot/quest/force_sensitive/camp_frequency_datapad.iff"))
|
|
{
|
|
if(fs_counterstrike.getPhaseItemPercentDecay(objects[i], 3) < 100)
|
|
{
|
|
destroyObject(objects[i]);
|
|
foundDisk = true;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
if(!foundDisk)
|
|
{
|
|
// hack alert?
|
|
sendSystemMessage(player, new string_id("fs_quest_village", "fs_remote_dont_have"));
|
|
return;
|
|
}
|
|
|
|
// give waypoint
|
|
obj_id remote = createObject("object/tangible/loot/quest/force_sensitive/camp_remote.iff", inv, "");
|
|
if(isIdValid(remote))
|
|
{
|
|
string name = (string)phaseNames.get(rand(0, phaseNames.size()-1));
|
|
setObjVar(remote, fs_counterstrike.OBJVAR_CAMP_NAME, name);
|
|
setName(remote, new string_id("fs_quest_village", "name_rem_" + name));
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void combat_quest_p3_action_giveWaypoint (obj_id player, obj_id npc)
|
|
{
|
|
Vector phaseLocs = new Vector();
|
|
obj_id villageMaster = getObjIdObjVar(npc, fs_dyn_village.OBJVAR_MY_MASTER_OBJECT);
|
|
if(utils.hasScriptVar(villageMaster, fs_counterstrike.OBJVAR_CREATED_CAMP_LOCS))
|
|
{
|
|
phaseLocs = getResizeableLocationArrayObjVar(villageMaster, fs_counterstrike.OBJVAR_PHASE_CAMP_LOC_HINTS);
|
|
}
|
|
|
|
|
|
if(phaseLocs == null || phaseLocs.size() < 1)
|
|
{
|
|
trace.log(fs_dyn_village.LOG_CHAN, "fs_counterstrike::giveWaypoint: camp locs null or empty.",
|
|
player, trace.TL_ERROR_LOG);
|
|
return;
|
|
}
|
|
|
|
obj_id inv = getObjectInSlot(player, "inventory");
|
|
if(isIdValid(inv))
|
|
{
|
|
obj_id[] objects = utils.getContents(inv, false);
|
|
boolean foundDisk = false;
|
|
for (int i = 0; i < objects.length; i++)
|
|
{
|
|
if(getTemplateName(objects[i]).equals("object/tangible/loot/quest/force_sensitive/camp_waypoint_datapad.iff"))
|
|
{
|
|
if(fs_counterstrike.getPhaseItemPercentDecay(objects[i], 3) < 100)
|
|
{
|
|
destroyObject(objects[i]);
|
|
foundDisk = true;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
if(!foundDisk)
|
|
{
|
|
// hack alert?
|
|
sendSystemMessage(player, new string_id("fs_quest_village", "fs_remote_dont_have"));
|
|
return;
|
|
}
|
|
|
|
// give waypoint
|
|
location loc = (location)phaseLocs.get(rand(0, phaseLocs.size()-1));
|
|
obj_id waypoint = createWaypointInDatapad(player, loc);
|
|
setWaypointActive(waypoint, true);
|
|
setWaypointName(waypoint, "Aurilian Enemy");
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "npc.conversation.combat_quest_p3");
|
|
|
|
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, "npc.conversation.combat_quest_p3");
|
|
|
|
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)
|
|
{
|
|
if (ai_lib.isInCombat (self) || ai_lib.isInCombat (player))
|
|
return SCRIPT_OVERRIDE;
|
|
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition_canTalkToNpc (player, self))
|
|
{
|
|
//-- NPC: We've gained some critical information about the enemy, thanks to the efforts of you and your friends. The time for our attack has come.
|
|
string_id message = new string_id (c_stringFile, "s_822aed71");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What information do you have?
|
|
boolean hasResponse0 = false;
|
|
if (!combat_quest_p3_condition_isOnQuest (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Attack? Well, I have this appointment, you see...
|
|
boolean hasResponse1 = false;
|
|
if (!combat_quest_p3_condition_isOnQuest (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I want to turn in these frequency codes...
|
|
boolean hasResponse2 = false;
|
|
if (combat_quest_p3_condition_canTurnInFrequencyDp (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: Tell me what I need to do again...
|
|
boolean hasResponse3 = false;
|
|
if (combat_quest_p3_condition_isOnQuest (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I want to turn in this waypoint datadisk...
|
|
boolean hasResponse4 = false;
|
|
if (combat_quest_p3_condition_canTurnInWaypoint (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_43c7c81c");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_ab0e6060");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_d403b674");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_f3864fa4");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_5d6c3f37");
|
|
|
|
setObjVar (player, "conversation.combat_quest_p3.branchId", 1);
|
|
|
|
npcStartConversation (player, self, "combat_quest_p3", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (self, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition_hasAcceptedNonCSQuest (player, self))
|
|
{
|
|
//-- NPC: It looks like you're already helping someone else in the village. See me again later when you're ready to give me your undivided attention.
|
|
string_id message = new string_id (c_stringFile, "s_476f5295");
|
|
chat.chat (self, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition_hasCompeletedQuest (player, self))
|
|
{
|
|
//-- NPC: You've already helped the village out enough for now. Come see me again when we're ready to get on with our preparations.
|
|
string_id message = new string_id (c_stringFile, "s_5ee8eee8");
|
|
chat.chat (self, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: I have nothing for you to do right now.
|
|
string_id message = new string_id (c_stringFile, "s_2c9f72e9");
|
|
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 != "combat_quest_p3")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
int branchId = getIntObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We've gained some critical information about the enemy, thanks to the efforts of you and your friends. The time for our attack has come.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What information do you have?
|
|
if (branchId == 1 && response == "s_43c7c81c")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Our scouting missions have revealed some very crucial information about possible enemy encampments right here on Dathomir! We are not certain of the exact locations and our intelligence tells us that the enemy is constantly on the move attempting to elude detection.
|
|
string_id message = new string_id (c_stringFile, "s_1b62f30b");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will fight for you!
|
|
boolean hasResponse0 = false;
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm afraid I don't have the time right now. Good luck though.
|
|
boolean hasResponse1 = false;
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_a48b66a0");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_5604a3fb");
|
|
|
|
setObjVar (player, "conversation.combat_quest_p3.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'We've gained some critical information about the enemy, thanks to the efforts of you and your friends. The time for our attack has come.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We've gained some critical information about the enemy, thanks to the efforts of you and your friends. The time for our attack has come.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Attack? Well, I have this appointment, you see...
|
|
if (branchId == 1 && response == "s_ab0e6060")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Very well. Come back to see me if you're still interested in helping us to bring a swift end to this evil that has befallen our village.
|
|
string_id message = new string_id (c_stringFile, "s_50cdfefd");
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'We've gained some critical information about the enemy, thanks to the efforts of you and your friends. The time for our attack has come.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We've gained some critical information about the enemy, thanks to the efforts of you and your friends. The time for our attack has come.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I want to turn in these frequency codes...
|
|
if (branchId == 1 && response == "s_d403b674")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
combat_quest_p3_action_giveRemote (player, self);
|
|
|
|
//-- NPC: Very well. Here is a remote control configured with the frequency code on the datapad. Good luck
|
|
string_id message = new string_id (c_stringFile, "s_c012ae2b");
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'We've gained some critical information about the enemy, thanks to the efforts of you and your friends. The time for our attack has come.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We've gained some critical information about the enemy, thanks to the efforts of you and your friends. The time for our attack has come.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Tell me what I need to do again...
|
|
if (branchId == 1 && response == "s_f3864fa4")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: If you and a friend decide to take this task on together, I will make sure that both of you receive your training as long as you both participate.
|
|
string_id message = new string_id (c_stringFile, "s_2a5da4e9");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Tell me about powering down the shield generator...
|
|
boolean hasResponse0 = false;
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Tell me about capturing the camp's commander...
|
|
boolean hasResponse1 = false;
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_de9f3fb3");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_9bd673a6");
|
|
|
|
setObjVar (player, "conversation.combat_quest_p3.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'We've gained some critical information about the enemy, thanks to the efforts of you and your friends. The time for our attack has come.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We've gained some critical information about the enemy, thanks to the efforts of you and your friends. The time for our attack has come.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I want to turn in this waypoint datadisk...
|
|
if (branchId == 1 && response == "s_5d6c3f37")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
combat_quest_p3_action_giveWaypoint (player, self);
|
|
|
|
//-- NPC: A yes. This encryption is rather simple. I have added the waypoint information to your datapad.
|
|
string_id message = new string_id (c_stringFile, "s_51775d2e");
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'We've gained some critical information about the enemy, thanks to the efforts of you and your friends. The time for our attack has come.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Our scouting missions have revealed some very crucial information about possible enemy encampments right here on Dathomir! We are not certain of the exact locations and our intelligence tells us that the enemy is constantly on the move attempting to elude detection.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will fight for you!
|
|
if (branchId == 2 && response == "s_a48b66a0")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: I'm afraid I can't offer much in return, but I can put in a good word with Noldan, so that he might allow you to train Melee Accuracy. Will you still assist me? Keep in mind that if you're helping me, you won't be able to do any other work here in the village until later.
|
|
string_id message = new string_id (c_stringFile, "s_b8a984d3");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Of course.
|
|
boolean hasResponse0 = false;
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Sorry, I'm not interested in learning more about Melee Accuracy.
|
|
boolean hasResponse1 = false;
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_52917b0d");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_6c565018");
|
|
|
|
setObjVar (player, "conversation.combat_quest_p3.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Our scouting missions have revealed some very crucial information about possible enemy encampments right here on Dathomir! We are not certain of the exact locations and our intelligence tells us that the enemy is constantly on the move attempting to elude detection.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Our scouting missions have revealed some very crucial information about possible enemy encampments right here on Dathomir! We are not certain of the exact locations and our intelligence tells us that the enemy is constantly on the move attempting to elude detection.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm afraid I don't have the time right now. Good luck though.
|
|
if (branchId == 2 && response == "s_5604a3fb")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Very well. Goodbye.
|
|
string_id message = new string_id (c_stringFile, "s_54db1a8e");
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Our scouting missions have revealed some very crucial information about possible enemy encampments right here on Dathomir! We are not certain of the exact locations and our intelligence tells us that the enemy is constantly on the move attempting to elude detection.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I'm afraid I can't offer much in return, but I can put in a good word with Noldan, so that he might allow you to train Melee Accuracy. Will you still assist me? Keep in mind that if you're helping me, you won't be able to do any other work here in the village until later.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Of course.
|
|
if (branchId == 3 && response == "s_52917b0d")
|
|
{
|
|
combat_quest_p3_action_GiveQuest (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Excellent!
|
|
string_id message = new string_id (c_stringFile, "s_e4a148f5");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: It's that easy, huh?
|
|
boolean hasResponse0 = false;
|
|
if (combat_quest_p3_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_527934ce");
|
|
|
|
setObjVar (player, "conversation.combat_quest_p3.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'I'm afraid I can't offer much in return, but I can put in a good word with Noldan, so that he might allow you to train Melee Accuracy. Will you still assist me? Keep in mind that if you're helping me, you won't be able to do any other work here in the village until later.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I'm afraid I can't offer much in return, but I can put in a good word with Noldan, so that he might allow you to train Melee Accuracy. Will you still assist me? Keep in mind that if you're helping me, you won't be able to do any other work here in the village until later.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sorry, I'm not interested in learning more about Melee Accuracy.
|
|
if (branchId == 3 && response == "s_6c565018")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: I understand. Farewell.
|
|
string_id message = new string_id (c_stringFile, "s_206a4b9b");
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'I'm afraid I can't offer much in return, but I can put in a good word with Noldan, so that he might allow you to train Melee Accuracy. Will you still assist me? Keep in mind that if you're helping me, you won't be able to do any other work here in the village until later.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Excellent!
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: It's that easy, huh?
|
|
if (branchId == 4 && response == "s_527934ce")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Well, not really. First of all we need to know the exact frequency code for the specific shield you wish to power down in order to configure the remote control device. Each shield has its own frequency code.
|
|
string_id message = new string_id (c_stringFile, "s_7481097c");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: And I guess I'm supposed to find these datadisks?
|
|
boolean hasResponse0 = false;
|
|
if (combat_quest_p3_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_dd3cd5d7");
|
|
|
|
setObjVar (player, "conversation.combat_quest_p3.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Excellent!' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well, not really. First of all we need to know the exact frequency code for the specific shield you wish to power down in order to configure the remote control device. Each shield has its own frequency code.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: And I guess I'm supposed to find these datadisks?
|
|
if (branchId == 5 && response == "s_dd3cd5d7")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: If you return such a data disk to me, I will give you a remote control device configured with the proper frequency to power down the shield.
|
|
string_id message = new string_id (c_stringFile, "s_ae1194d7");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What about my reward, if I work with someone else?
|
|
boolean hasResponse0 = false;
|
|
if (combat_quest_p3_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_8767a129");
|
|
|
|
setObjVar (player, "conversation.combat_quest_p3.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Well, not really. First of all we need to know the exact frequency code for the specific shield you wish to power down in order to configure the remote control device. Each shield has its own frequency code.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: If you return such a data disk to me, I will give you a remote control device configured with the proper frequency to power down the shield.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What about my reward, if I work with someone else?
|
|
if (branchId == 6 && response == "s_8767a129")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: If you and a friend decide to take this task on together, I will make sure that both of you receive your training as long as you both participate.
|
|
string_id message = new string_id (c_stringFile, "s_2a5da4e9");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Tell me about powering down the shield generator...
|
|
boolean hasResponse0 = false;
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Tell me about capturing the camp's commander...
|
|
boolean hasResponse1 = false;
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_de9f3fb3");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_9bd673a6");
|
|
|
|
setObjVar (player, "conversation.combat_quest_p3.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'If you return such a data disk to me, I will give you a remote control device configured with the proper frequency to power down the shield.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: If you and a friend decide to take this task on together, I will make sure that both of you receive your training as long as you both participate.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Tell me about powering down the shield generator...
|
|
if (branchId == 7 && response == "s_de9f3fb3")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Then you must power down the shield generator and eliminate at least 5 of the enemy's troops afterwards.
|
|
string_id message = new string_id (c_stringFile, "s_3804b036");
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'If you and a friend decide to take this task on together, I will make sure that both of you receive your training as long as you both participate.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: If you and a friend decide to take this task on together, I will make sure that both of you receive your training as long as you both participate.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Tell me about capturing the camp's commander...
|
|
if (branchId == 7 && response == "s_9bd673a6")
|
|
{
|
|
//-- [NOTE]
|
|
if (combat_quest_p3_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Then you must join a group with someone who powered down the shield generator, and eliminate at least 5 of the enemy's troops after the shield comes down.
|
|
string_id message = new string_id (c_stringFile, "s_97bc1b9");
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'If you and a friend decide to take this task on together, I will make sure that both of you receive your training as long as you both participate.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
removeObjVar (player, "conversation.combat_quest_p3.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|