mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
844 lines
26 KiB
Plaintext
844 lines
26 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// ep3_cpg_ace.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// 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_ace";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean ep3_cpg_ace_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_canAfford50 (obj_id player, obj_id npc)
|
|
{
|
|
return space_crafting.canAffordShipRepairs(player, npc, .50f);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_canAfford25 (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_crafting.canAffordShipRepairs(player, npc, .25f) && space_crafting.isDamaged( player ) );
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_canAfford75 (obj_id player, obj_id npc)
|
|
{
|
|
return space_crafting.canAffordShipRepairs(player, npc, .75f);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_canAfford100 (obj_id player, obj_id npc)
|
|
{
|
|
return space_crafting.canAffordShipRepairs(player, npc, 1.0f);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_hasWonQuest_01 (obj_id player, obj_id npc)
|
|
{
|
|
// Has finished the first escort but not the second...
|
|
return ( space_quest.hasWonQuest( player, "escort", "ep3_kash_station_escort_alpha"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_hasWonQuest_02 (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasWonQuest( player, "escort", "ep3_kash_station_escort_bravo") );
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_hasWonQuest_03 (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasWonQuest(player, "rescue", "ep3_kash_station_rescue_alpha") );
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_hasWonQuest_04 (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasWonQuest(player, "rescue", "ep3_kash_station_rescue_bravo") );
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_isOnQuest_escort_alpha (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasQuest( player, "escort", "ep3_kash_station_escort_alpha"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_hasFailedQuest_01 (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasFailedQuest( player, "escort", "ep3_kash_station_escort_alpha") ||
|
|
space_quest.hasAbortedQuest( player, "escort", "ep3_kash_station_escort_alpha"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_hasBeenRewarded_01 (obj_id player, obj_id npc)
|
|
{
|
|
return space_quest.hasReceivedReward( player, "escort", "ep3_kash_station_escort_alpha");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_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_ace_condition_hasBeenRewarded_02 (obj_id player, obj_id npc)
|
|
{
|
|
return space_quest.hasReceivedReward( player, "escort", "ep3_kash_station_escort_bravo");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_hasWon01_not02yet (obj_id player, obj_id npc)
|
|
{
|
|
// Has finished the first escort but not the second...
|
|
return ( space_quest.hasWonQuest( player, "escort", "ep3_kash_station_escort_alpha") &&
|
|
(!space_quest.hasWonQuest(player, "escort", "ep3_kash_station_escort_bravo") ));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_hasWon02_not03yet (obj_id player, obj_id npc)
|
|
{
|
|
// Has finished the second escort but not the first rescue...
|
|
return ( space_quest.hasWonQuest( player, "escort", "ep3_kash_station_escort_bravo") &&
|
|
(!space_quest.hasWonQuest(player, "rescue", "ep3_kash_station_rescue_alpha") ));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_hasWon03_not04yet (obj_id player, obj_id npc)
|
|
{
|
|
// Has finished the first rescue but not the second rescue...
|
|
return ( space_quest.hasWonQuest( player, "rescue", "ep3_kash_station_rescue_alpha") &&
|
|
(!space_quest.hasWonQuest(player, "rescue", "ep3_kash_station_rescue_bravo") ));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_hasDoneGround_01 (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "ep3_kash_station_contact_eyma_01"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_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_ace_condition_isOnQuest_ground_01 (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.isQuestActive(player, "ep3_kash_station_contact_eyma_01"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_isOnQuest_AMBUSH (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasQuest( player, "destroy_surpriseattack", "ep3_kash_station_ghrag_ambush"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_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_ace_condition_isOnQuest_ground_00 (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.isQuestActive(player, "ep3_kash_station_contact_eyma_00"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_isOnQuest_rescue_alpha (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasQuest( player, "rescue", "ep3_kash_station_rescue_alpha"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_isOnQuest_escort_bravo (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasQuest( player, "escort", "ep3_kash_station_escort_bravo"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_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_ace_condition_hasBadge_visited_Kachirho (obj_id player, obj_id npc)
|
|
{
|
|
return badge.hasBadge(player, "exp_kash_kachirho_found");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cpg_ace_condition_isAttacking (obj_id player, obj_id npc)
|
|
{
|
|
return _spaceUnitIsAttacking(npc);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void ep3_cpg_ace_action_land_kashyyyk (obj_id player, obj_id npc)
|
|
{
|
|
space_content.landPlayer(player, npc, "Kachirho Starport");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_fix25 (obj_id player, obj_id npc)
|
|
{
|
|
space_crafting.doStationToShipRepairs(player, npc, .25f);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_fix50 (obj_id player, obj_id npc)
|
|
{
|
|
space_crafting.doStationToShipRepairs(player, npc, .50f);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_fix75 (obj_id player, obj_id npc)
|
|
{
|
|
space_crafting.doStationToShipRepairs(player, npc, .75f);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_fix100 (obj_id player, obj_id npc)
|
|
{
|
|
space_crafting.doStationToShipRepairs(player, npc, 1.0f);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_grantQuest_01 (obj_id player, obj_id npc)
|
|
{
|
|
// Player doesn't even know the station operator's name.
|
|
// There is trouble. An automated distress signal has reached the station. Nobody will help. How 'bout you?
|
|
space_quest.grantQuest(player, "escort", "ep3_kash_station_escort_alpha");
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_grantQuest_02 (obj_id player, obj_id npc)
|
|
{
|
|
// Having proved trustworthy, the player is asked to help another distressed traveler.
|
|
// This time a civilian transport has been disabled by pirates.
|
|
space_quest.grantQuest(player, "escort", "ep3_kash_station_escort_bravo");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_grantQuest_03 (obj_id player, obj_id npc)
|
|
{
|
|
space_quest.grantQuest(player, "rescue", "ep3_kash_station_rescue_alpha");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_grantQuest_04 (obj_id player, obj_id npc)
|
|
{
|
|
space_quest.grantQuest(player, "rescue", "ep3_kash_station_rescue_bravo");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_rewardQuest_01 (obj_id player, obj_id npc)
|
|
{
|
|
if (!space_quest.hasReceivedReward( player, "escort", "ep3_kash_station_escort_alpha") )
|
|
{
|
|
space_quest.giveReward( player, "escort", "ep3_kash_station_escort_alpha", 400 );
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_rewardQuest_02 (obj_id player, obj_id npc)
|
|
{
|
|
if (!space_quest.hasReceivedReward( player, "escort", "ep3_kash_station_escort_bravo") )
|
|
{
|
|
space_quest.giveReward( player, "escort", "ep3_kash_station_escort_bravo", 500 );
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_grantDuty_escort (obj_id player, obj_id npc)
|
|
{
|
|
space_quest.grantQuest(player, "escort_duty", "ep3_kash_station_escort_duty");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_giveGroundQuest_01 (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "ep3_kash_station_contact_eyma_01");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_grantDuty_destroy (obj_id player, obj_id npc)
|
|
{
|
|
space_quest.grantQuest(player, "destroy_duty", "ep3_kash_station_destroy_duty_neutral");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_giveGroundQuest_00 (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "ep3_kash_station_contact_eyma_00");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_cpg_ace_action_Land_and_GrantBadge_visited_Kachirho (obj_id player, obj_id npc)
|
|
{
|
|
badge.grantBadge (player, "exp_kash_kachirho_found");
|
|
space_content.landPlayer(player, npc, "Kachirho Starport");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
int ep3_cpg_ace_tokenDI_getStationRepairCost25 (obj_id player, obj_id npc)
|
|
{
|
|
return space_crafting.getStationRepairCost(player, npc, .25f);
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_ace_tokenDI_getStationRepairCost50 (obj_id player, obj_id npc)
|
|
{
|
|
return space_crafting.getStationRepairCost(player, npc, .50f);
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_ace_tokenDI_getStationRepairCost75 (obj_id player, obj_id npc)
|
|
{
|
|
return space_crafting.getStationRepairCost(player, npc, .75f);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_ace_tokenDI_getStationRepairCost100 (obj_id player, obj_id npc)
|
|
{
|
|
return space_crafting.getStationRepairCost(player, npc, 1.0f);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int ep3_cpg_ace_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I hear there's a disabled transport in the Tyyyn nebula... again. Think can you handle a rescue like this by yourself?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No doubt.
|
|
if (response == "s_239")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_ace_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You know, those old fashioned transports can take power directly from your ship. All you have to do is dock.
|
|
string_id message = new string_id (c_stringFile, "s_241");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thanks!
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_ace_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_ace.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_ace.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_ace_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You know, those old fashioned transports can take power directly from your ship. All you have to do is dock.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thanks!
|
|
if (response == "s_27")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_ace_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Take care, %NU.
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_ace.branchId");
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
chat.chat (npc, player, pp);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_ace_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Roger. This is CPG Patrol Gamma.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Is there anything to do around here?
|
|
if (response == "s_168")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_ace_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You should check in with Rian Ry. She's commander of the Kashyyyk space station.
|
|
string_id message = new string_id (c_stringFile, "s_169");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thanks!
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_ace_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_34");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cpg_ace.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_ace.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cpg_ace_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You should check in with Rian Ry. She's commander of the Kashyyyk space station.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thanks!
|
|
if (response == "s_34")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cpg_ace_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Good luck!
|
|
string_id message = new string_id (c_stringFile, "s_36");
|
|
utils.removeScriptVar (player, "conversation.ep3_cpg_ace.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_ace");
|
|
|
|
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_ace_condition_isTooFar (player, npc))
|
|
{
|
|
//-- NPC: [ ... Transmission Blocked ... ]
|
|
string_id message = new string_id (c_stringFile, "s_185");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_ace_condition_isAttacking (player, npc))
|
|
{
|
|
//-- NPC: Hey! Either you back off or you help me out, okay?
|
|
string_id message = new string_id (c_stringFile, "s_156");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (!ep3_cpg_ace_condition_hasBadge_visited_Kachirho (player, npc))
|
|
{
|
|
//-- NPC: Come to Kashyyyk for some excitement, eh? You won't be disappointed!
|
|
string_id message = new string_id (c_stringFile, "s_187");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_ace_condition_isOnQuest_escort_alpha (player, npc))
|
|
{
|
|
//-- NPC: Look - that droid pilot's not going to save himself, okay? Get busy.
|
|
string_id message = new string_id (c_stringFile, "s_233");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_ace_condition_isOnQuest_escort_bravo (player, npc))
|
|
{
|
|
//-- NPC: So you're off to beat up on some Gotal bandits, eh? Good. I hate those guys!
|
|
string_id message = new string_id (c_stringFile, "s_235");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_ace_condition_isOnQuest_rescue_alpha (player, npc))
|
|
{
|
|
//-- NPC: I hear there's a disabled transport in the Tyyyn nebula... again. Think can you handle a rescue like this by yourself?
|
|
string_id message = new string_id (c_stringFile, "s_237");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: No doubt.
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_ace_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_ace.branchId", 6);
|
|
|
|
npcStartConversation (player, npc, "ep3_cpg_ace", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cpg_ace_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_ace_condition_hasWon_assassinations (player, npc))
|
|
{
|
|
//-- NPC: %NU! Keep up the good work!
|
|
string_id message = new string_id (c_stringFile, "s_165");
|
|
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_ace_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Roger. This is CPG Patrol Gamma.
|
|
string_id message = new string_id (c_stringFile, "s_351");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Is there anything to do around here?
|
|
boolean hasResponse0 = false;
|
|
if (!ep3_cpg_ace_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_ace.branchId", 11);
|
|
|
|
npcStartConversation (player, npc, "ep3_cpg_ace", 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_ace")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.ep3_cpg_ace.branchId");
|
|
|
|
if (branchId == 6 && ep3_cpg_ace_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && ep3_cpg_ace_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && ep3_cpg_ace_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && ep3_cpg_ace_handleBranch12 (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_ace.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|