mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
780 lines
21 KiB
Plaintext
780 lines
21 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// ep3_cheated_gambler.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.groundquests;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/ep3_cheated_gambler";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean ep3_cheated_gambler_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cheated_gambler_condition_hasKilledJessk (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "ep3_stren_jessk_bounty");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cheated_gambler_condition_readyForJesskTip (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "ep3_stren_jessk_bounty", "speakWithCheated");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_cheated_gambler_condition_hasJesskQuest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "ep3_stren_jessk_bounty", "jesskTimer");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void ep3_cheated_gambler_action_sendJesskSignal (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "gotJesskDirections");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int ep3_cheated_gambler_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yes, what do you want?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I need some information.
|
|
if (response == "s_303")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well, at least I still have that.
|
|
string_id message = new string_id (c_stringFile, "s_305");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I hear you had some gambling trouble.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_cheated_gambler_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_307");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cheated_gambler.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cheated_gambler.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cheated_gambler_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well, at least I still have that.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I hear you had some gambling trouble.
|
|
if (response == "s_307")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "laugh_cackle");
|
|
|
|
//-- NPC: What was your first clue?
|
|
string_id message = new string_id (c_stringFile, "s_309");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I overheard your name....
|
|
boolean hasResponse0 = false;
|
|
if (ep3_cheated_gambler_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_311");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cheated_gambler.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cheated_gambler.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cheated_gambler_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What was your first clue?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I overheard your name....
|
|
if (response == "s_311")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Stories travel quick around here. Hey everybody, come look at the fool! What is it you want anyway?
|
|
string_id message = new string_id (c_stringFile, "s_313");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Have you seen a Trandoshan named Jessk?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_cheated_gambler_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_315");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cheated_gambler.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cheated_gambler.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cheated_gambler_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Stories travel quick around here. Hey everybody, come look at the fool! What is it you want anyway?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Have you seen a Trandoshan named Jessk?
|
|
if (response == "s_315")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "threaten");
|
|
|
|
//-- NPC: Seen him! Seen him I have... he is the one that stole from me. Are you a friend of his? Are you another who has come to cheat me?
|
|
string_id message = new string_id (c_stringFile, "s_317");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Actually, I think we can help each other.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_cheated_gambler_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_319");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cheated_gambler.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cheated_gambler.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cheated_gambler_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Seen him! Seen him I have... he is the one that stole from me. Are you a friend of his? Are you another who has come to cheat me?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Actually, I think we can help each other.
|
|
if (response == "s_319")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Yeah, what can you do?
|
|
string_id message = new string_id (c_stringFile, "s_321");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: You are not the first one he has cheated.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_cheated_gambler_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_323");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cheated_gambler.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cheated_gambler.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cheated_gambler_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yeah, what can you do?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You are not the first one he has cheated.
|
|
if (response == "s_323")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I can believe that.
|
|
string_id message = new string_id (c_stringFile, "s_325");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Just tell me which way he went, and I'll take care of the rest.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_cheated_gambler_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_327");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cheated_gambler.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cheated_gambler.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cheated_gambler_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I can believe that.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Just tell me which way he went, and I'll take care of the rest.
|
|
if (response == "s_327")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: What about my money?
|
|
string_id message = new string_id (c_stringFile, "s_329");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Maybe you get it back, probably not. What of revenge?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_cheated_gambler_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_331");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cheated_gambler.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_cheated_gambler.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cheated_gambler_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What about my money?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Maybe you get it back, probably not. What of revenge?
|
|
if (response == "s_331")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
ep3_cheated_gambler_action_sendJesskSignal (player, npc);
|
|
|
|
//-- NPC: I suppose that is enough for now. He went north, into the hills. He couldn't have gone far.
|
|
string_id message = new string_id (c_stringFile, "s_333");
|
|
utils.removeScriptVar (player, "conversation.ep3_cheated_gambler.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_cheated_gambler_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: So you got him?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes, Jessk is dead.
|
|
if (response == "s_339")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Good riddance.
|
|
string_id message = new string_id (c_stringFile, "s_341");
|
|
utils.removeScriptVar (player, "conversation.ep3_cheated_gambler.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Not yet.
|
|
if (response == "s_343")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well, why are you back here. I have no need for you.
|
|
string_id message = new string_id (c_stringFile, "s_345");
|
|
utils.removeScriptVar (player, "conversation.ep3_cheated_gambler.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.ep3_cheated_gambler");
|
|
|
|
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.ep3_cheated_gambler");
|
|
|
|
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_cheated_gambler_condition_readyForJesskTip (player, npc))
|
|
{
|
|
//-- NPC: Yes, what do you want?
|
|
string_id message = new string_id (c_stringFile, "s_301");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I need some information.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_cheated_gambler_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_303");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cheated_gambler.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "ep3_cheated_gambler", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition_hasJesskQuest (player, npc))
|
|
{
|
|
//-- NPC: What are you standing around here for, go get him?
|
|
string_id message = new string_id (c_stringFile, "s_335");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition_hasKilledJessk (player, npc))
|
|
{
|
|
//-- NPC: So you got him?
|
|
string_id message = new string_id (c_stringFile, "s_337");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes, Jessk is dead.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Not yet.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_cheated_gambler_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_339");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_343");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_cheated_gambler.branchId", 11);
|
|
|
|
npcStartConversation (player, npc, "ep3_cheated_gambler", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_cheated_gambler_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: What do you want? Just go away.
|
|
string_id message = new string_id (c_stringFile, "s_347");
|
|
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_cheated_gambler")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.ep3_cheated_gambler.branchId");
|
|
|
|
if (branchId == 1 && ep3_cheated_gambler_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && ep3_cheated_gambler_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && ep3_cheated_gambler_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && ep3_cheated_gambler_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && ep3_cheated_gambler_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && ep3_cheated_gambler_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && ep3_cheated_gambler_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && ep3_cheated_gambler_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && ep3_cheated_gambler_handleBranch11 (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_cheated_gambler.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|