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

1709 lines
48 KiB
Plaintext

// ======================================================================
//
// som_kenobi_ikt.script
//
//
//
// Created with SwgConversationEditor 1.35 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.groundquests;
include library.jedi;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/som_kenobi_ikt";
// ======================================================================
// Script Conditions
// ======================================================================
boolean som_kenobi_ikt_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean som_kenobi_ikt_condition_playerJedi (obj_id player, obj_id npc)
{
return jedi.isForceSensitive (player);
}
// ----------------------------------------------------------------------
boolean som_kenobi_ikt_condition_haveShard (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "som_kenobi_serpent_shard_1", "gotShard");
}
// ----------------------------------------------------------------------
boolean som_kenobi_ikt_condition_done (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "som_kenobi_serpent_shard_1");
}
// ----------------------------------------------------------------------
boolean som_kenobi_ikt_condition_onQuest (obj_id player, obj_id npc)
{
return groundquests.isQuestActive(player, "som_kenobi_serpent_shard_1");
}
// ======================================================================
// Script Actions
// ======================================================================
void som_kenobi_ikt_action_giveQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "som_kenobi_serpent_shard_1");
}
// ----------------------------------------------------------------------
void som_kenobi_ikt_action_removeQuest (obj_id player, obj_id npc)
{
groundquests.clearQuest(player, "som_kenobi_serpent_shard_1");
}
// ----------------------------------------------------------------------
void som_kenobi_ikt_action_reward (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "givenShard");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int som_kenobi_ikt_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: There you are. Have you had any luck?
//-- [RESPONSE NOTE]
//-- PLAYER: Indeed! I found the thief and retrieved the shard.
if (response == "s_151")
{
doAnimationAction (player, "thumb_up");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
//-- NPC: What about the thief?
string_id message = new string_id (c_stringFile, "s_157");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I had no choice. She forced me to kill her...
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_159");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, that thief will not bother anyone again.
if (response == "s_153")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "pound_fist_palm");
//-- NPC: That is excellent news, friend. No one steals from Ikt and gets away with it. No one!
string_id message = new string_id (c_stringFile, "s_155");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I found another shard as well. Here.
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_166");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What about the thief?
//-- [RESPONSE NOTE]
//-- PLAYER: I had no choice. She forced me to kill her...
if (response == "s_159")
{
doAnimationAction (player, "slump_head");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "pound_fist_palm");
//-- NPC: That is excellent news! No one steals from Ikt and gets away with it. No one!
string_id message = new string_id (c_stringFile, "s_164");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Alright... Well, I have your shard, plus another one that I found.
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_168");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: That is excellent news! No one steals from Ikt and gets away with it. No one!
//-- [RESPONSE NOTE]
//-- PLAYER: Alright... Well, I have your shard, plus another one that I found.
if (response == "s_168")
{
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: Oh yeah, the shard. And another one, you say. Strange little things, they seem to fit together. Odd, I can't pull them apart again. Anyway, I don't want them. Take them. And, of course, here's your payment for a job well done.
string_id message = new string_id (c_stringFile, "s_172");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You don't even want it back?
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_174");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Oh yeah, the shard. And another one, you say. Strange little things, they seem to fit together. Odd, I can't pull them apart again. Anyway, I don't want them. Take them. And, of course, here's your payment for a job well done.
//-- [RESPONSE NOTE]
//-- PLAYER: You don't even want it back?
if (response == "s_174")
{
doAnimationAction (player, "shrug_hands");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
//-- NPC: No, the shard wasn't very interesting, but as I said, no one...
string_id message = new string_id (c_stringFile, "s_176");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: ...steals from Ikt and gets away with it. Yeah I get it.
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_178");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: No, the shard wasn't very interesting, but as I said, no one...
//-- [RESPONSE NOTE]
//-- PLAYER: ...steals from Ikt and gets away with it. Yeah I get it.
if (response == "s_178")
{
doAnimationAction (player, "dismiss");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_accusingly");
som_kenobi_ikt_action_reward (player, npc);
//-- NPC: That's right and don't you forget it!
string_id message = new string_id (c_stringFile, "s_180");
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: That is excellent news, friend. No one steals from Ikt and gets away with it. No one!
//-- [RESPONSE NOTE]
//-- PLAYER: I found another shard as well. Here.
if (response == "s_166")
{
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: Oh yeah, the shard. And another one, you say. Strange little things, they seem to fit together. Odd, I can't pull them apart again. Anyway, I don't want them. Take them. And, of course, here's your payment for a job well done.
string_id message = new string_id (c_stringFile, "s_170");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Pleasure doing business with you.
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_182");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Oh yeah, the shard. And another one, you say. Strange little things, they seem to fit together. Odd, I can't pull them apart again. Anyway, I don't want them. Take them. And, of course, here's your payment for a job well done.
//-- [RESPONSE NOTE]
//-- PLAYER: Pleasure doing business with you.
if (response == "s_182")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "belly_laugh");
som_kenobi_ikt_action_reward (player, npc);
//-- NPC: The pleasure was all mine, friend.
string_id message = new string_id (c_stringFile, "s_184");
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Already back?
//-- [RESPONSE NOTE]
//-- PLAYER: Just back to stock up on some rations, etc.
if (response == "s_105")
{
doAnimationAction (player, "shrug_shoulders");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: Very well.
string_id message = new string_id (c_stringFile, "s_106");
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Some things have come up that I have to take care of.
if (response == "s_107")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
//-- NPC: You won't be able to finish the job?
string_id message = new string_id (c_stringFile, "s_109");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm afraid not.
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_141");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 13);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Yeah, I can't find the thief and don't have time to look anymore.
if (response == "s_108")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shrug_shoulders");
som_kenobi_ikt_action_removeQuest (player, npc);
//-- NPC: Disappointing. Guess I will have to find someone else.
string_id message = new string_id (c_stringFile, "s_147");
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You won't be able to finish the job?
//-- [RESPONSE NOTE]
//-- PLAYER: I'm afraid not.
if (response == "s_141")
{
doAnimationAction (player, "sigh_deeply");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shrug_shoulders");
som_kenobi_ikt_action_removeQuest (player, npc);
//-- NPC: Disappointing. Guess I will have to find someone else.
string_id message = new string_id (c_stringFile, "s_143");
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch16 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hey there, you available for some employment?
//-- [RESPONSE NOTE]
//-- PLAYER: I might be. What is the job?
if (response == "s_111")
{
doAnimationAction (player, "shrug_hands");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
//-- NPC: I need help hunting down a thief.
string_id message = new string_id (c_stringFile, "s_72");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I might be interested in that. What did he steal?
boolean hasResponse0 = false;
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Not really something I'm good at. Sorry.
boolean hasResponse1 = false;
if (som_kenobi_ikt_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_74");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_75");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 17);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: If it pays well enough.
if (response == "s_112")
{
doAnimationAction (player, "shrug_shoulders");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
//-- NPC: Money is not a problem.
string_id message = new string_id (c_stringFile, "s_73");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Good, then what is the problem so that I can solve it?
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_kenobi_ikt.branchId", 23);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No, sorry. Not right now.
if (response == "s_113")
{
doAnimationAction (player, "shake_head_no");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod_head_once");
//-- NPC: Alright, come back if you change your mind.
string_id message = new string_id (c_stringFile, "s_82");
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No.
if (response == "s_114")
{
doAnimationAction (player, "dismiss");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
//-- NPC: Very well.
string_id message = new string_id (c_stringFile, "s_83");
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch17 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I need help hunting down a thief.
//-- [RESPONSE NOTE]
//-- PLAYER: I might be interested in that. What did he steal?
if (response == "s_74")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: I found this little piece of crystal out in some old ruins. It had an interesting flaw in it that looked like a snake. As I hadn't gone through all the ruins yet, I decided to spend the night and continue in the morning. I was awoken in the middle of the night and caught a glimpse of someone running off in to the dark. As I looked through my belongings, I found the little crystal to be missing.
string_id message = new string_id (c_stringFile, "s_92");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: It will be hard to track the thief down with just that information...
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_94");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 18);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Not really something I'm good at. Sorry.
if (response == "s_75")
{
doAnimationAction (player, "shake_head_no");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: My mistake.
string_id message = new string_id (c_stringFile, "s_76");
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch18 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I found this little piece of crystal out in some old ruins. It had an interesting flaw in it that looked like a snake. As I hadn't gone through all the ruins yet, I decided to spend the night and continue in the morning. I was awoken in the middle of the night and caught a glimpse of someone running off in to the dark. As I looked through my belongings, I found the little crystal to be missing.
//-- [RESPONSE NOTE]
//-- PLAYER: It will be hard to track the thief down with just that information...
if (response == "s_94")
{
doAnimationAction (player, "rub_chin_thoughtful");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
//-- NPC: The next morning, I searched around the ruins some more before heading back to town. I could have sworn that I was being watched the whole time but couldn't see anyone. I think whoever it was that stole it is still out there.
string_id message = new string_id (c_stringFile, "s_96");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Hopefully the thief will still be there. How do I find the ruins?
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_98");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 19);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch19 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The next morning, I searched around the ruins some more before heading back to town. I could have sworn that I was being watched the whole time but couldn't see anyone. I think whoever it was that stole it is still out there.
//-- [RESPONSE NOTE]
//-- PLAYER: Hopefully the thief will still be there. How do I find the ruins?
if (response == "s_98")
{
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
//-- NPC: I'm sure you've seen the large volcano in the center of the continent. The ruins are to the west of that, across the river of molten lava.
string_id message = new string_id (c_stringFile, "s_100");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Okay, I will do my best. Anything else I should know?
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_102");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 20);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch20 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I'm sure you've seen the large volcano in the center of the continent. The ruins are to the west of that, across the river of molten lava.
//-- [RESPONSE NOTE]
//-- PLAYER: Okay, I will do my best. Anything else I should know?
if (response == "s_102")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "pound_fist_palm");
som_kenobi_ikt_action_giveQuest (player, npc);
//-- NPC: I don't even care that much about the little crystal, but no one steals from Ikt and gets away with it! That's all...
string_id message = new string_id (c_stringFile, "s_104");
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch23 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Money is not a problem.
//-- [RESPONSE NOTE]
//-- PLAYER: Good, then what is the problem so that I can solve it?
if (response == "s_77")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
//-- NPC: I need help hunting down a thief.
string_id message = new string_id (c_stringFile, "s_78");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Alright, I can do that. What did he steal?
boolean hasResponse0 = false;
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Bah! I have more important things to do.
boolean hasResponse1 = false;
if (som_kenobi_ikt_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_79");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_80");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 24);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch24 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I need help hunting down a thief.
//-- [RESPONSE NOTE]
//-- PLAYER: Alright, I can do that. What did he steal?
if (response == "s_79")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: I found this little piece of crystal out in some old ruins. It had an interesting flaw in it that looked like a snake. As I hadn't gone through all the ruins yet, I decided to spend the night and continue in the morning. I was awoken in the middle of the night and caught a glimpse of someone running off in to the dark. As I looked through my belongings, I found the little crystal to be missing.
string_id message = new string_id (c_stringFile, "s_84");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: How am I supposed to find them? They could be anywhere now.
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_85");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 25);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Bah! I have more important things to do.
if (response == "s_80")
{
doAnimationAction (player, "dismiss");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shrug_shoulders");
//-- NPC: Very well, I'll just keep the money then.
string_id message = new string_id (c_stringFile, "s_81");
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch25 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I found this little piece of crystal out in some old ruins. It had an interesting flaw in it that looked like a snake. As I hadn't gone through all the ruins yet, I decided to spend the night and continue in the morning. I was awoken in the middle of the night and caught a glimpse of someone running off in to the dark. As I looked through my belongings, I found the little crystal to be missing.
//-- [RESPONSE NOTE]
//-- PLAYER: How am I supposed to find them? They could be anywhere now.
if (response == "s_85")
{
doAnimationAction (player, "shrug_shoulders");
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
//-- NPC: The next morning, I searched around the ruins some more before heading back to town. I could have sworn that I was being watched the whole time but couldn't see anyone. I think whoever it was that stole it is still out there.
string_id message = new string_id (c_stringFile, "s_86");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'll see what I can find. Where are the ruins?
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_87");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 26);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch26 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The next morning, I searched around the ruins some more before heading back to town. I could have sworn that I was being watched the whole time but couldn't see anyone. I think whoever it was that stole it is still out there.
//-- [RESPONSE NOTE]
//-- PLAYER: I'll see what I can find. Where are the ruins?
if (response == "s_87")
{
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
//-- NPC: I'm sure you've seen the large volcano in the center of the continent. The ruins are to the west of that, across the river of molten lava.
string_id message = new string_id (c_stringFile, "s_88");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Anything else?
boolean hasResponse0 = false;
if (som_kenobi_ikt_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_89");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 27);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int som_kenobi_ikt_handleBranch27 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I'm sure you've seen the large volcano in the center of the continent. The ruins are to the west of that, across the river of molten lava.
//-- [RESPONSE NOTE]
//-- PLAYER: Anything else?
if (response == "s_89")
{
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "pound_fist_palm");
som_kenobi_ikt_action_giveQuest (player, npc);
//-- NPC: I don't even care that much about the little crystal, but no one steals from Ikt and gets away with it! That's all...
string_id message = new string_id (c_stringFile, "s_90");
utils.removeScriptVar (player, "conversation.som_kenobi_ikt.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.som_kenobi_ikt");
setCondition (self, CONDITION_INTERESTING);
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable (self, true);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_INTERESTING);
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);
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.som_kenobi_ikt");
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_kenobi_ikt_condition_done (player, npc))
{
doAnimationAction (npc, "belly_laugh");
//-- NPC: I trust you are enjoying your stay on our nice little corner of the galaxy? I know I am.
string_id message = new string_id (c_stringFile, "s_186");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (som_kenobi_ikt_condition_haveShard (player, npc))
{
doAnimationAction (npc, "nod_head_once");
doAnimationAction (player, "greet");
//-- NPC: There you are. Have you had any luck?
string_id message = new string_id (c_stringFile, "s_149");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Indeed! I found the thief and retrieved the shard.
boolean hasResponse0 = false;
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Yes, that thief will not bother anyone again.
boolean hasResponse1 = false;
if (som_kenobi_ikt_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_151");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_153");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 2);
npcStartConversation (player, npc, "som_kenobi_ikt", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (som_kenobi_ikt_condition_onQuest (player, npc))
{
doAnimationAction (npc, "nod_head_once");
doAnimationAction (player, "greet");
//-- NPC: Already back?
string_id message = new string_id (c_stringFile, "s_67");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Just back to stock up on some rations, etc.
boolean hasResponse0 = false;
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Some things have come up that I have to take care of.
boolean hasResponse1 = false;
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Yeah, I can't find the thief and don't have time to look anymore.
boolean hasResponse2 = false;
if (som_kenobi_ikt_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_105");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_107");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_108");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 11);
npcStartConversation (player, npc, "som_kenobi_ikt", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod_head_once");
doAnimationAction (player, "greet");
//-- NPC: Hey there, you available for some employment?
string_id message = new string_id (c_stringFile, "s_110");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I might be. What is the job?
boolean hasResponse0 = false;
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: If it pays well enough.
boolean hasResponse1 = false;
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: No, sorry. Not right now.
boolean hasResponse2 = false;
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
//-- PLAYER: No.
boolean hasResponse3 = false;
if (som_kenobi_ikt_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse3 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_111");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_112");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_113");
if (hasResponse3)
responses [responseIndex++] = new string_id (c_stringFile, "s_114");
utils.setScriptVar (player, "conversation.som_kenobi_ikt.branchId", 16);
npcStartConversation (player, npc, "som_kenobi_ikt", 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_kenobi_ikt")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.som_kenobi_ikt.branchId");
if (branchId == 2 && som_kenobi_ikt_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && som_kenobi_ikt_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && som_kenobi_ikt_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && som_kenobi_ikt_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && som_kenobi_ikt_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && som_kenobi_ikt_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && som_kenobi_ikt_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && som_kenobi_ikt_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && som_kenobi_ikt_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 16 && som_kenobi_ikt_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 17 && som_kenobi_ikt_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 18 && som_kenobi_ikt_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 19 && som_kenobi_ikt_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 20 && som_kenobi_ikt_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 23 && som_kenobi_ikt_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 24 && som_kenobi_ikt_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 25 && som_kenobi_ikt_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 26 && som_kenobi_ikt_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 27 && som_kenobi_ikt_handleBranch27 (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_kenobi_ikt.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================