mirror of
https://bitbucket.org/seefoe/dsrc.git
synced 2026-09-12 22:45:32 -04:00
356 lines
11 KiB
Plaintext
356 lines
11 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// ep3_myyydril_miner.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.30 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/ep3_myyydril_miner";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean ep3_myyydril_miner_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_myyydril_miner_condition_hasLanguage (obj_id player, obj_id npc)
|
|
{
|
|
return utils.canSpeakWookiee(player, npc);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void ep3_myyydril_miner_action_Language (obj_id player, obj_id npc)
|
|
{
|
|
utils.emoteWookieeConfusion (player, npc);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int ep3_myyydril_miner_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Ah, another visitor. What are you doing here?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm just looking around. What is this place? What are those?
|
|
if (response == "s_502")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_miner_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh, you mean these? [The miner motions to the blue crystals.] They are Nak'tra Crystals and this is one of our Crystal Gardens. We miners extract the crystals for our weaponsmiths. They can make weapons out of them. It's all very interesting if you like that sort of thing.
|
|
string_id message = new string_id (c_stringFile, "s_504");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Where do I get Nak'tra Crystal weapons?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_miner_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_506");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_miner.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_miner.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_miner_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Oh, you mean these? [The miner motions to the blue crystals.] They are Nak'tra Crystals and this is one of our Crystal Gardens. We miners extract the crystals for our weaponsmiths. They can make weapons out of them. It's all very interesting if you like that sort of thing.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Where do I get Nak'tra Crystal weapons?
|
|
if (response == "s_506")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_miner_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Hm. Well, we have been experiencing a shortage of personnel lately. The whole Urnsor'is thing.. [The miner waves it off.] Speak with Treesh. He's grumpy and only speaks with weaponsmiths. But, I'm sure you have a weaponsmith friend, right?
|
|
string_id message = new string_id (c_stringFile, "s_508");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Well, it was nice talking with you. Back to exploring.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_miner_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_510");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_miner.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_miner.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_miner_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Hm. Well, we have been experiencing a shortage of personnel lately. The whole Urnsor'is thing.. [The miner waves it off.] Speak with Treesh. He's grumpy and only speaks with weaponsmiths. But, I'm sure you have a weaponsmith friend, right?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Well, it was nice talking with you. Back to exploring.
|
|
if (response == "s_510")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_miner_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: [The miner nods, returning to his work.]
|
|
string_id message = new string_id (c_stringFile, "s_512");
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_miner.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_miner");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable(self, true);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
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_miner");
|
|
|
|
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_miner_condition_hasLanguage (player, npc))
|
|
{
|
|
//-- NPC: Rrwworr!
|
|
string_id message = new string_id (c_stringFile, "s_672");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_miner_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Ah, another visitor. What are you doing here?
|
|
string_id message = new string_id (c_stringFile, "s_500");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm just looking around. What is this place? What are those?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_miner_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_502");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_miner.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "ep3_myyydril_miner", 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_miner")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.ep3_myyydril_miner.branchId");
|
|
|
|
if (branchId == 2 && ep3_myyydril_miner_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && ep3_myyydril_miner_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && ep3_myyydril_miner_handleBranch4 (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_miner.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|