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

503 lines
14 KiB
Plaintext

// ======================================================================
//
// ep3_myyydril_refugee.script
//
//
//
// Created with SwgConversationEditor 1.34 - 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_myyydril_refugee";
// ======================================================================
// Script Conditions
// ======================================================================
boolean ep3_myyydril_refugee_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean ep3_myyydril_refugee_condition_isTaskActiveOne (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive(player, "ep3_myyydril_rensalla_1", 0) ||
groundquests.hasCompletedTask(player, "ep3_myyydril_rensalla_1", 0))
return true;
else
return false;
}
// ----------------------------------------------------------------------
boolean ep3_myyydril_refugee_condition_Questdone (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "ep3_myyydril_rensalla_1");
}
// ======================================================================
// Script Actions
// ======================================================================
void ep3_myyydril_refugee_action_giveSignal2 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "finddagger");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int ep3_myyydril_refugee_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You're back? I thought we made it clear that you should leave before you get hurt?
//-- [RESPONSE NOTE]
//-- PLAYER: So tough.
if (response == "s_720")
{
//-- [NOTE]
if (ep3_myyydril_refugee_condition__defaultCondition (player, npc))
{
//-- NPC: Want to try me, kid? Now, get out of here!
string_id message = new string_id (c_stringFile, "s_723");
utils.removeScriptVar (player, "conversation.ep3_myyydril_refugee.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_refugee_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What do you want? [Ren'Salla starts accusingly.]
//-- [RESPONSE NOTE]
//-- PLAYER: I found your runestone. Here.
if (response == "s_728")
{
//-- [NOTE]
if (ep3_myyydril_refugee_condition__defaultCondition (player, npc))
{
ep3_myyydril_refugee_action_giveSignal2 (player, npc);
//-- NPC: This old thing? Pfft. I threw that at a Urnsor'is a long time ago. [Ren'Salla stares you down.] It's the thought that counts, though, right? [She shrugs.] You can have this, then.
string_id message = new string_id (c_stringFile, "s_731");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thanks!
boolean hasResponse0 = false;
if (ep3_myyydril_refugee_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_734");
utils.setScriptVar (player, "conversation.ep3_myyydril_refugee.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_myyydril_refugee.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_refugee_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: This old thing? Pfft. I threw that at a Urnsor'is a long time ago. [Ren'Salla stares you down.] It's the thought that counts, though, right? [She shrugs.] You can have this, then.
//-- [RESPONSE NOTE]
//-- PLAYER: Thanks!
if (response == "s_734")
{
//-- [NOTE]
if (ep3_myyydril_refugee_condition__defaultCondition (player, npc))
{
//-- NPC: Yeah. [Ren'Salla scoffs.] Now, get out of here.
string_id message = new string_id (c_stringFile, "s_737");
utils.removeScriptVar (player, "conversation.ep3_myyydril_refugee.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_refugee_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What do you want?
//-- [RESPONSE NOTE]
//-- PLAYER: I was just looking around. Who are you?
if (response == "s_742")
{
//-- [NOTE]
if (ep3_myyydril_refugee_condition__defaultCondition (player, npc))
{
//-- NPC: Ren'Salla. What's it to you?
string_id message = new string_id (c_stringFile, "s_745");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Er--what are you doing down here?
boolean hasResponse0 = false;
if (ep3_myyydril_refugee_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_747");
utils.setScriptVar (player, "conversation.ep3_myyydril_refugee.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_myyydril_refugee.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_refugee_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Ren'Salla. What's it to you?
//-- [RESPONSE NOTE]
//-- PLAYER: Er--what are you doing down here?
if (response == "s_747")
{
//-- [NOTE]
if (ep3_myyydril_refugee_condition__defaultCondition (player, npc))
{
//-- NPC: We have our reasons. [Ren'Salla looks you over.] You should probably leave before my boys get antsy. We don't like strangers.
string_id message = new string_id (c_stringFile, "s_750");
utils.removeScriptVar (player, "conversation.ep3_myyydril_refugee.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_myyydril_refugee");
setCondition (self, CONDITION_CONVERSABLE);
setName (self, new string_id( "ep3/npc_names", "rensalla" ));
setInvulnerable(self, true);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setName (self, new string_id( "ep3/npc_names", "rensalla" ));
setInvulnerable(self, true);
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_myyydril_refugee");
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_myyydril_refugee_condition_Questdone (player, npc))
{
//-- NPC: You're back? I thought we made it clear that you should leave before you get hurt?
string_id message = new string_id (c_stringFile, "s_716");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So tough.
boolean hasResponse0 = false;
if (ep3_myyydril_refugee_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_720");
utils.setScriptVar (player, "conversation.ep3_myyydril_refugee.branchId", 1);
npcStartConversation (player, npc, "ep3_myyydril_refugee", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_myyydril_refugee_condition_isTaskActiveOne (player, npc))
{
//-- NPC: What do you want? [Ren'Salla starts accusingly.]
string_id message = new string_id (c_stringFile, "s_726");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I found your runestone. Here.
boolean hasResponse0 = false;
if (ep3_myyydril_refugee_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_728");
utils.setScriptVar (player, "conversation.ep3_myyydril_refugee.branchId", 3);
npcStartConversation (player, npc, "ep3_myyydril_refugee", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_myyydril_refugee_condition__defaultCondition (player, npc))
{
//-- NPC: What do you want?
string_id message = new string_id (c_stringFile, "s_739");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I was just looking around. Who are you?
boolean hasResponse0 = false;
if (ep3_myyydril_refugee_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_742");
utils.setScriptVar (player, "conversation.ep3_myyydril_refugee.branchId", 6);
npcStartConversation (player, npc, "ep3_myyydril_refugee", 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_myyydril_refugee")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.ep3_myyydril_refugee.branchId");
if (branchId == 1 && ep3_myyydril_refugee_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && ep3_myyydril_refugee_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && ep3_myyydril_refugee_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && ep3_myyydril_refugee_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && ep3_myyydril_refugee_handleBranch7 (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_myyydril_refugee.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================