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

302 lines
9.2 KiB
Plaintext

// ======================================================================
//
// village_sarguillo_2.script
// Copyright 2003, Sony Online Entertainment
//
//
// DO NOT EDIT THIS AUTO-GENERATED FILE. PLEASE USE THE CONVERATION EDITOR!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/village_sarguillo_2";
// ======================================================================
// Script Conditions
// ======================================================================
boolean village_sarguillo_2_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ======================================================================
// Script Actions
// ======================================================================
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "npc.conversation.village_sarguillo_2");
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, "npc.conversation.village_sarguillo_2");
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)
{
if (ai_lib.isInCombat (self) || ai_lib.isInCombat (player))
return SCRIPT_OVERRIDE;
//-- [NOTE]
if (village_sarguillo_2_condition__defaultCondition (player, self))
{
doAnimationAction (self, "check_wrist_device");
//-- NPC: Check sector 4. The sensor array is indicating movement in that area. Probably just more brackasets.
string_id message = new string_id (c_stringFile, "s_ffe08b69");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Are you talking to me?
boolean hasResponse0 = false;
if (village_sarguillo_2_condition__defaultCondition (player, self))
{
++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_55d76f7");
setObjVar (player, "conversation.village_sarguillo_2.branchId", 1);
npcStartConversation (player, self, "village_sarguillo_2", message, responses);
}
else
{
chat.chat (self, message);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnStartNpcConversation were false.");
return SCRIPT_CONTINUE;
}
// ----------------------------------------------------------------------
trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response)
{
if (conversationId != "village_sarguillo_2")
return SCRIPT_CONTINUE;
int branchId = getIntObjVar (player, "conversation.village_sarguillo_2.branchId");
//-- [BRANCH NOTE]
//-- NPC: Check sector 4. The sensor array is indicating movement in that area. Probably just more brackasets.
//-- [RESPONSE NOTE]
//-- PLAYER: Are you talking to me?
if (branchId == 1 && response == "s_55d76f7")
{
//-- [NOTE]
if (village_sarguillo_2_condition__defaultCondition (player, self))
{
doAnimationAction (self, "shake_head_no");
//-- NPC: No. Kind of busy here coordinating patrols. What can I do for you?
string_id message = new string_id (c_stringFile, "s_1cf74704");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm here to offer my assistance.
boolean hasResponse0 = false;
if (village_sarguillo_2_condition__defaultCondition (player, self))
{
++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_c96d6885");
setObjVar (player, "conversation.village_sarguillo_2.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.village_sarguillo_2.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Check sector 4. The sensor array is indicating movement in that area. Probably just more brackasets.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: No. Kind of busy here coordinating patrols. What can I do for you?
//-- [RESPONSE NOTE]
//-- PLAYER: I'm here to offer my assistance.
if (branchId == 2 && response == "s_c96d6885")
{
//-- [NOTE]
if (village_sarguillo_2_condition__defaultCondition (player, self))
{
//-- NPC: You should speak to the Elder. He can give you all the help you need.
string_id message = new string_id (c_stringFile, "s_7c5b4636");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I've already talked to the Elder. I want to help with combat.
boolean hasResponse0 = false;
if (village_sarguillo_2_condition__defaultCondition (player, self))
{
++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_59b666a8");
setObjVar (player, "conversation.village_sarguillo_2.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.village_sarguillo_2.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'No. Kind of busy here coordinating patrols. What can I do for you?' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: You should speak to the Elder. He can give you all the help you need.
//-- [RESPONSE NOTE]
//-- PLAYER: I've already talked to the Elder. I want to help with combat.
if (branchId == 3 && response == "s_59b666a8")
{
//-- [NOTE]
if (village_sarguillo_2_condition__defaultCondition (player, self))
{
//-- NPC: Good. Glad to have you aboard, but you'll need to speak with Dageerin for your assignment. He's over by the communal huts northwest of here. He has temporarily assumed command of the assault groups while I organize the defense.
string_id message = new string_id (c_stringFile, "s_ee7d6b1f");
removeObjVar (player, "conversation.village_sarguillo_2.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'You should speak to the Elder. He can give you all the help you need.' were false.");
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
removeObjVar (player, "conversation.village_sarguillo_2.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================