mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-02 02:15:48 -04:00
472 lines
13 KiB
Plaintext
472 lines
13 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// greeter_kadaara_mistress.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.21 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.features;
|
|
include library.skill;
|
|
include library.space_flags;
|
|
include library.space_quest;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/greeter_kadaara_mistress";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean greeter_kadaara_mistress_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean greeter_kadaara_mistress_condition_remembersPlayer (obj_id player, obj_id npc)
|
|
{
|
|
return ( utils.hasScriptVar( player, "metNewbiePilot" ));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean greeter_kadaara_mistress_condition_isAnImperialPilot (obj_id player, obj_id npc)
|
|
{
|
|
return space_flags.isImperialPilot(player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean greeter_kadaara_mistress_condition_isARebelPilot (obj_id player, obj_id npc)
|
|
{
|
|
return space_flags.isRebelPilot(player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean greeter_kadaara_mistress_condition_isPrivateerPilot (obj_id player, obj_id npc)
|
|
{
|
|
return space_flags.isNeutralPilot(player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean greeter_kadaara_mistress_condition_hasSpaceExpansion (obj_id player, obj_id npc)
|
|
{
|
|
return ( features.isSpaceEdition( player ) );
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean greeter_kadaara_mistress_condition_hasSpaceShip (obj_id player, obj_id npc)
|
|
{
|
|
return ( space_quest.hasShip( player ) );
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void greeter_kadaara_mistress_action_rememberPlayer (obj_id player, obj_id npc)
|
|
{
|
|
utils.setScriptVar( player, "metNewbiePilot", true );
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void greeter_kadaara_mistress_action_grantQuestOne (obj_id player, obj_id npc)
|
|
{
|
|
space_quest.grantQuest ( player, "delivery", "tatooine_newbie_1");
|
|
space_quest.grantNewbieShip( player, "rebel");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int greeter_kadaara_mistress_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE] Generic Greeting. First time meeting player.
|
|
//-- NPC: I don't think Jaden wants me talking to you...
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Who? Him?
|
|
if (response == "s_96dd8566")
|
|
{
|
|
//-- [NOTE]
|
|
if (greeter_kadaara_mistress_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Tell me. What sort of equipment do you fly?
|
|
string_id message = new string_id (c_stringFile, "s_ea09eddd");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Only the best!
|
|
boolean hasResponse0 = false;
|
|
if (greeter_kadaara_mistress_condition_hasSpaceShip (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Just what I can afford.
|
|
boolean hasResponse1 = false;
|
|
if (greeter_kadaara_mistress_condition_hasSpaceShip (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I don't have a starship.
|
|
boolean hasResponse2 = false;
|
|
if (greeter_kadaara_mistress_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_170ed80d");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_e05e22e2");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_d88625cb");
|
|
|
|
setObjVar (player, "conversation.greeter_kadaara_mistress.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.greeter_kadaara_mistress.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: We're not talking.
|
|
if (response == "s_d14f41b0")
|
|
{
|
|
//-- [NOTE]
|
|
if (greeter_kadaara_mistress_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "laugh_titter");
|
|
|
|
//-- NPC: No, I guess not.
|
|
string_id message = new string_id (c_stringFile, "s_126a14e0");
|
|
removeObjVar (player, "conversation.greeter_kadaara_mistress.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I understand.
|
|
if (response == "s_9288900f")
|
|
{
|
|
//-- [NOTE]
|
|
if (greeter_kadaara_mistress_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "bow");
|
|
|
|
//-- NPC: Farewell.
|
|
string_id message = new string_id (c_stringFile, "s_c8f2f3db");
|
|
removeObjVar (player, "conversation.greeter_kadaara_mistress.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int greeter_kadaara_mistress_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Tell me. What sort of equipment do you fly?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Only the best!
|
|
if (response == "s_170ed80d")
|
|
{
|
|
//-- [NOTE]
|
|
if (greeter_kadaara_mistress_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod_head_once");
|
|
|
|
//-- NPC: I know the feeling!
|
|
string_id message = new string_id (c_stringFile, "s_77266474");
|
|
removeObjVar (player, "conversation.greeter_kadaara_mistress.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Just what I can afford.
|
|
if (response == "s_e05e22e2")
|
|
{
|
|
//-- [NOTE]
|
|
if (greeter_kadaara_mistress_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod_head_once");
|
|
|
|
//-- NPC: That's very wise.
|
|
string_id message = new string_id (c_stringFile, "s_b7b44868");
|
|
removeObjVar (player, "conversation.greeter_kadaara_mistress.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't have a starship.
|
|
if (response == "s_d88625cb")
|
|
{
|
|
//-- [NOTE]
|
|
if (greeter_kadaara_mistress_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "wave_on_dismissing");
|
|
|
|
//-- NPC: Then we've got nothing more to discuss.
|
|
string_id message = new string_id (c_stringFile, "s_56866a7");
|
|
removeObjVar (player, "conversation.greeter_kadaara_mistress.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.greeter_kadaara_mistress");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable( self, true );
|
|
setCondition( self, CONDITION_SPACE_INTERESTING );
|
|
//setName (self, "Gi'a Pei");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable( self, true );
|
|
setCondition( self, CONDITION_SPACE_INTERESTING );
|
|
//setName (self, "Gi'a Pei");
|
|
|
|
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);
|
|
setInvulnerable(self, true);
|
|
faceTo( self, player );
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnIncapacitated (obj_id killer)
|
|
{
|
|
clearCondition (self, CONDITION_CONVERSABLE);
|
|
detachScript (self, "conversation.greeter_kadaara_mistress");
|
|
|
|
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] Generic Greeting. First time meeting player.
|
|
if (greeter_kadaara_mistress_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "greet");
|
|
|
|
//-- NPC: I don't think Jaden wants me talking to you...
|
|
string_id message = new string_id (c_stringFile, "s_27c7d0ac");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Who? Him?
|
|
boolean hasResponse0 = false;
|
|
if (greeter_kadaara_mistress_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: We're not talking.
|
|
boolean hasResponse1 = false;
|
|
if (greeter_kadaara_mistress_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I understand.
|
|
boolean hasResponse2 = false;
|
|
if (greeter_kadaara_mistress_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_96dd8566");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_d14f41b0");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_9288900f");
|
|
|
|
setObjVar (player, "conversation.greeter_kadaara_mistress.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "greeter_kadaara_mistress", 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 != "greeter_kadaara_mistress")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = getIntObjVar (player, "conversation.greeter_kadaara_mistress.branchId");
|
|
|
|
if (branchId == 1 && greeter_kadaara_mistress_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && greeter_kadaara_mistress_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
removeObjVar (player, "conversation.greeter_kadaara_mistress.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|