mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
370 lines
12 KiB
Plaintext
370 lines
12 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// quharek_phase_4.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;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/quharek_phase_4";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean quharek_phase_4_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "npc.conversation.quharek_phase_4");
|
|
|
|
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.quharek_phase_4");
|
|
|
|
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 (quharek_phase_4_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Hi. How go things?
|
|
string_id message = new string_id (c_stringFile, "s_c3af3465");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: It's going well. I have learned a lot.
|
|
boolean hasResponse0 = false;
|
|
if (quharek_phase_4_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Do you have any other tasks for me?
|
|
boolean hasResponse1 = false;
|
|
if (quharek_phase_4_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_30920b89");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c9211a00");
|
|
|
|
setObjVar (player, "conversation.quharek_phase_4.branchId", 1);
|
|
|
|
npcStartConversation (player, self, "quharek_phase_4", message, responses);
|
|
}
|
|
else
|
|
{
|
|
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 != "quharek_phase_4")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
int branchId = getIntObjVar (player, "conversation.quharek_phase_4.branchId");
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Hi. How go things?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: It's going well. I have learned a lot.
|
|
if (branchId == 1 && response == "s_30920b89")
|
|
{
|
|
//-- [NOTE]
|
|
if (quharek_phase_4_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Good! I am glad we have had some small part in your self-realization and growth. One of the greatest things a sapient can do on their path of life is to enhance the well being of other sapient beings.
|
|
string_id message = new string_id (c_stringFile, "s_1fcf4289");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I agree. I hope I can return the favor someday.
|
|
boolean hasResponse0 = false;
|
|
if (quharek_phase_4_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Wow, that's pretty sappy!
|
|
boolean hasResponse1 = false;
|
|
if (quharek_phase_4_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_8a61b230");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_46847c8d");
|
|
|
|
setObjVar (player, "conversation.quharek_phase_4.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.quharek_phase_4.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Hi. How go things?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Hi. How go things?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Do you have any other tasks for me?
|
|
if (branchId == 1 && response == "s_c9211a00")
|
|
{
|
|
//-- [NOTE]
|
|
if (quharek_phase_4_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: No. Our new Chief engineer is handling all new crafting tasks.
|
|
string_id message = new string_id (c_stringFile, "s_55ff471a");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Where can I find the Chief engineer?
|
|
boolean hasResponse0 = false;
|
|
if (quharek_phase_4_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_f3f4fde4");
|
|
|
|
setObjVar (player, "conversation.quharek_phase_4.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.quharek_phase_4.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Hi. How go things?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Good! I am glad we have had some small part in your self-realization and growth. One of the greatest things a sapient can do on their path of life is to enhance the well being of other sapient beings.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I agree. I hope I can return the favor someday.
|
|
if (branchId == 2 && response == "s_8a61b230")
|
|
{
|
|
//-- [NOTE]
|
|
if (quharek_phase_4_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Personally, I'd be happier if you directed that assistance to others not in this camp. We tend to do ok for ourselves even out in the desolate wilderness. There are those that are still far more in need of help than us.
|
|
string_id message = new string_id (c_stringFile, "s_4909db59");
|
|
removeObjVar (player, "conversation.quharek_phase_4.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Good! I am glad we have had some small part in your self-realization and growth. One of the greatest things a sapient can do on their path of life is to enhance the well being of other sapient beings.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Good! I am glad we have had some small part in your self-realization and growth. One of the greatest things a sapient can do on their path of life is to enhance the well being of other sapient beings.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Wow, that's pretty sappy!
|
|
if (branchId == 2 && response == "s_46847c8d")
|
|
{
|
|
//-- [NOTE]
|
|
if (quharek_phase_4_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Perhaps your 'self-realization and growth' wasn't as pronounced as it could have been. Good wishes to you friend.
|
|
string_id message = new string_id (c_stringFile, "s_3a5501aa");
|
|
removeObjVar (player, "conversation.quharek_phase_4.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Good! I am glad we have had some small part in your self-realization and growth. One of the greatest things a sapient can do on their path of life is to enhance the well being of other sapient beings.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: No. Our new Chief engineer is handling all new crafting tasks.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Where can I find the Chief engineer?
|
|
if (branchId == 5 && response == "s_f3f4fde4")
|
|
{
|
|
//-- [NOTE]
|
|
if (quharek_phase_4_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Along the South wall near the sensor array. Good luck to you friend.
|
|
string_id message = new string_id (c_stringFile, "s_cae55dfb");
|
|
removeObjVar (player, "conversation.quharek_phase_4.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'No. Our new Chief engineer is handling all new crafting tasks.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
removeObjVar (player, "conversation.quharek_phase_4.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|