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

703 lines
21 KiB
Plaintext

// ======================================================================
//
// ep3_trandoshan_ysith.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// Created with SwgConversationEditor 1.30 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.groundquests;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/ep3_trandoshan_ysith";
// ======================================================================
// Script Conditions
// ======================================================================
boolean ep3_trandoshan_ysith_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean ep3_trandoshan_ysith_condition_taskActive (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "ep3_trando_ysith", "myssithKilled");
}
// ----------------------------------------------------------------------
boolean ep3_trandoshan_ysith_condition_isOnQuest (obj_id player, obj_id npc)
{
return groundquests.isQuestActive(player, "ep3_trando_ysith");
}
// ----------------------------------------------------------------------
boolean ep3_trandoshan_ysith_condition_hasCompletedMission (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "ep3_trando_ysith");
}
// ======================================================================
// Script Actions
// ======================================================================
void ep3_trandoshan_ysith_action_giveQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "ep3_trando_ysith");
}
// ----------------------------------------------------------------------
void ep3_trandoshan_ysith_action_doSignal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "giveYsithReward");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int ep3_trandoshan_ysith_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: So have you managed to kill my sister yet?
//-- [RESPONSE NOTE]
//-- PLAYER: Your sister!
if (response == "s_1452")
{
//-- [NOTE]
if (ep3_trandoshan_ysith_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shrug_hands");
//-- NPC: Of course, who did you think Myssith was? Why do you think my father refused to let me kill her. So is she dead or what?
string_id message = new string_id (c_stringFile, "s_1454");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes...yeah she is dead.
boolean hasResponse0 = false;
if (ep3_trandoshan_ysith_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_1456");
utils.setScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_trandoshan_ysith_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Of course, who did you think Myssith was? Why do you think my father refused to let me kill her. So is she dead or what?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes...yeah she is dead.
if (response == "s_1456")
{
//-- [NOTE]
if (ep3_trandoshan_ysith_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "celebrate");
ep3_trandoshan_ysith_action_doSignal (player, npc);
//-- NPC: Good. You have done me a great favor and, as promised, here is your reward. Now if you will excuse me...I need to break this terrible news to my father. Oh...don't worry...your name will not come up.
string_id message = new string_id (c_stringFile, "s_1458");
utils.removeScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_trandoshan_ysith_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Is Myssith dead?
//-- [RESPONSE NOTE]
//-- PLAYER: No, I haven't killed her yet.
if (response == "s_1462")
{
//-- [NOTE]
if (ep3_trandoshan_ysith_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "wave_on_dismissing");
//-- NPC: Well, what are you waiting for. She is still in Kkowir and, if I know her, causing all sorts of trouble for me.
string_id message = new string_id (c_stringFile, "s_1464");
utils.removeScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_trandoshan_ysith_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Greetings, stranger. We seem to have attracted quite a lot of attention lately. Are you here on business, pleasure, or, perhaps, both?
//-- [RESPONSE NOTE]
//-- PLAYER: I am just out looking for work.
if (response == "s_1468")
{
//-- [NOTE]
if (ep3_trandoshan_ysith_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "rub_chin_thoughtful");
//-- NPC: Ah, work. Perhaps, if you are not picky, I would have a job that might suit your tastes. You see, I have this problem with a certain rival of mine. I am trying to set up my own operation here on Kashyyyk but every time I start, Myssith comes along and ruins it. She has already cost me a small fortune.
string_id message = new string_id (c_stringFile, "s_1470");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What is it she does?
boolean hasResponse0 = false;
if (ep3_trandoshan_ysith_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_1472");
utils.setScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_trandoshan_ysith_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Ah, work. Perhaps, if you are not picky, I would have a job that might suit your tastes. You see, I have this problem with a certain rival of mine. I am trying to set up my own operation here on Kashyyyk but every time I start, Myssith comes along and ruins it. She has already cost me a small fortune.
//-- [RESPONSE NOTE]
//-- PLAYER: What is it she does?
if (response == "s_1472")
{
//-- [NOTE]
if (ep3_trandoshan_ysith_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
//-- NPC: She jumps in and takes Wookiees from my claimed areas. She has set upon my slavers no fewer than three times. Always taking what they have spent weeks capturing. Myssith is nothing but a nuisance that needs to be done away with.
string_id message = new string_id (c_stringFile, "s_1474");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I thought Trandoshans handled those matters themselves?
boolean hasResponse0 = false;
if (ep3_trandoshan_ysith_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_1476");
utils.setScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_trandoshan_ysith_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: She jumps in and takes Wookiees from my claimed areas. She has set upon my slavers no fewer than three times. Always taking what they have spent weeks capturing. Myssith is nothing but a nuisance that needs to be done away with.
//-- [RESPONSE NOTE]
//-- PLAYER: I thought Trandoshans handled those matters themselves?
if (response == "s_1476")
{
//-- [NOTE]
if (ep3_trandoshan_ysith_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: Normally, I would happily split her in two myself, but my clan chieftain has forbidden me to take any actions against her. Therefore, I am forced to beg the assistance of outsiders to get rid of Myssith for me. Naturally, I will pay you for your service.
string_id message = new string_id (c_stringFile, "s_1478");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Ok, where can I find her?
boolean hasResponse0 = false;
if (ep3_trandoshan_ysith_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Sorry, but I am not an assassin.
boolean hasResponse1 = false;
if (ep3_trandoshan_ysith_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_1480");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1484");
utils.setScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_trandoshan_ysith_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Normally, I would happily split her in two myself, but my clan chieftain has forbidden me to take any actions against her. Therefore, I am forced to beg the assistance of outsiders to get rid of Myssith for me. Naturally, I will pay you for your service.
//-- [RESPONSE NOTE]
//-- PLAYER: Ok, where can I find her?
if (response == "s_1480")
{
//-- [NOTE]
if (ep3_trandoshan_ysith_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "celebrate1");
ep3_trandoshan_ysith_action_giveQuest (player, npc);
//-- NPC: How delightful. You do not know how much this means to me. I have heard that she is out hunting in the Kkowir forest near the abandoned Imperial facility there. Go find her and make sure she doesn't bother me anymore.
string_id message = new string_id (c_stringFile, "s_1482");
utils.removeScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Sorry, but I am not an assassin.
if (response == "s_1484")
{
//-- [NOTE]
if (ep3_trandoshan_ysith_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "wave_on_dismissing");
//-- NPC: Bah...I should have known that you would have no stomach for such a job.
string_id message = new string_id (c_stringFile, "s_1486");
utils.removeScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.ep3_trandoshan_ysith");
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable( self, true );
setCondition( self, CONDITION_INTERESTING );
setName(self, "Ysith");
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable( self, true );
setCondition( self, CONDITION_INTERESTING );
setName(self, "Ysith");
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);
faceTo(self, player);
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.ep3_trandoshan_ysith");
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_trandoshan_ysith_condition_hasCompletedMission (player, npc))
{
doAnimationAction (npc, "goodbye");
//-- NPC: Thank you again for disposing of my troublesome sister. I cannot thank you enough. But I cannot chat right now, so you must excuse me.
string_id message = new string_id (c_stringFile, "s_1448");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_trandoshan_ysith_condition_taskActive (player, npc))
{
doAnimationAction (npc, "nervous");
//-- NPC: So have you managed to kill my sister yet?
string_id message = new string_id (c_stringFile, "s_1450");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Your sister!
boolean hasResponse0 = false;
if (ep3_trandoshan_ysith_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_1452");
utils.setScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId", 2);
npcStartConversation (player, npc, "ep3_trandoshan_ysith", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_trandoshan_ysith_condition_isOnQuest (player, npc))
{
doAnimationAction (npc, "nervous");
//-- NPC: Is Myssith dead?
string_id message = new string_id (c_stringFile, "s_1460");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: No, I haven't killed her yet.
boolean hasResponse0 = false;
if (ep3_trandoshan_ysith_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_1462");
utils.setScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId", 5);
npcStartConversation (player, npc, "ep3_trandoshan_ysith", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_trandoshan_ysith_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "beckon");
//-- NPC: Greetings, stranger. We seem to have attracted quite a lot of attention lately. Are you here on business, pleasure, or, perhaps, both?
string_id message = new string_id (c_stringFile, "s_1466");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I am just out looking for work.
boolean hasResponse0 = false;
if (ep3_trandoshan_ysith_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_1468");
utils.setScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId", 7);
npcStartConversation (player, npc, "ep3_trandoshan_ysith", 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 != "ep3_trandoshan_ysith")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.ep3_trandoshan_ysith.branchId");
if (branchId == 2 && ep3_trandoshan_ysith_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && ep3_trandoshan_ysith_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && ep3_trandoshan_ysith_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && ep3_trandoshan_ysith_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && ep3_trandoshan_ysith_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && ep3_trandoshan_ysith_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && ep3_trandoshan_ysith_handleBranch10 (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_trandoshan_ysith.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================