Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/ep3_belga_daeri.script
T
2013-09-10 23:17:15 -07:00

487 lines
15 KiB
Plaintext

// ======================================================================
//
// ep3_belga_daeri.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.groundquests;
include library.space_quest;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/ep3_belga_daeri";
// ======================================================================
// Script Conditions
// ======================================================================
boolean ep3_belga_daeri_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean ep3_belga_daeri_condition_canTakeDornQuest (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "ep3_stren_dorn_bounty_belga", "taskSpeakWithBelga") ||
(groundquests.hasCompletedQuest(player, "ep3_stren_dorn_bounty_belga") &&
!space_quest.hasWonQuestRecursive(player,"assassinate", "ep3_stren_dorn_lackey")));
}
// ======================================================================
// Script Actions
// ======================================================================
void ep3_belga_daeri_action_sendStrenBelgaSignal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "signalSpeakWithBelga");
}
// ----------------------------------------------------------------------
void ep3_belga_daeri_action_grantDornQuest (obj_id player, obj_id npc)
{
space_quest.clearQuestFlags(player, "assassinate", "ep3_stren_dorn_lackey");
space_quest.clearQuestFlags(player, "destroy_surpriseattack", "ep3_stren_dorn_bounty");
space_quest.grantQuest(player, "assassinate", "ep3_stren_dorn_lackey");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int ep3_belga_daeri_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What business do you have?
//-- [RESPONSE NOTE]
//-- PLAYER: I'm here to ask about a pirate.
if (response == "s_394")
{
//-- [NOTE]
if (ep3_belga_daeri_condition__defaultCondition (player, npc))
{
//-- NPC: You must be one of Stren's lackeys. Yes there is a pirate up there taking more than his fair share.
string_id message = new string_id (c_stringFile, "s_396");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Fair share?
boolean hasResponse0 = false;
if (ep3_belga_daeri_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_398");
utils.setScriptVar (player, "conversation.ep3_belga_daeri.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_belga_daeri.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_belga_daeri_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You must be one of Stren's lackeys. Yes there is a pirate up there taking more than his fair share.
//-- [RESPONSE NOTE]
//-- PLAYER: Fair share?
if (response == "s_398")
{
//-- [NOTE]
if (ep3_belga_daeri_condition__defaultCondition (player, npc))
{
//-- NPC: We do not have a lot of support from the Empire on this one, and the Trandoshans only care about their shipping lanes. Piracy is expected to be dealt with by the individuals traveling these space lanes. Normally, they don't cause too much trouble. But this one has become a problem. Not content with taking cargo, he has destroyed a number of transports in the last few weeks and shows no signs of stopping.
string_id message = new string_id (c_stringFile, "s_400");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So you want him brought in?
boolean hasResponse0 = false;
if (ep3_belga_daeri_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_402");
utils.setScriptVar (player, "conversation.ep3_belga_daeri.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_belga_daeri.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_belga_daeri_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: We do not have a lot of support from the Empire on this one, and the Trandoshans only care about their shipping lanes. Piracy is expected to be dealt with by the individuals traveling these space lanes. Normally, they don't cause too much trouble. But this one has become a problem. Not content with taking cargo, he has destroyed a number of transports in the last few weeks and shows no signs of stopping.
//-- [RESPONSE NOTE]
//-- PLAYER: So you want him brought in?
if (response == "s_402")
{
//-- [NOTE]
if (ep3_belga_daeri_condition__defaultCondition (player, npc))
{
//-- NPC: Brought in? And where would I put him? No, just destroyed will suffice.
string_id message = new string_id (c_stringFile, "s_404");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Then destroyed it will be. Where can I find this Dorn?
boolean hasResponse0 = false;
if (ep3_belga_daeri_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_406");
utils.setScriptVar (player, "conversation.ep3_belga_daeri.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_belga_daeri.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_belga_daeri_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Brought in? And where would I put him? No, just destroyed will suffice.
//-- [RESPONSE NOTE]
//-- PLAYER: Then destroyed it will be. Where can I find this Dorn?
if (response == "s_406")
{
//-- [NOTE]
if (ep3_belga_daeri_condition__defaultCondition (player, npc))
{
//-- NPC: He operates in Kashyyyk space but does not reside here. If you take down some of his lackeys then eventually he will come looking for you.
string_id message = new string_id (c_stringFile, "s_408");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Do you have a lead?
boolean hasResponse0 = false;
if (ep3_belga_daeri_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_410");
utils.setScriptVar (player, "conversation.ep3_belga_daeri.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_belga_daeri.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_belga_daeri_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: He operates in Kashyyyk space but does not reside here. If you take down some of his lackeys then eventually he will come looking for you.
//-- [RESPONSE NOTE]
//-- PLAYER: Do you have a lead?
if (response == "s_410")
{
//-- [NOTE]
if (ep3_belga_daeri_condition__defaultCondition (player, npc))
{
ep3_belga_daeri_action_grantDornQuest (player, npc);
//-- NPC: I will provide you with a transponder signal for his suspected cohorts. The rest is up to you.
string_id message = new string_id (c_stringFile, "s_412");
utils.removeScriptVar (player, "conversation.ep3_belga_daeri.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.ep3_belga_daeri");
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, "conversation.ep3_belga_daeri");
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_belga_daeri_condition_canTakeDornQuest (player, npc))
{
ep3_belga_daeri_action_sendStrenBelgaSignal (player, npc);
//-- NPC: What business do you have?
string_id message = new string_id (c_stringFile, "s_392");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm here to ask about a pirate.
boolean hasResponse0 = false;
if (ep3_belga_daeri_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_394");
utils.setScriptVar (player, "conversation.ep3_belga_daeri.branchId", 1);
npcStartConversation (player, npc, "ep3_belga_daeri", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_belga_daeri_condition__defaultCondition (player, npc))
{
//-- NPC: Be careful if you approach the river to the north, you might find yourself in a Wookiee and Trandoshan battle.
string_id message = new string_id (c_stringFile, "s_414");
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_belga_daeri")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.ep3_belga_daeri.branchId");
if (branchId == 1 && ep3_belga_daeri_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && ep3_belga_daeri_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && ep3_belga_daeri_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && ep3_belga_daeri_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && ep3_belga_daeri_handleBranch5 (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_belga_daeri.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================