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

727 lines
21 KiB
Plaintext

// ======================================================================
//
// ep3_carl_mosik.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.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/ep3_carl_mosik";
// ======================================================================
// Script Conditions
// ======================================================================
boolean ep3_carl_mosik_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean ep3_carl_mosik_condition_hasNotDoneSurrogateHunter (obj_id player, obj_id npc)
{
return !groundquests.isQuestActiveOrComplete(player, "ep3_carl_surrogate_hunter_v2");
}
// ----------------------------------------------------------------------
boolean ep3_carl_mosik_condition_ready4SurrogateReward (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "ep3_carl_surrogate_hunter_v2", "encounterDefeated") ||
groundquests.isTaskActive(player, "ep3_carl_surrogate_hunter_v2", "encounterFailed") ||
groundquests.isTaskActive(player, "ep3_carl_surrogate_hunter_v2", "taskTrandoAttack"));
}
// ----------------------------------------------------------------------
boolean ep3_carl_mosik_condition_hasCompletedSurrogate (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "ep3_carl_surrogate_hunter_v2");
}
// ----------------------------------------------------------------------
boolean ep3_carl_mosik_condition_hasNotKilledMinstyngarYet (obj_id player, obj_id npc)
{
return groundquests.isQuestActive(player, "ep3_carl_surrogate_hunter_v2");
}
// ======================================================================
// Script Actions
// ======================================================================
void ep3_carl_mosik_action_grantCarlHuntingQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "ep3_carl_surrogate_hunter_v2");
}
// ----------------------------------------------------------------------
void ep3_carl_mosik_action_giveRifleReward (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "signalCarlRewardRifle");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int ep3_carl_mosik_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What, you are back already? Do you have it?
//-- [RESPONSE NOTE]
//-- PLAYER: Through Trandoshans and all, I made it back.
if (response == "s_185")
{
//-- [NOTE]
if (ep3_carl_mosik_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "applause_excited");
//-- NPC: The force be praised, this is excellent.
string_id message = new string_id (c_stringFile, "s_187");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: And you mentioned something of a reward?
boolean hasResponse0 = false;
if (ep3_carl_mosik_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_189");
utils.setScriptVar (player, "conversation.ep3_carl_mosik.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_carl_mosik.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Not yet. What am I looking for?
if (response == "s_201")
{
//-- [NOTE]
if (ep3_carl_mosik_condition__defaultCondition (player, npc))
{
//-- NPC: The Minstyngar. They live a ways down the Rryatt trail. I am told by my friend here they live near the Wroshyr canopy. Though some have made it deeper, I would not go after those. The lack of sunlight dulls the horn.
string_id message = new string_id (c_stringFile, "s_203");
utils.removeScriptVar (player, "conversation.ep3_carl_mosik.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_carl_mosik_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The force be praised, this is excellent.
//-- [RESPONSE NOTE]
//-- PLAYER: And you mentioned something of a reward?
if (response == "s_189")
{
//-- [NOTE]
if (ep3_carl_mosik_condition__defaultCondition (player, npc))
{
//-- NPC: Oh yes that is right. Here, take this. My father gave it to me for this trip. I'll tell him I lost it in a game of cards, he is sure to believe that.
string_id message = new string_id (c_stringFile, "s_191");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Enjoy your trophy, I'm sure the story of how you got it will be grand.
boolean hasResponse0 = false;
if (ep3_carl_mosik_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_193");
utils.setScriptVar (player, "conversation.ep3_carl_mosik.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_carl_mosik.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_carl_mosik_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Oh yes that is right. Here, take this. My father gave it to me for this trip. I'll tell him I lost it in a game of cards, he is sure to believe that.
//-- [RESPONSE NOTE]
//-- PLAYER: Enjoy your trophy, I'm sure the story of how you got it will be grand.
if (response == "s_193")
{
ep3_carl_mosik_action_giveRifleReward (player, npc);
//-- [NOTE]
if (ep3_carl_mosik_condition__defaultCondition (player, npc))
{
//-- NPC: That it will. You mentioned something about Trandoshans?
string_id message = new string_id (c_stringFile, "s_195");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Slavers or hunters, who is to say? They attacked me on the trail.
boolean hasResponse0 = false;
if (ep3_carl_mosik_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_197");
utils.setScriptVar (player, "conversation.ep3_carl_mosik.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_carl_mosik.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_carl_mosik_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: That it will. You mentioned something about Trandoshans?
//-- [RESPONSE NOTE]
//-- PLAYER: Slavers or hunters, who is to say? They attacked me on the trail.
if (response == "s_197")
{
//-- [NOTE]
if (ep3_carl_mosik_condition__defaultCondition (player, npc))
{
//-- NPC: My guide here is named Zhailaut. Why don't you speak with him about it. The Rryatt Trail are his lands.
string_id message = new string_id (c_stringFile, "s_199");
utils.removeScriptVar (player, "conversation.ep3_carl_mosik.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_carl_mosik_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I have a business proposal for you if you are interested. I was looking to bring back a trophy from my trip here but I just can't bring myself to travel down this path.
//-- [RESPONSE NOTE]
//-- PLAYER: I may be interested, what did you have in mind?
if (response == "s_209")
{
//-- [NOTE]
if (ep3_carl_mosik_condition__defaultCondition (player, npc))
{
//-- NPC: The minstyngar lives a ways down the trail. It is a ferocious creature, all large and mean. And I was wondering if I could hire you to go down there and collect for me a pristine horn. I just really want the horn to hang over my mantle, the actual adventure can be saved for someone else.
string_id message = new string_id (c_stringFile, "s_213");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Someone like me.
boolean hasResponse0 = false;
if (ep3_carl_mosik_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_217");
utils.setScriptVar (player, "conversation.ep3_carl_mosik.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_carl_mosik.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_carl_mosik_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The minstyngar lives a ways down the trail. It is a ferocious creature, all large and mean. And I was wondering if I could hire you to go down there and collect for me a pristine horn. I just really want the horn to hang over my mantle, the actual adventure can be saved for someone else.
//-- [RESPONSE NOTE]
//-- PLAYER: Someone like me.
if (response == "s_217")
{
//-- [NOTE]
if (ep3_carl_mosik_condition__defaultCondition (player, npc))
{
//-- NPC: Exactly! And my assessment is based on absolutely no combat experience whatsoever so you obviously look like a competent warrior!
string_id message = new string_id (c_stringFile, "s_221");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Right, and what is in this for me?
boolean hasResponse0 = false;
if (ep3_carl_mosik_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_225");
utils.setScriptVar (player, "conversation.ep3_carl_mosik.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_carl_mosik.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_carl_mosik_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Exactly! And my assessment is based on absolutely no combat experience whatsoever so you obviously look like a competent warrior!
//-- [RESPONSE NOTE]
//-- PLAYER: Right, and what is in this for me?
if (response == "s_225")
{
//-- [NOTE]
if (ep3_carl_mosik_condition__defaultCondition (player, npc))
{
//-- NPC: I tell you what. If you win this I'll let you have my weapon. I have just about everything here a hunter can need, and I am obviously not a hunter so feel free to take it. But only once I get the horn.
string_id message = new string_id (c_stringFile, "s_229");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Alright, I'll get this thing for you.
boolean hasResponse0 = false;
if (ep3_carl_mosik_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_232");
utils.setScriptVar (player, "conversation.ep3_carl_mosik.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_carl_mosik.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_carl_mosik_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I tell you what. If you win this I'll let you have my weapon. I have just about everything here a hunter can need, and I am obviously not a hunter so feel free to take it. But only once I get the horn.
//-- [RESPONSE NOTE]
//-- PLAYER: Alright, I'll get this thing for you.
if (response == "s_232")
{
//-- [NOTE]
if (ep3_carl_mosik_condition__defaultCondition (player, npc))
{
ep3_carl_mosik_action_grantCarlHuntingQuest (player, npc);
//-- NPC: Perfect, I'll be the talk of the town.
string_id message = new string_id (c_stringFile, "s_234");
utils.removeScriptVar (player, "conversation.ep3_carl_mosik.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.ep3_carl_mosik");
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);
faceTo(self, player);
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.ep3_carl_mosik");
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_carl_mosik_condition_hasNotKilledMinstyngarYet (player, npc))
{
//-- NPC: What, you are back already? Do you have it?
string_id message = new string_id (c_stringFile, "s_183");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Through Trandoshans and all, I made it back.
boolean hasResponse0 = false;
if (ep3_carl_mosik_condition_ready4SurrogateReward (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Not yet. What am I looking for?
boolean hasResponse1 = false;
if (ep3_carl_mosik_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_185");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_201");
utils.setScriptVar (player, "conversation.ep3_carl_mosik.branchId", 1);
npcStartConversation (player, npc, "ep3_carl_mosik", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_carl_mosik_condition_hasNotDoneSurrogateHunter (player, npc))
{
//-- NPC: I have a business proposal for you if you are interested. I was looking to bring back a trophy from my trip here but I just can't bring myself to travel down this path.
string_id message = new string_id (c_stringFile, "s_205");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I may be interested, what did you have in mind?
boolean hasResponse0 = false;
if (ep3_carl_mosik_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_209");
utils.setScriptVar (player, "conversation.ep3_carl_mosik.branchId", 7);
npcStartConversation (player, npc, "ep3_carl_mosik", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_carl_mosik_condition__defaultCondition (player, npc))
{
//-- NPC: I have had my fill of the Rryatt Trail. Maybe Zhailaut can tell you more.
string_id message = new string_id (c_stringFile, "s_236");
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_carl_mosik")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.ep3_carl_mosik.branchId");
if (branchId == 1 && ep3_carl_mosik_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && ep3_carl_mosik_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && ep3_carl_mosik_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && ep3_carl_mosik_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && ep3_carl_mosik_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && ep3_carl_mosik_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && ep3_carl_mosik_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && ep3_carl_mosik_handleBranch10 (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_carl_mosik.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================