mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
1139 lines
32 KiB
Plaintext
1139 lines
32 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// som_diskret_stahn.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.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/som_diskret_stahn";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean som_diskret_stahn_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean som_diskret_stahn_condition_isEntertainer (obj_id player, obj_id npc)
|
|
{
|
|
return utils.isProfession(player, utils.ENTERTAINER);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean som_diskret_stahn_condition_isMusician (obj_id player, obj_id npc)
|
|
{
|
|
return hasSkill(player, "social_musician_novice");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean som_diskret_stahn_condition_hasSong (obj_id player, obj_id npc)
|
|
{
|
|
return hasCommand(player, "startMusic+calypso");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void som_diskret_stahn_action_grantSong (obj_id player, obj_id npc)
|
|
{
|
|
sendSystemMessage(player, new string_id("som/som_quest", "grant_song"));
|
|
grantCommand(player, "startMusic+calypso");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int som_diskret_stahn_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Still have that song stuck in your head, do you? Har har har.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Look behind you! A three-headed narglatch!
|
|
if (response == "s_77")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Bah, you're pullin' my leg. There's no such creature that exists.
|
|
string_id message = new string_id (c_stringFile, "s_78");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int som_diskret_stahn_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What are you doing bothering me? Can't you see I'm busy?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: It doesn't look like you're busy at all.
|
|
if (response == "s_9")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Ah...some people might say that. And, er...those people would be right.
|
|
string_id message = new string_id (c_stringFile, "s_11");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Who are you?
|
|
boolean hasResponse0 = false;
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'll leave you to it, then.
|
|
boolean hasResponse1 = false;
|
|
if (som_diskret_stahn_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_13");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_17");
|
|
|
|
utils.setScriptVar (player, "conversation.som_diskret_stahn.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Who are you?
|
|
if (response == "s_21")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: The name's Cap'n Diskret Stahn. I pilot a small freighter hither and yon. To the farthest reaches of the galaxy. A dangerous job it is, to be sure.
|
|
string_id message = new string_id (c_stringFile, "s_23");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What brings you here?
|
|
boolean hasResponse0 = false;
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: So long, cap'n.
|
|
boolean hasResponse1 = false;
|
|
if (som_diskret_stahn_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_25");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_72");
|
|
|
|
utils.setScriptVar (player, "conversation.som_diskret_stahn.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sorry. Good bye.
|
|
if (response == "s_76")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Right. You are sorry.
|
|
string_id message = new string_id (c_stringFile, "s_80");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int som_diskret_stahn_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Ah...some people might say that. And, er...those people would be right.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Who are you?
|
|
if (response == "s_13")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: The name's Cap'n Diskret Stahn. I pilot a small freighter hither and yon. To the farthest reaches of the galaxy. A dangerous job it is, to be sure.
|
|
string_id message = new string_id (c_stringFile, "s_15");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What brings you here?
|
|
boolean hasResponse0 = false;
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: So long, cap'n.
|
|
boolean hasResponse1 = false;
|
|
if (som_diskret_stahn_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_25");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_72");
|
|
|
|
utils.setScriptVar (player, "conversation.som_diskret_stahn.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll leave you to it, then.
|
|
if (response == "s_17")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: That sounds like a good idea.
|
|
string_id message = new string_id (c_stringFile, "s_19");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int som_diskret_stahn_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: The name's Cap'n Diskret Stahn. I pilot a small freighter hither and yon. To the farthest reaches of the galaxy. A dangerous job it is, to be sure.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What brings you here?
|
|
if (response == "s_25")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well, I was in the middle of bringin' this young lady here to Naboo (she paid me to do it, you see) when we were set upon by the biggest band of pirates you ever seen. Hundreds of 'em, there were.
|
|
string_id message = new string_id (c_stringFile, "s_27");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: No kidding?
|
|
boolean hasResponse0 = false;
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Interesting. Good bye.
|
|
boolean hasResponse1 = false;
|
|
if (som_diskret_stahn_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_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_68");
|
|
|
|
utils.setScriptVar (player, "conversation.som_diskret_stahn.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So long, cap'n.
|
|
if (response == "s_72")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: So long.
|
|
string_id message = new string_id (c_stringFile, "s_74");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int som_diskret_stahn_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: The name's Cap'n Diskret Stahn. I pilot a small freighter hither and yon. To the farthest reaches of the galaxy. A dangerous job it is, to be sure.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What brings you here?
|
|
if (response == "s_25")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well, I was in the middle of bringin' this young lady here to Naboo (she paid me to do it, you see) when we were set upon by the biggest band of pirates you ever seen. Hundreds of 'em, there were.
|
|
string_id message = new string_id (c_stringFile, "s_27");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: No kidding?
|
|
boolean hasResponse0 = false;
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Interesting. Good bye.
|
|
boolean hasResponse1 = false;
|
|
if (som_diskret_stahn_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_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_68");
|
|
|
|
utils.setScriptVar (player, "conversation.som_diskret_stahn.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So long, cap'n.
|
|
if (response == "s_72")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: So long.
|
|
string_id message = new string_id (c_stringFile, "s_74");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int som_diskret_stahn_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well, I was in the middle of bringin' this young lady here to Naboo (she paid me to do it, you see) when we were set upon by the biggest band of pirates you ever seen. Hundreds of 'em, there were.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No kidding?
|
|
if (response == "s_29")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Right. Hundreds of 'em. With huge ships. Each one had probably about a thousand turbolasers. Even with my masterful piloting skills, we were hopelessly overpowered.
|
|
string_id message = new string_id (c_stringFile, "s_31");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What happened?
|
|
boolean hasResponse0 = false;
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Interesting. Good bye.
|
|
boolean hasResponse1 = false;
|
|
if (som_diskret_stahn_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_33");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_64");
|
|
|
|
utils.setScriptVar (player, "conversation.som_diskret_stahn.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Interesting. Good bye.
|
|
if (response == "s_68")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: So long.
|
|
string_id message = new string_id (c_stringFile, "s_70");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int som_diskret_stahn_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Right. Hundreds of 'em. With huge ships. Each one had probably about a thousand turbolasers. Even with my masterful piloting skills, we were hopelessly overpowered.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What happened?
|
|
if (response == "s_33")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: We took a shot to the engine. It was torn to shreds, but I held her together long enough to land her here for repairs and supplies.
|
|
string_id message = new string_id (c_stringFile, "s_35");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How long have you been here?
|
|
boolean hasResponse0 = false;
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Interesting. Good bye.
|
|
boolean hasResponse1 = false;
|
|
if (som_diskret_stahn_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_37");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_60");
|
|
|
|
utils.setScriptVar (player, "conversation.som_diskret_stahn.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Interesting. Good bye.
|
|
if (response == "s_64")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: So long.
|
|
string_id message = new string_id (c_stringFile, "s_66");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int som_diskret_stahn_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We took a shot to the engine. It was torn to shreds, but I held her together long enough to land her here for repairs and supplies.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How long have you been here?
|
|
if (response == "s_37")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Far too long, that's for sure. And it wouldn't be quite so bad, but I got this tune stuck in my head ever since I made that delivery out to the Abregado system.
|
|
string_id message = new string_id (c_stringFile, "s_39");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm a bit of a musician. Could you teach me the tune?
|
|
boolean hasResponse0 = false;
|
|
if (som_diskret_stahn_condition_isEntertainer (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: That sounds horrible. Good bye.
|
|
boolean hasResponse1 = false;
|
|
if (som_diskret_stahn_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_41");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_56");
|
|
|
|
utils.setScriptVar (player, "conversation.som_diskret_stahn.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Interesting. Good bye.
|
|
if (response == "s_60")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: So long.
|
|
string_id message = new string_id (c_stringFile, "s_62");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int som_diskret_stahn_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Far too long, that's for sure. And it wouldn't be quite so bad, but I got this tune stuck in my head ever since I made that delivery out to the Abregado system.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm a bit of a musician. Could you teach me the tune?
|
|
if (response == "s_41")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Ah, of course. The best way to get rid of a tune in your head is to get it stuck in someone else's head. Sure, I'll teach it to you. Feel free to write it down if you want. Are you ready?
|
|
string_id message = new string_id (c_stringFile, "s_43");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes, I'm ready.
|
|
boolean hasResponse0 = false;
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: On second thought, never mind.
|
|
boolean hasResponse1 = false;
|
|
if (som_diskret_stahn_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_45");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_52");
|
|
|
|
utils.setScriptVar (player, "conversation.som_diskret_stahn.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: That sounds horrible. Good bye.
|
|
if (response == "s_56")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Yeah, so long.
|
|
string_id message = new string_id (c_stringFile, "s_58");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int som_diskret_stahn_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Ah, of course. The best way to get rid of a tune in your head is to get it stuck in someone else's head. Sure, I'll teach it to you. Feel free to write it down if you want. Are you ready?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes, I'm ready.
|
|
if (response == "s_45")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition_isEntertainer (player, npc))
|
|
{
|
|
som_diskret_stahn_action_grantSong (player, npc);
|
|
|
|
//-- NPC: OK, here goes. Dum da dumm da dum dum dum. Got it? OK, good. Now it's your problem. Har har har.
|
|
string_id message = new string_id (c_stringFile, "s_48");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: OK, here goes. Dum da dumm da...hmm. Not following? Maybe you're needing a little more practice with your music first. Come back some other time and maybe you can get it.
|
|
string_id message = new string_id (c_stringFile, "s_50");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: On second thought, never mind.
|
|
if (response == "s_52")
|
|
{
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Argh... I'll never get this thing out of my head.
|
|
string_id message = new string_id (c_stringFile, "s_54");
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.som_diskret_stahn");
|
|
|
|
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.som_diskret_stahn");
|
|
|
|
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 (som_diskret_stahn_condition_hasSong (player, npc))
|
|
{
|
|
//-- NPC: Still have that song stuck in your head, do you? Har har har.
|
|
string_id message = new string_id (c_stringFile, "s_46");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Look behind you! A three-headed narglatch!
|
|
boolean hasResponse0 = false;
|
|
if (som_diskret_stahn_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_77");
|
|
|
|
utils.setScriptVar (player, "conversation.som_diskret_stahn.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "som_diskret_stahn", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: What are you doing bothering me? Can't you see I'm busy?
|
|
string_id message = new string_id (c_stringFile, "s_7");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: It doesn't look like you're busy at all.
|
|
boolean hasResponse0 = false;
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Who are you?
|
|
boolean hasResponse1 = false;
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: Sorry. Good bye.
|
|
boolean hasResponse2 = false;
|
|
if (som_diskret_stahn_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_9");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_21");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_76");
|
|
|
|
utils.setScriptVar (player, "conversation.som_diskret_stahn.branchId", 3);
|
|
|
|
npcStartConversation (player, npc, "som_diskret_stahn", 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 != "som_diskret_stahn")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
if (branchId == 1 && som_diskret_stahn_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && som_diskret_stahn_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && som_diskret_stahn_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && som_diskret_stahn_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && som_diskret_stahn_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && som_diskret_stahn_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && som_diskret_stahn_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && som_diskret_stahn_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && som_diskret_stahn_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && som_diskret_stahn_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.som_diskret_stahn.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|