mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
1185 lines
32 KiB
Plaintext
1185 lines
32 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// ep3_cpg_veteran.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.30 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.badge;
|
|
include library.chat;
|
|
include library.groundquests;
|
|
include library.ship_ai;
|
|
include library.space_combat;
|
|
include library.space_content;
|
|
include library.space_crafting;
|
|
include library.space_flags;
|
|
include library.space_quest;
|
|
include library.space_transition;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/ep3_cpg_veteran";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean ep3_cpg_veteran_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_veteran_condition_isOnQuest_escort_alpha (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasQuest( player, "escort", "ep3_kash_station_escort_alpha"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_veteran_condition_hasFailedQuest_02 (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasFailedQuest( player, "escort", "ep3_kash_station_escort_bravo") ||
|
|
space_quest.hasAbortedQuest( player, "escort", "ep3_kash_station_escort_bravo"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_veteran_condition_hasWon_assassinations (obj_id player, obj_id npc)
|
|
{
|
|
// Has the player won any of the three ASSASSINATION missions he can take at this point?
|
|
return ( space_quest.hasReceivedReward(player, "assassinate", "ep3_kash_station_assassinate_neutral") ||
|
|
space_quest.hasReceivedReward(player, "assassinate", "ep3_kash_station_assassinate_rebel") ||
|
|
space_quest.hasReceivedReward(player, "assassinate", "ep3_kash_station_assassinate_imperial"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_veteran_condition_isOnQuest_AMBUSH (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasQuest( player, "destroy_surpriseattack", "ep3_kash_station_ghrag_ambush"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_veteran_condition_hasFailedQuest_03 (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasFailedQuest( player, "rescue", "ep3_kash_station_rescue_alpha") ||
|
|
space_quest.hasAbortedQuest( player, "rescue", "ep3_kash_station_rescue_alpha"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_veteran_condition_isOnQuest_rescue_alpha (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasQuest( player, "rescue", "ep3_kash_station_rescue_alpha"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_veteran_condition_isOnQuest_escort_bravo (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasQuest( player, "escort", "ep3_kash_station_escort_bravo"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_veteran_condition_isTooFar (obj_id player, obj_id npc)
|
|
{
|
|
space_combat.playCombatTauntSound( player );
|
|
obj_id containingShip = space_transition.getContainingShip(player);
|
|
return ( getDistance( npc, containingShip ) > space_transition.STATION_COMM_MAX_DISTANCE );
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_veteran_condition_hasBadge_visited_Kachirho (obj_id player, obj_id npc)
|
|
{
|
|
return badge.hasBadge(player, "exp_kash_kachirho_found");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_veteran_condition_isAttacking (obj_id player, obj_id npc)
|
|
{
|
|
return _spaceUnitIsAttacking(npc);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_veteran_condition_isOnQuest (obj_id player, obj_id npc)
|
|
{
|
|
return space_quest.hasQuest(player);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void ep3_cpg_veteran_action_grantDuty_destroy (obj_id player, obj_id npc)
|
|
{
|
|
space_quest.grantQuest(player, "destroy_duty", "ep3_kash_station_destroy_duty_veteran");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int ep3_cpg_veteran_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: So you're making friends with the CPG commander, eh?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Roger that.
|
|
if (response == "s_239")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Glad to have you on our side!
|
|
string_id message = new string_id (c_stringFile, "s_241");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thanks!
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (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_27");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_veteran_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Glad to have you on our side!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thanks!
|
|
if (response == "s_27")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Good hunting! CPG Patrol Delta out!
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_veteran_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: So you lost a civilian transport, huh? Gives you a terrible sick feeling in your stomach, doesn't it?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You bet.
|
|
if (response == "s_159")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Don't worry. You'll get back on-track!
|
|
string_id message = new string_id (c_stringFile, "s_161");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thanks!
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_24");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: It's not too bad.
|
|
if (response == "s_160")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh no? Are you sure you're fighting for the right side?
|
|
string_id message = new string_id (c_stringFile, "s_162");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes. My side.
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (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_23");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 13);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_veteran_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Don't worry. You'll get back on-track!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thanks!
|
|
if (response == "s_24")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Good hunting! CPG Patrol Delta out!
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_veteran_handleBranch13 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Oh no? Are you sure you're fighting for the right side?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes. My side.
|
|
if (response == "s_23")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Hmph.
|
|
string_id message = new string_id (c_stringFile, "s_25");
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_veteran_handleBranch16 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: %NU! Keep up the good work!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm looking for more work.
|
|
if (response == "s_37")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well, there is some new trouble brewing in Kashyyyk. The Ghrag are beaten but they are still here... and they are trying to get back in the game.
|
|
string_id message = new string_id (c_stringFile, "s_38");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How do you know this?
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (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_39");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 17);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_veteran_handleBranch17 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well, there is some new trouble brewing in Kashyyyk. The Ghrag are beaten but they are still here... and they are trying to get back in the game.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How do you know this?
|
|
if (response == "s_39")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I have modified my starship communication system and have sliced in to the main Ghrag command frequency. From what I hear, they are recruiting talent from all over the galaxy.
|
|
string_id message = new string_id (c_stringFile, "s_40");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What do we do about it?
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (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_41");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 18);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_veteran_handleBranch18 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I have modified my starship communication system and have sliced in to the main Ghrag command frequency. From what I hear, they are recruiting talent from all over the galaxy.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What do we do about it?
|
|
if (response == "s_41")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I'll stay on patrol here and maintain a lock on their communication stream. I'll forward coordinates to you so that you can intercept the replacement pilots the Ghrag have recruited.
|
|
string_id message = new string_id (c_stringFile, "s_42");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sounds good.
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thanks.
|
|
boolean hasResponse1 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_43");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_47");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 19);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_veteran_handleBranch19 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I'll stay on patrol here and maintain a lock on their communication stream. I'll forward coordinates to you so that you can intercept the replacement pilots the Ghrag have recruited.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sounds good.
|
|
if (response == "s_43")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
ep3_cpg_veteran_action_grantDuty_destroy (player, npc);
|
|
|
|
//-- NPC: Superb!
|
|
string_id message = new string_id (c_stringFile, "s_46");
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No thanks.
|
|
if (response == "s_47")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Suit yourself... I've got to get back to listening...
|
|
string_id message = new string_id (c_stringFile, "s_49");
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_veteran_handleBranch22 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Roger. This is CPG Patrol Delta.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Any work around here?
|
|
if (response == "s_168")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: See Rian Ry at the Kashyyyk space station. She can offer contracts from the Civilian Protection Guild. You can become one of us!
|
|
string_id message = new string_id (c_stringFile, "s_169");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thanks!
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (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_54");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 23);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_veteran_handleBranch23 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: See Rian Ry at the Kashyyyk space station. She can offer contracts from the Civilian Protection Guild. You can become one of us!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thanks!
|
|
if (response == "s_54")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: After you know your way around the Kashyyyk system, we should talk. I am working on a special project... Perhaps you can help?
|
|
string_id message = new string_id (c_stringFile, "s_56");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sounds good!
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: What sort of project?
|
|
boolean hasResponse1 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_57");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_58");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 24);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_veteran_handleBranch24 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: After you know your way around the Kashyyyk system, we should talk. I am working on a special project... Perhaps you can help?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sounds good!
|
|
if (response == "s_57")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Stay safe!
|
|
string_id message = new string_id (c_stringFile, "s_60");
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What sort of project?
|
|
if (response == "s_58")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I'll tell you later. Take care!
|
|
string_id message = new string_id (c_stringFile, "s_59");
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
//setObjVar(self, "convo.appearance", "object/mobile/space_comm_rian_ry.iff" );
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
//setObjVar(self, "convo.appearance", "object/mobile/space_comm_rian_ry.iff" );
|
|
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.ep3_cpg_veteran");
|
|
|
|
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 (ep3_cpg_veteran_condition_isTooFar (player, npc))
|
|
{
|
|
//-- NPC: What? You're breaking up!
|
|
string_id message = new string_id (c_stringFile, "s_185");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition_isAttacking (player, npc))
|
|
{
|
|
//-- NPC: Can't you see I'm busy?!
|
|
string_id message = new string_id (c_stringFile, "s_156");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (!ep3_cpg_veteran_condition_hasBadge_visited_Kachirho (player, npc))
|
|
{
|
|
//-- NPC: Welcome to Kashyyyk my friend. Watch your step!
|
|
string_id message = new string_id (c_stringFile, "s_187");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition_isOnQuest_escort_alpha (player, npc))
|
|
{
|
|
//-- NPC: Rian asked you to save that droid pilot, didn't she? You ought to get moving...
|
|
string_id message = new string_id (c_stringFile, "s_233");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition_isOnQuest_escort_bravo (player, npc))
|
|
{
|
|
//-- NPC: Good luck, %TU! Save the civilian transport from those bandits!
|
|
string_id message = new string_id (c_stringFile, "s_235");
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
chat.chat (npc, player, null, null, pp);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition_isOnQuest_rescue_alpha (player, npc))
|
|
{
|
|
//-- NPC: So you're making friends with the CPG commander, eh?
|
|
string_id message = new string_id (c_stringFile, "s_237");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Roger that.
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (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_239");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 6);
|
|
|
|
npcStartConversation (player, npc, "ep3_cpg_veteran", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition_isOnQuest_AMBUSH (player, npc))
|
|
{
|
|
//-- NPC: Good job, %TU! The Ghrag hate your guts! That means you're on the right track!
|
|
string_id message = new string_id (c_stringFile, "s_243");
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
chat.chat (npc, player, null, null, pp);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition_hasFailedQuest_03 (player, npc))
|
|
{
|
|
//-- NPC: So you lost a civilian transport, huh? Gives you a terrible sick feeling in your stomach, doesn't it?
|
|
string_id message = new string_id (c_stringFile, "s_273");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: You bet.
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: It's not too bad.
|
|
boolean hasResponse1 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_159");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_160");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 10);
|
|
|
|
npcStartConversation (player, npc, "ep3_cpg_veteran", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition_hasFailedQuest_02 (player, npc))
|
|
{
|
|
//-- NPC: They say that when a civilian transport goes critical the atmosphere inside the vessel reaches two thousand degrees. It's a quick death.
|
|
string_id message = new string_id (c_stringFile, "s_283");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition_hasWon_assassinations (player, npc))
|
|
{
|
|
//-- NPC: %NU! Keep up the good work!
|
|
string_id message = new string_id (c_stringFile, "s_165");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm looking for more work.
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isOnQuest (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_37");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 16);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
npcStartConversation (player, npc, "ep3_cpg_veteran", null, pp, responses);
|
|
}
|
|
else
|
|
{
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
chat.chat (npc, player, null, null, pp);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_veteran_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Roger. This is CPG Patrol Delta.
|
|
string_id message = new string_id (c_stringFile, "s_351");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Any work around here?
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_veteran_condition_isAttacking (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_168");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_veteran.branchId", 22);
|
|
|
|
npcStartConversation (player, npc, "ep3_cpg_veteran", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response)
|
|
{
|
|
if (conversationId != "ep3_cpg_veteran")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
if (branchId == 6 && ep3_cpg_veteran_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && ep3_cpg_veteran_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && ep3_cpg_veteran_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && ep3_cpg_veteran_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 13 && ep3_cpg_veteran_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 16 && ep3_cpg_veteran_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 17 && ep3_cpg_veteran_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 18 && ep3_cpg_veteran_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 19 && ep3_cpg_veteran_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 22 && ep3_cpg_veteran_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 23 && ep3_cpg_veteran_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 24 && ep3_cpg_veteran_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_veteran.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|