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

582 lines
20 KiB
Plaintext

// ======================================================================
//
// village_elder_3.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;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/village_elder_3";
// ======================================================================
// Script Conditions
// ======================================================================
boolean village_elder_3_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean village_elder_3_condition_needCrystal (obj_id player, obj_id npc)
{
if (utils.playerHasItemByTemplateInBankOrInventory(player, "object/tangible/loot/quest/force_sensitive/force_crystal.iff"))
{
return false;
}
return true;
}
// ======================================================================
// Script Actions
// ======================================================================
void village_elder_3_action_giveCrystal (obj_id player, obj_id npc)
{
createObjectInInventoryAllowOverload("object/tangible/loot/quest/force_sensitive/force_crystal.iff", player);
return;
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "npc.conversation.village_elder_3");
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_elder_3");
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_elder_3_condition__defaultCondition (player, self))
{
//-- NPC: Watch out! Someone dropped a box of phase relay filaments around here. They can get into your electronics and short them out.
string_id message = new string_id (c_stringFile, "s_b77f095d");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Phase relay filaments? They are only used for repairing starship shields.
boolean hasResponse0 = false;
if (village_elder_3_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: What are phase relay filaments?
boolean hasResponse1 = false;
if (village_elder_3_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I seem to have misplaced my Force crystal. May I have another?
boolean hasResponse2 = false;
if (village_elder_3_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_78eeb91e");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_32705167");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_9dc8bf5d");
setObjVar (player, "conversation.village_elder_3.branchId", 1);
npcStartConversation (player, self, "village_elder_3", message, responses);
}
else
{
chat.chat (self, player, 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_elder_3")
return SCRIPT_CONTINUE;
int branchId = getIntObjVar (player, "conversation.village_elder_3.branchId");
//-- [BRANCH NOTE]
//-- NPC: Watch out! Someone dropped a box of phase relay filaments around here. They can get into your electronics and short them out.
//-- [RESPONSE NOTE]
//-- PLAYER: Phase relay filaments? They are only used for repairing starship shields.
if (branchId == 1 && response == "s_78eeb91e")
{
//-- [NOTE]
if (village_elder_3_condition__defaultCondition (player, self))
{
//-- NPC: That's what we're doing. Well, building one from scratch really. We've got the beginnings of a Mark 4 shield generator right over there.
string_id message = new string_id (c_stringFile, "s_4d973713");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You're kidding. I've got to get in on this! where do I sign up?
boolean hasResponse0 = false;
if (village_elder_3_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: How are you getting the resources for such a massive project?
boolean hasResponse1 = false;
if (village_elder_3_condition__defaultCondition (player, self))
{
++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_6857cea2");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_5d8d739e");
setObjVar (player, "conversation.village_elder_3.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.village_elder_3.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Watch out! Someone dropped a box of phase relay filaments around here. They can get into your electronics and short them out. ' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Watch out! Someone dropped a box of phase relay filaments around here. They can get into your electronics and short them out.
//-- [RESPONSE NOTE]
//-- PLAYER: What are phase relay filaments?
if (branchId == 1 && response == "s_32705167")
{
//-- [NOTE]
if (village_elder_3_condition__defaultCondition (player, self))
{
//-- NPC: We're building a Mark 4 shield generator to defend our village. They are used in that.
string_id message = new string_id (c_stringFile, "s_cc50daed");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: A shield generator for an agro-colony? You must grow really juicy Maroj Melons.
boolean hasResponse0 = false;
if (village_elder_3_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_afcc98d2");
setObjVar (player, "conversation.village_elder_3.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.village_elder_3.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Watch out! Someone dropped a box of phase relay filaments around here. They can get into your electronics and short them out. ' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Watch out! Someone dropped a box of phase relay filaments around here. They can get into your electronics and short them out.
//-- [RESPONSE NOTE]
//-- PLAYER: I seem to have misplaced my Force crystal. May I have another?
if (branchId == 1 && response == "s_9dc8bf5d")
{
//-- [NOTE]
if (village_elder_3_condition_needCrystal (player, self))
{
village_elder_3_action_giveCrystal (player, self);
//-- NPC: Here you are. Remember you may use the crystal to view your progress.
string_id message = new string_id (c_stringFile, "s_bdd3bae5");
removeObjVar (player, "conversation.village_elder_3.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (!village_elder_3_condition_needCrystal (player, self))
{
//-- NPC: I sense you already have a crystal and do not need another.
string_id message = new string_id (c_stringFile, "s_199fe2af");
removeObjVar (player, "conversation.village_elder_3.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Watch out! Someone dropped a box of phase relay filaments around here. They can get into your electronics and short them out. ' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: That's what we're doing. Well, building one from scratch really. We've got the beginnings of a Mark 4 shield generator right over there.
//-- [RESPONSE NOTE]
//-- PLAYER: You're kidding. I've got to get in on this! where do I sign up?
if (branchId == 2 && response == "s_6857cea2")
{
//-- [NOTE]
if (village_elder_3_condition__defaultCondition (player, self))
{
//-- NPC: I like your enthusiasm. Speak to Quharek near the shield generator construction site. I am sure he will appreciate the help.
string_id message = new string_id (c_stringFile, "s_6acff81");
removeObjVar (player, "conversation.village_elder_3.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'That's what we're doing. Well, building one from scratch really. We've got the beginnings of a Mark 4 shield generator right over there.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: That's what we're doing. Well, building one from scratch really. We've got the beginnings of a Mark 4 shield generator right over there.
//-- [RESPONSE NOTE]
//-- PLAYER: How are you getting the resources for such a massive project?
if (branchId == 2 && response == "s_5d8d739e")
{
//-- [NOTE]
if (village_elder_3_condition__defaultCondition (player, self))
{
//-- NPC: Supply convoys mostly. When they can get through the Sith Shadow attacks that is. The margin between what we have and what we need always stays slim, however.
string_id message = new string_id (c_stringFile, "s_f5d9b5d4");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Well, I could see about finding resources. What do you need?
boolean hasResponse0 = false;
if (village_elder_3_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_6aefa2ce");
setObjVar (player, "conversation.village_elder_3.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.village_elder_3.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'That's what we're doing. Well, building one from scratch really. We've got the beginnings of a Mark 4 shield generator right over there.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Supply convoys mostly. When they can get through the Sith Shadow attacks that is. The margin between what we have and what we need always stays slim, however.
//-- [RESPONSE NOTE]
//-- PLAYER: Well, I could see about finding resources. What do you need?
if (branchId == 4 && response == "s_6aefa2ce")
{
//-- [NOTE]
if (village_elder_3_condition__defaultCondition (player, self))
{
//-- NPC: Mostly resources for the shield. Speak to Eozlin to the northwest of here. He should be able to tell you the specifics.
string_id message = new string_id (c_stringFile, "s_ac2de13b");
removeObjVar (player, "conversation.village_elder_3.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Supply convoys mostly. When they can get through the Sith Shadow attacks that is. The margin between what we have and what we need always stays slim, however.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: We're building a Mark 4 shield generator to defend our village. They are used in that.
//-- [RESPONSE NOTE]
//-- PLAYER: A shield generator for an agro-colony? You must grow really juicy Maroj Melons.
if (branchId == 6 && response == "s_afcc98d2")
{
//-- [NOTE]
if (village_elder_3_condition__defaultCondition (player, self))
{
//-- NPC: Usually I'd laugh at that, friend. No, we actually do have need of it. We were recently assaulted by a gang calling itself the Sith Shadows. They killed many of our people and destroyed our crops and much of the village.
string_id message = new string_id (c_stringFile, "s_893aaeea");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Well you don't need a shield for that. You just need me!
boolean hasResponse0 = false;
if (village_elder_3_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'd be willing to sweep the area for their spies and outposts.
boolean hasResponse1 = false;
if (village_elder_3_condition__defaultCondition (player, self))
{
++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_e1b39e83");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_cf4025df");
setObjVar (player, "conversation.village_elder_3.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.village_elder_3.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'We're building a Mark 4 shield generator to defend our village. They are used in that.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Usually I'd laugh at that, friend. No, we actually do have need of it. We were recently assaulted by a gang calling itself the Sith Shadows. They killed many of our people and destroyed our crops and much of the village.
//-- [RESPONSE NOTE]
//-- PLAYER: Well you don't need a shield for that. You just need me!
if (branchId == 7 && response == "s_e1b39e83")
{
//-- [NOTE]
if (village_elder_3_condition__defaultCondition (player, self))
{
//-- NPC: Your confidence is impressive. I hope it's not empty bravado. Speak to Captain Sarguillo right over there. He'll give you all the blood and guts you can stand.
string_id message = new string_id (c_stringFile, "s_efa47d4e");
removeObjVar (player, "conversation.village_elder_3.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Usually I'd laugh at that, friend. No, we actually do have need of it. We were recently assaulted by a gang calling itself the Sith Shadows. They killed many of our people and destroyed our crops and much of the village.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Usually I'd laugh at that, friend. No, we actually do have need of it. We were recently assaulted by a gang calling itself the Sith Shadows. They killed many of our people and destroyed our crops and much of the village.
//-- [RESPONSE NOTE]
//-- PLAYER: I'd be willing to sweep the area for their spies and outposts.
if (branchId == 7 && response == "s_cf4025df")
{
//-- [NOTE]
if (village_elder_3_condition__defaultCondition (player, self))
{
//-- NPC: That would be most helpful. Speak to Dageerin to the west over by the communal huts.
string_id message = new string_id (c_stringFile, "s_abd57d77");
removeObjVar (player, "conversation.village_elder_3.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Usually I'd laugh at that, friend. No, we actually do have need of it. We were recently assaulted by a gang calling itself the Sith Shadows. They killed many of our people and destroyed our crops and much of the village.' were false.");
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
removeObjVar (player, "conversation.village_elder_3.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================