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

263 lines
8.2 KiB
Plaintext

// ======================================================================
//
// ep3_rryatt_vritol.script
//
//
//
// Created with SwgConversationEditor 1.30 - 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_rryatt_vritol";
// ======================================================================
// Script Conditions
// ======================================================================
boolean ep3_rryatt_vritol_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean ep3_rryatt_vritol_condition_cannotSpeakWookiee (obj_id player, obj_id npc)
{
return utils.canSpeakWookiee(player, npc);
}
// ----------------------------------------------------------------------
boolean ep3_rryatt_vritol_condition_sentByBrody (obj_id player, obj_id npc)
{
return groundquests.isQuestActive(player, "ep3_hunt_vritol_reward_mount");
}
// ======================================================================
// Script Actions
// ======================================================================
void ep3_rryatt_vritol_action_thinkWookieeConfusion (obj_id player, obj_id npc)
{
utils.emoteWookieeConfusion(player, npc);
}
// ----------------------------------------------------------------------
void ep3_rryatt_vritol_action_grantKashBanthaMount (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "vritol_speakToVritol");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int ep3_rryatt_vritol_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Brody told me to expect you. I have your Kashyyyk bantha ready. Please treat it well, and you will find it to be a loyal pet. It can traverse broken terrain and steep slopes better than most other mounts.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you.
if (response == "s_221")
{
//-- [NOTE]
if (ep3_rryatt_vritol_condition__defaultCondition (player, npc))
{
//-- NPC: You're welcome. Brody wished for me to thank you again for him as well. So, thank you.
string_id message = new string_id (c_stringFile, "s_224");
utils.removeScriptVar (player, "conversation.ep3_rryatt_vritol.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.ep3_rryatt_vritol");
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable (self, true);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable (self, true);
return SCRIPT_CONTINUE;
}
trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo)
{
int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null);
menu_info_data menuInfoData = menuInfo.getMenuItemById (menu);
menuInfoData.setServerNotify (false);
setCondition (self, CONDITION_CONVERSABLE);
faceTo(self, player);
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.ep3_rryatt_vritol");
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_rryatt_vritol_condition_cannotSpeakWookiee (player, npc))
{
ep3_rryatt_vritol_action_thinkWookieeConfusion (player, npc);
//-- NPC: Ra oacanwa rawwacccraan acc anacorwo ra cccoooosac ccoohawwsraacww oarwowoor. Acs ccacrracs anooooor aworaoawowwhaan, rhas acww rooha'rwo wwoos oararwowwhaan, acs oaoohaanwa orwwoooaor rooha oowwww ooww roohar wwwowos.
string_id message = new string_id (c_stringFile, "s_226");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_rryatt_vritol_condition_sentByBrody (player, npc))
{
ep3_rryatt_vritol_action_grantKashBanthaMount (player, npc);
//-- NPC: Brody told me to expect you. I have your Kashyyyk bantha ready. Please treat it well, and you will find it to be a loyal pet. It can traverse broken terrain and steep slopes better than most other mounts.
string_id message = new string_id (c_stringFile, "s_218");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you.
boolean hasResponse0 = false;
if (ep3_rryatt_vritol_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_221");
utils.setScriptVar (player, "conversation.ep3_rryatt_vritol.branchId", 2);
npcStartConversation (player, npc, "ep3_rryatt_vritol", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_rryatt_vritol_condition__defaultCondition (player, npc))
{
//-- NPC: A wild animal is like a smooth mountain creek. It might look peaceful, but if you're not careful, it could knock you off of your feet.
string_id message = new string_id (c_stringFile, "s_669");
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_rryatt_vritol")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.ep3_rryatt_vritol.branchId");
if (branchId == 2 && ep3_rryatt_vritol_handleBranch2 (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_rryatt_vritol.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================