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

617 lines
18 KiB
Plaintext

// ======================================================================
//
// rtp_luke_main.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.factions;
include library.groundquests;
include library.space_quest;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/rtp_luke_main";
// ======================================================================
// Script Conditions
// ======================================================================
boolean rtp_luke_main_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean rtp_luke_main_condition_rtp_luke_01_active (obj_id player, obj_id npc)
{
return groundquests.isQuestActive(player, "rtp_luke_01");
}
// ----------------------------------------------------------------------
boolean rtp_luke_main_condition_rtp_luke_01_complete (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "rtp_luke_01", "rtp_luke_01_02") ||
groundquests.hasCompletedQuest(player, "rtp_luke_01");
}
// ----------------------------------------------------------------------
boolean rtp_luke_main_condition_rtp_luke_02_active (obj_id player, obj_id npc)
{
return groundquests.isQuestActive(player, "rtp_luke_02");
}
// ----------------------------------------------------------------------
boolean rtp_luke_main_condition_rtp_luke_03_complete (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "rtp_luke_03", "rtp_luke_03_02") ||
groundquests.hasCompletedQuest(player, "rtp_luke_03");
}
// ----------------------------------------------------------------------
boolean rtp_luke_main_condition_rtp_luke_03_active (obj_id player, obj_id npc)
{
return groundquests.isQuestActive(player, "rtp_luke_03");
}
// ----------------------------------------------------------------------
boolean rtp_luke_main_condition_rtp_luke_02_complete (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "rtp_luke_02", "rtp_luke_02_02") ||
groundquests.hasCompletedQuest(player, "rtp_luke_02");
}
// ----------------------------------------------------------------------
boolean rtp_luke_main_condition_completedDodonna (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "rtp_dodonna_03");
}
// ----------------------------------------------------------------------
boolean rtp_luke_main_condition_notRebel (obj_id player, obj_id npc)
{
string playerFaction = factions.getFaction(player);
if ( playerFaction == null || !playerFaction.equals("Rebel") )
{
return true;
}
return false;
}
// ======================================================================
// Script Actions
// ======================================================================
void rtp_luke_main_action_rtp_luke_01_granted (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "rtp_luke_01");
}
// ----------------------------------------------------------------------
void rtp_luke_main_action_rtp_luke_01_signal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "rtp_luke_01_02");
}
// ----------------------------------------------------------------------
void rtp_luke_main_action_rtp_luke_03_signal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "rtp_luke_03_02");
}
// ----------------------------------------------------------------------
void rtp_luke_main_action_rtp_luke_02_signal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "rtp_luke_02_02");
}
// ----------------------------------------------------------------------
void rtp_luke_main_action_rtp_luke_02_granted (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "rtp_luke_02");
}
// ----------------------------------------------------------------------
void rtp_luke_main_action_rtp_luke_03_granted (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "rtp_luke_03");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int rtp_luke_main_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The woolamanders attacked? Interesting. I think that might be due to all of the dark Force energies that pervade this moon. Let's show the woolamanders that the Force is not always about darkness.
//-- [RESPONSE NOTE]
//-- PLAYER: What do you have in mind?
if (response == "s_31")
{
//-- [NOTE]
if (rtp_luke_main_condition__defaultCondition (player, npc))
{
rtp_luke_main_action_rtp_luke_03_granted (player, npc);
//-- NPC: Return to the Woolamander Temple and use the Force crystal to heal some dying plants there.
string_id message = new string_id (c_stringFile, "s_33");
utils.removeScriptVar (player, "conversation.rtp_luke_main.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No thank you.
if (response == "s_35")
{
//-- [NOTE]
if (rtp_luke_main_condition__defaultCondition (player, npc))
{
//-- NPC: Very well.
string_id message = new string_id (c_stringFile, "s_37");
utils.removeScriptVar (player, "conversation.rtp_luke_main.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int rtp_luke_main_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: This one is a bit raw, but it should work nicely. There is a strange altar at the Woolamander Temple that has a connection of some sort to the Force. Go there.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm on my way.
if (response == "s_22")
{
//-- [NOTE]
if (rtp_luke_main_condition__defaultCondition (player, npc))
{
rtp_luke_main_action_rtp_luke_02_granted (player, npc);
//-- NPC: Once you get to the Woolamander Temple, place the Force crystal onto the atlar and find out what happens.
string_id message = new string_id (c_stringFile, "s_25");
utils.removeScriptVar (player, "conversation.rtp_luke_main.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No thank you.
if (response == "s_26")
{
//-- [NOTE]
if (rtp_luke_main_condition__defaultCondition (player, npc))
{
//-- NPC: Very well.
string_id message = new string_id (c_stringFile, "s_30");
utils.removeScriptVar (player, "conversation.rtp_luke_main.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int rtp_luke_main_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Greetings. I'm trying to learn more about the Force, and I was wondering if you'd help?
//-- [RESPONSE NOTE]
//-- PLAYER: I would be glad to help.
if (response == "s_36")
{
//-- [NOTE]
if (rtp_luke_main_condition__defaultCondition (player, npc))
{
rtp_luke_main_action_rtp_luke_01_granted (player, npc);
//-- NPC: Ah good. Well, first, go into this temple, the Temple of Exar Kun, and get a Force crystal.
string_id message = new string_id (c_stringFile, "s_39");
utils.removeScriptVar (player, "conversation.rtp_luke_main.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No thank you.
if (response == "s_41")
{
//-- [NOTE]
if (rtp_luke_main_condition__defaultCondition (player, npc))
{
//-- NPC: Very well.
string_id message = new string_id (c_stringFile, "s_45");
utils.removeScriptVar (player, "conversation.rtp_luke_main.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.rtp_luke_main");
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);
faceTo( self, player );
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.rtp_luke_main");
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 (rtp_luke_main_condition_notRebel (player, npc))
{
//-- NPC: I don't think I should be talking to you.
string_id message = new string_id (c_stringFile, "s_44");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (!rtp_luke_main_condition_completedDodonna (player, npc))
{
//-- NPC: Have you spoken with General Dodonna? If he doesn't have any orders for you, I think he would know who does.
string_id message = new string_id (c_stringFile, "s_46");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (rtp_luke_main_condition_rtp_luke_03_complete (player, npc))
{
rtp_luke_main_action_rtp_luke_03_signal (player, npc);
//-- NPC: Thank you. Hopefully as I learn more about the Force, I'll be able to do more to relieve some of the ills that the dark-side has bred throughout the galaxy.
string_id message = new string_id (c_stringFile, "s_9");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (rtp_luke_main_condition_rtp_luke_03_active (player, npc))
{
//-- NPC: Let's show the woolamanders that the Force is not always about darkness. Return to the Woolamander Temple and use the Force crystal to heal some dying plants there.
string_id message = new string_id (c_stringFile, "s_29");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (rtp_luke_main_condition_rtp_luke_02_complete (player, npc))
{
rtp_luke_main_action_rtp_luke_02_signal (player, npc);
//-- NPC: The woolamanders attacked? Interesting. I think that might be due to all of the dark Force energies that pervade this moon. Let's show the woolamanders that the Force is not always about darkness.
string_id message = new string_id (c_stringFile, "s_28");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What do you have in mind?
boolean hasResponse0 = false;
if (rtp_luke_main_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No thank you.
boolean hasResponse1 = false;
if (rtp_luke_main_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_31");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_35");
utils.setScriptVar (player, "conversation.rtp_luke_main.branchId", 5);
npcStartConversation (player, npc, "rtp_luke_main", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (rtp_luke_main_condition_rtp_luke_02_active (player, npc))
{
//-- NPC: At the Woolamander Temple is a strange altar with some kind of connection to the Force. Go place the crystal you found in the Temple of Exar Kun onto that altar and find out what, if anything, happens.
string_id message = new string_id (c_stringFile, "s_16");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (rtp_luke_main_condition_rtp_luke_01_complete (player, npc))
{
rtp_luke_main_action_rtp_luke_01_signal (player, npc);
//-- NPC: This one is a bit raw, but it should work nicely. There is a strange altar at the Woolamander Temple that has a connection of some sort to the Force. Go there.
string_id message = new string_id (c_stringFile, "s_20");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm on my way.
boolean hasResponse0 = false;
if (rtp_luke_main_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No thank you.
boolean hasResponse1 = false;
if (rtp_luke_main_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_22");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_26");
utils.setScriptVar (player, "conversation.rtp_luke_main.branchId", 9);
npcStartConversation (player, npc, "rtp_luke_main", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (rtp_luke_main_condition_rtp_luke_01_active (player, npc))
{
//-- NPC: Go into the Temple of Exar Kun and get a Force crystal.
string_id message = new string_id (c_stringFile, "s_32");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (rtp_luke_main_condition__defaultCondition (player, npc))
{
//-- NPC: Greetings. I'm trying to learn more about the Force, and I was wondering if you'd help?
string_id message = new string_id (c_stringFile, "s_34");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would be glad to help.
boolean hasResponse0 = false;
if (rtp_luke_main_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No thank you.
boolean hasResponse1 = false;
if (rtp_luke_main_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_36");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_41");
utils.setScriptVar (player, "conversation.rtp_luke_main.branchId", 13);
npcStartConversation (player, npc, "rtp_luke_main", 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 != "rtp_luke_main")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.rtp_luke_main.branchId");
if (branchId == 5 && rtp_luke_main_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && rtp_luke_main_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && rtp_luke_main_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.rtp_luke_main.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================