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

482 lines
14 KiB
Plaintext

// ======================================================================
//
// ep3_rroot.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// 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_rroot";
// ======================================================================
// Script Conditions
// ======================================================================
boolean ep3_rroot_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean ep3_rroot_condition_wasSentByKymayrr (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "ep3_kymayrr_rescue_rroot", "taskFindRroot");
}
// ----------------------------------------------------------------------
boolean ep3_rroot_condition_hasTheCode (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "ep3_kymayrr_rescue_rroot", "taskReturnToRroot");
}
// ----------------------------------------------------------------------
boolean ep3_rroot_condition_isWookieeNub (obj_id player, obj_id npc)
{
return utils.canSpeakWookiee(player, npc);
}
// ======================================================================
// Script Actions
// ======================================================================
void ep3_rroot_action_goGetCodeSignal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "signalFindRroot");
}
// ----------------------------------------------------------------------
void ep3_rroot_action_sendPatrolSignal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "signalReturnToRroot");
obj_id parent = utils.getObjIdScriptVar(npc, "spawned.rrootParent");
messageTo(parent, "destroyRroot", null, 15, false);
}
// ----------------------------------------------------------------------
void ep3_rroot_action_SchoolWookieeNub (obj_id player, obj_id npc)
{
utils.emoteWookieeConfusion(player, npc);
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int ep3_rroot_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You are back! Did you bring the code?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes I have it here.
if (response == "s_12")
{
//-- [NOTE]
if (ep3_rroot_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_forward");
ep3_rroot_action_sendPatrolSignal (player, npc);
//-- NPC: Ok, I'll get this collar off. Wait, what is that? Oh no, the patrol has returned!
string_id message = new string_id (c_stringFile, "s_13");
utils.removeScriptVar (player, "conversation.ep3_rroot.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_rroot_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You stranger! You do not look like one of this lot. What would bring you down this path?
//-- [RESPONSE NOTE]
//-- PLAYER: I was bid to come here by Kymayrr.
if (response == "s_10")
{
//-- [NOTE]
if (ep3_rroot_condition__defaultCondition (player, npc))
{
//-- NPC: Kymayrr! Then word made it out. I knew they would come for me.
string_id message = new string_id (c_stringFile, "s_14");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Then let us be off.
boolean hasResponse0 = false;
if (ep3_rroot_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_16");
utils.setScriptVar (player, "conversation.ep3_rroot.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_rroot.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_rroot_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Kymayrr! Then word made it out. I knew they would come for me.
//-- [RESPONSE NOTE]
//-- PLAYER: Then let us be off.
if (response == "s_16")
{
//-- [NOTE]
if (ep3_rroot_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: I cannot. I have around my neck a deadlock. If I stray from this area it will detonate, and take my head with it. To taunt me, they wrote the code on a rock and gave it to one of the feral wookiees that live in this region. I pleaded with him to give me the rock, but he just roared at me and ran off. But you are free. If you could get that code for me, then we could get out of here.
string_id message = new string_id (c_stringFile, "s_18");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You say one of the feral wookiees has the code?
boolean hasResponse0 = false;
if (ep3_rroot_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_20");
utils.setScriptVar (player, "conversation.ep3_rroot.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_rroot.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_rroot_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I cannot. I have around my neck a deadlock. If I stray from this area it will detonate, and take my head with it. To taunt me, they wrote the code on a rock and gave it to one of the feral wookiees that live in this region. I pleaded with him to give me the rock, but he just roared at me and ran off. But you are free. If you could get that code for me, then we could get out of here.
//-- [RESPONSE NOTE]
//-- PLAYER: You say one of the feral wookiees has the code?
if (response == "s_20")
{
//-- [NOTE]
if (ep3_rroot_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod_head_multiple");
ep3_rroot_action_goGetCodeSignal (player, npc);
//-- NPC: Yes, you can find them farther down the trail. And please hurry, a patrol is due to return any time now.
string_id message = new string_id (c_stringFile, "s_22");
utils.removeScriptVar (player, "conversation.ep3_rroot.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_rroot");
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_rroot");
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_rroot_condition_isWookieeNub (player, npc))
{
ep3_rroot_action_SchoolWookieeNub (player, npc);
//-- NPC: Hararok?
string_id message = new string_id (c_stringFile, "s_146");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_rroot_condition_hasTheCode (player, npc))
{
doAnimationAction (npc, "wave1");
//-- NPC: You are back! Did you bring the code?
string_id message = new string_id (c_stringFile, "s_4");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes I have it here.
boolean hasResponse0 = false;
if (ep3_rroot_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_12");
utils.setScriptVar (player, "conversation.ep3_rroot.branchId", 2);
npcStartConversation (player, npc, "ep3_rroot", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_rroot_condition_wasSentByKymayrr (player, npc))
{
doAnimationAction (npc, "beckon");
//-- NPC: You stranger! You do not look like one of this lot. What would bring you down this path?
string_id message = new string_id (c_stringFile, "s_8");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I was bid to come here by Kymayrr.
boolean hasResponse0 = false;
if (ep3_rroot_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_10");
utils.setScriptVar (player, "conversation.ep3_rroot.branchId", 4);
npcStartConversation (player, npc, "ep3_rroot", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_rroot_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "dismiss");
//-- NPC: I doubt you could help me.
string_id message = new string_id (c_stringFile, "s_33");
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_rroot")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.ep3_rroot.branchId");
if (branchId == 2 && ep3_rroot_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && ep3_rroot_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && ep3_rroot_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && ep3_rroot_handleBranch6 (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_rroot.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================