Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/marles_jacobe.script
T

454 lines
14 KiB
Plaintext

// ======================================================================
//
// marles_jacobe.script
//
//
//
// Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/marles_jacobe";
// ======================================================================
// Script Conditions
// ======================================================================
boolean marles_jacobe_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ======================================================================
// Script Actions
// ======================================================================
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int marles_jacobe_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hey there, traveler. I was wondering if I could ask you a few questions about what has been going on around here?
//-- [RESPONSE NOTE]
//-- PLAYER: Sure, I guess so.
if (response == "s_6")
{
//-- [NOTE]
if (marles_jacobe_condition__defaultCondition (player, npc))
{
//-- NPC: I am Marles Jacobe of the Corellia Times. I am investigating the military buildup here in Restuss. It has already caused the entire city to be evacuated, displacing thousands of families. And with tensions running high there is sure to be a showdown. What are your thoughts on this whole situation?
string_id message = new string_id (c_stringFile, "s_8");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I am not too familiar with what is going on.
boolean hasResponse0 = false;
if (marles_jacobe_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I think it is...bad?
boolean hasResponse1 = false;
if (marles_jacobe_condition__defaultCondition (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_10");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_22");
utils.setScriptVar (player, "conversation.marles_jacobe.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.marles_jacobe.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No thanks. In too much of a hurry.
if (response == "s_26")
{
//-- [NOTE]
if (marles_jacobe_condition__defaultCondition (player, npc))
{
//-- NPC: Understood. The battle brewing and all. You had better be off.
string_id message = new string_id (c_stringFile, "s_28");
utils.removeScriptVar (player, "conversation.marles_jacobe.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int marles_jacobe_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I am Marles Jacobe of the Corellia Times. I am investigating the military buildup here in Restuss. It has already caused the entire city to be evacuated, displacing thousands of families. And with tensions running high there is sure to be a showdown. What are your thoughts on this whole situation?
//-- [RESPONSE NOTE]
//-- PLAYER: I am not too familiar with what is going on.
if (response == "s_10")
{
//-- [NOTE]
if (marles_jacobe_condition__defaultCondition (player, npc))
{
//-- NPC: So you haven't heard that the Empire is supposedly building a top secret power cell within Restuss. Rumor has it that this cell has enough stored energy to power an entire Star Destroyer, but small enough to fit into a backpack. My sources have also informed me that the Rebel Alliance is planning an assault on the city to steal this new technology, something the Empire will not stand for. Comments?
string_id message = new string_id (c_stringFile, "s_12");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: How do you know your sources are correct?
boolean hasResponse0 = false;
if (marles_jacobe_condition__defaultCondition (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_14");
utils.setScriptVar (player, "conversation.marles_jacobe.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.marles_jacobe.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I think it is...bad?
if (response == "s_22")
{
//-- [NOTE]
if (marles_jacobe_condition__defaultCondition (player, npc))
{
//-- NPC: ...Great. Can I quote you on that?
string_id message = new string_id (c_stringFile, "s_24");
utils.removeScriptVar (player, "conversation.marles_jacobe.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int marles_jacobe_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: So you haven't heard that the Empire is supposedly building a top secret power cell within Restuss. Rumor has it that this cell has enough stored energy to power an entire Star Destroyer, but small enough to fit into a backpack. My sources have also informed me that the Rebel Alliance is planning an assault on the city to steal this new technology, something the Empire will not stand for. Comments?
//-- [RESPONSE NOTE]
//-- PLAYER: How do you know your sources are correct?
if (response == "s_14")
{
//-- [NOTE]
if (marles_jacobe_condition__defaultCondition (player, npc))
{
//-- NPC: I cannot comment on the status of my sources. But I will say that there are signs of a major military buildup by the Empire. Their officials have been quoted as saying it is a security force sent in to protect the city of Restuss. If that is the case, then why have they quarantined Restuss? And if rumors are true, the Rebels have also begun establishing a base somewhere near Restuss.
string_id message = new string_id (c_stringFile, "s_16");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: It certainly sounds like a battle is brewing.
boolean hasResponse0 = false;
if (marles_jacobe_condition__defaultCondition (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_18");
utils.setScriptVar (player, "conversation.marles_jacobe.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.marles_jacobe.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int marles_jacobe_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I cannot comment on the status of my sources. But I will say that there are signs of a major military buildup by the Empire. Their officials have been quoted as saying it is a security force sent in to protect the city of Restuss. If that is the case, then why have they quarantined Restuss? And if rumors are true, the Rebels have also begun establishing a base somewhere near Restuss.
//-- [RESPONSE NOTE]
//-- PLAYER: It certainly sounds like a battle is brewing.
if (response == "s_18")
{
//-- [NOTE]
if (marles_jacobe_condition__defaultCondition (player, npc))
{
//-- NPC: Of course there will be a battle. I wouldn't be here if there was going to be a peaceful solution. Marles Jacobe is where the story is.
string_id message = new string_id (c_stringFile, "s_20");
utils.removeScriptVar (player, "conversation.marles_jacobe.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.marles_jacobe");
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable (self, true);
setCondition( self, CONDITION_INTERESTING );
setName (self, "Marles Jacobe");
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable (self, true);
setCondition( self, CONDITION_INTERESTING );
setName (self, "Marles Jacobe");
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.marles_jacobe");
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 (marles_jacobe_condition__defaultCondition (player, npc))
{
//-- NPC: Hey there, traveler. I was wondering if I could ask you a few questions about what has been going on around here?
string_id message = new string_id (c_stringFile, "s_4");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Sure, I guess so.
boolean hasResponse0 = false;
if (marles_jacobe_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No thanks. In too much of a hurry.
boolean hasResponse1 = false;
if (marles_jacobe_condition__defaultCondition (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_6");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_26");
utils.setScriptVar (player, "conversation.marles_jacobe.branchId", 1);
npcStartConversation (player, npc, "marles_jacobe", 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 != "marles_jacobe")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.marles_jacobe.branchId");
if (branchId == 1 && marles_jacobe_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && marles_jacobe_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && marles_jacobe_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && marles_jacobe_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.marles_jacobe.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================