mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
884 lines
26 KiB
Plaintext
884 lines
26 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// ep3_myyydril_pers.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_pers";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean ep3_myyydril_pers_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_myyydril_pers_condition_hasSkillSmug (obj_id player, obj_id npc)
|
|
{
|
|
return hasSkill(player, "class_smuggler_phase1_novice");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_myyydril_pers_condition_isTaskActiveOne (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive(player, "ep3_myyydril_pers_retrieve_4", 0) ||
|
|
groundquests.hasCompletedTask(player, "ep3_myyydril_pers_retrieve_4", 0))
|
|
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_myyydril_pers_condition_isTaskCompleteOne (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.hasCompletedTask(player, "ep3_myyydril_pers_retrieve_4", 0) &&
|
|
!groundquests.hasCompletedQuest(player, "ep3_myyydril_pers_retrieve_4"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_myyydril_pers_condition_hasCompletedQuestOne (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "ep3_myyydril_pers_retrieve_4");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void ep3_myyydril_pers_action_giveQuestOne (obj_id player, obj_id npc)
|
|
{
|
|
// Apply the first quest to the player here
|
|
groundquests.grantQuest(player, "ep3_myyydril_pers_retrieve_4");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_myyydril_pers_action_giveSignalOne (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "giveLewtSmug");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int ep3_myyydril_pers_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Look who it is. And look who has my crate of stuff. I knew I could count on you. You're just like me in a way; smart and quick.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thanks. I expect something for my troubles.
|
|
if (response == "s_637")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
ep3_myyydril_pers_action_giveSignalOne (player, npc);
|
|
|
|
//-- NPC: Direct too. I don't blame you. Our work can yield very little at times. Besides... [ Pers shrugs.] You deserve a little something. Here. I hope you'll find some use for it.
|
|
string_id message = new string_id (c_stringFile, "s_640");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: It was a pleasure working with you.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_pers_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_643");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_pers.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_pers.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_pers_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Direct too. I don't blame you. Our work can yield very little at times. Besides... [ Pers shrugs.] You deserve a little something. Here. I hope you'll find some use for it.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: It was a pleasure working with you.
|
|
if (response == "s_643")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: And you. [Pers nods.]
|
|
string_id message = new string_id (c_stringFile, "s_645");
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_pers.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_pers_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Is anyone following you? [Pers looks around for a moment.] Doesn't seem like it. Good. You're better than I thought. What do ya got for me?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Well, I haven't got the weapons yet.
|
|
if (response == "s_650")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: That's a problem. I need them, fast. Supposedly, the Urnies are acting up again. Go out there and show me what you're made of.
|
|
string_id message = new string_id (c_stringFile, "s_685");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Right!
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_pers_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_687");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_pers.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_pers.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_pers_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: That's a problem. I need them, fast. Supposedly, the Urnies are acting up again. Go out there and show me what you're made of.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Right!
|
|
if (response == "s_687")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: [Pers slinks into the shadows.]
|
|
string_id message = new string_id (c_stringFile, "s_689");
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_pers.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_pers_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Your subtly astounds me. Yes. [Pers nods slowly.] You'd be perfect for my plans.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What plans? What--Just who are you?
|
|
if (response == "s_693")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Shh. You needn't know. You and I... We share the same... [Pers looks around, whispering.] profession. I need your help.
|
|
string_id message = new string_id (c_stringFile, "s_695");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: You're a smugg--
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_pers_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_697");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_pers.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_pers.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_pers_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Shh. You needn't know. You and I... We share the same... [Pers looks around, whispering.] profession. I need your help.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You're a smugg--
|
|
if (response == "s_697")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Shh! The Myyydril musn't know. They think I'm a chef! HA! Come closer, friend, we have much to discuss.
|
|
string_id message = new string_id (c_stringFile, "s_699");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What will you have me do?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_pers_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_701");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_pers.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_pers.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_pers_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Shh! The Myyydril musn't know. They think I'm a chef! HA! Come closer, friend, we have much to discuss.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What will you have me do?
|
|
if (response == "s_701")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I, let us say, 'supply' the Myyydril with specific weapons made from the tough, priceless Nak'tra Crystals. I manipulate the gemstone and fasten the finished piece into... [Pers looks around cautiously.] ... Imperial rifles. It's my best work. But!
|
|
string_id message = new string_id (c_stringFile, "s_703");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: You need Imperial Rifles?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_pers_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_705");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_pers.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_pers.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_pers_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I, let us say, 'supply' the Myyydril with specific weapons made from the tough, priceless Nak'tra Crystals. I manipulate the gemstone and fasten the finished piece into... [Pers looks around cautiously.] ... Imperial rifles. It's my best work. But!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You need Imperial Rifles?
|
|
if (response == "s_705")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: No! The bloody bastards took my finished crate of Nak'tra Crystal Rifles! I just need them back now. And that's where you, my fellow smuggler, come in.
|
|
string_id message = new string_id (c_stringFile, "s_707");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sounds like my kind of work.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd rather smuggle Wookiees.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_myyydril_pers_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_709");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_715");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_pers.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_pers.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_pers_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: No! The bloody bastards took my finished crate of Nak'tra Crystal Rifles! I just need them back now. And that's where you, my fellow smuggler, come in.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sounds like my kind of work.
|
|
if (response == "s_709")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
ep3_myyydril_pers_action_giveQuestOne (player, npc);
|
|
|
|
//-- NPC: And that's exactly what I was hoping for. There's an Imperial camp nearby. At least, in the forest. Find it, steal--I mean 'smuggle'--the crate of weapons and come back. It's that simple.
|
|
string_id message = new string_id (c_stringFile, "s_711");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll find it quickly.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_pers_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_868");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_pers.branchId", 13);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_pers.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'd rather smuggle Wookiees.
|
|
if (response == "s_715")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You probably shouldn't say that around here.
|
|
string_id message = new string_id (c_stringFile, "s_679");
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_pers.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_pers_handleBranch13 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: And that's exactly what I was hoping for. There's an Imperial camp nearby. At least, in the forest. Find it, steal--I mean 'smuggle'--the crate of weapons and come back. It's that simple.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll find it quickly.
|
|
if (response == "s_868")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Go then and hurry back.
|
|
string_id message = new string_id (c_stringFile, "s_673");
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_pers.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_pers");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setName (self, new string_id( "ep3/npc_names", "pers" ));
|
|
setInvulnerable(self, true);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setName (self, new string_id( "ep3/npc_names", "pers" ));
|
|
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_pers");
|
|
|
|
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_pers_condition_hasCompletedQuestOne (player, npc))
|
|
{
|
|
//-- NPC: [Pers nods.] Friend. I hope things are going well for you. I'm doing another one of my projects again. Gotta get back to it.
|
|
string_id message = new string_id (c_stringFile, "s_632");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition_isTaskCompleteOne (player, npc))
|
|
{
|
|
//-- NPC: Look who it is. And look who has my crate of stuff. I knew I could count on you. You're just like me in a way; smart and quick.
|
|
string_id message = new string_id (c_stringFile, "s_635");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thanks. I expect something for my troubles.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_pers_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_637");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_pers.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "ep3_myyydril_pers", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition_isTaskActiveOne (player, npc))
|
|
{
|
|
//-- NPC: Is anyone following you? [Pers looks around for a moment.] Doesn't seem like it. Good. You're better than I thought. What do ya got for me?
|
|
string_id message = new string_id (c_stringFile, "s_648");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Well, I haven't got the weapons yet.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_pers_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_650");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_pers.branchId", 5);
|
|
|
|
npcStartConversation (player, npc, "ep3_myyydril_pers", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition_hasSkillSmug (player, npc))
|
|
{
|
|
//-- NPC: Your subtly astounds me. Yes. [Pers nods slowly.] You'd be perfect for my plans.
|
|
string_id message = new string_id (c_stringFile, "s_691");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What plans? What--Just who are you?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_pers_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_693");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_pers.branchId", 8);
|
|
|
|
npcStartConversation (player, npc, "ep3_myyydril_pers", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_pers_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You're not the one I am looking for. The chosen must be able to infiltrate the most secure of places and retrieve what it is that I need.
|
|
string_id message = new string_id (c_stringFile, "s_719");
|
|
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_pers")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.ep3_myyydril_pers.branchId");
|
|
|
|
if (branchId == 2 && ep3_myyydril_pers_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && ep3_myyydril_pers_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && ep3_myyydril_pers_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && ep3_myyydril_pers_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && ep3_myyydril_pers_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && ep3_myyydril_pers_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && ep3_myyydril_pers_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && ep3_myyydril_pers_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && ep3_myyydril_pers_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 13 && ep3_myyydril_pers_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.ep3_myyydril_pers.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|