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

726 lines
23 KiB
Plaintext

// ======================================================================
//
// village_elder_4.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_4";
// ======================================================================
// Script Conditions
// ======================================================================
boolean village_elder_4_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean village_elder_4_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_4_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_4");
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_4");
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_4_condition__defaultCondition (player, self))
{
//-- NPC: Be careful, we've received information that the Sith Shadows will attack soon.
string_id message = new string_id (c_stringFile, "s_8aa931e3");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Who are the Sith Shadows?
boolean hasResponse0 = false;
if (village_elder_4_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Again? Haven't they learned their lesson?
boolean hasResponse1 = false;
if (village_elder_4_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_4_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_e5a75b57");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_a098d669");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_9dc8bf5d");
setObjVar (player, "conversation.village_elder_4.branchId", 1);
npcStartConversation (player, self, "village_elder_4", 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_elder_4")
return SCRIPT_CONTINUE;
int branchId = getIntObjVar (player, "conversation.village_elder_4.branchId");
//-- [BRANCH NOTE]
//-- NPC: Be careful, we've received information that the Sith Shadows will attack soon.
//-- [RESPONSE NOTE]
//-- PLAYER: Who are the Sith Shadows?
if (branchId == 1 && response == "s_e5a75b57")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: They seem to be our bane. For some reason they assaulted our village many days ago. We've been rebuilding and reinforcing our village ever since.
string_id message = new string_id (c_stringFile, "s_448b67d0");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You look pretty well defended.
boolean hasResponse0 = false;
if (village_elder_4_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_aba5c1a8");
setObjVar (player, "conversation.village_elder_4.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Be careful, we've received information that the Sith Shadows will attack soon.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Be careful, we've received information that the Sith Shadows will attack soon.
//-- [RESPONSE NOTE]
//-- PLAYER: Again? Haven't they learned their lesson?
if (branchId == 1 && response == "s_a098d669")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: Apparently not. I think they are looking to finish us off this time.
string_id message = new string_id (c_stringFile, "s_d1431da3");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Well they are going to have a tough time with all the new defenses.
boolean hasResponse0 = false;
if (village_elder_4_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_de1f69ee");
setObjVar (player, "conversation.village_elder_4.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Be careful, we've received information that the Sith Shadows will attack soon.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Be careful, we've received information that the Sith Shadows will attack soon.
//-- [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_4_condition_needCrystal (player, self))
{
village_elder_4_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_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (!village_elder_4_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_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Be careful, we've received information that the Sith Shadows will attack soon.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: They seem to be our bane. For some reason they assaulted our village many days ago. We've been rebuilding and reinforcing our village ever since.
//-- [RESPONSE NOTE]
//-- PLAYER: You look pretty well defended.
if (branchId == 2 && response == "s_aba5c1a8")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.
string_id message = new string_id (c_stringFile, "s_12b92ec4");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I am tough enough to pull the ears off a gundark.
boolean hasResponse0 = false;
if (village_elder_4_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm a crack shot with a blaster.
boolean hasResponse1 = false;
if (village_elder_4_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I am a medic. I could help heal your soldiers.
boolean hasResponse2 = false;
if (village_elder_4_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
//-- PLAYER: I'm a crafter, what can I do in a battle?
boolean hasResponse3 = false;
if (village_elder_4_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse3 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_17446822");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_f24ae96");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_4d4da25b");
if (hasResponse3)
responses [responseIndex++] = new string_id (c_stringFile, "s_97092ac2");
setObjVar (player, "conversation.village_elder_4.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'They seem to be our bane. For some reason they assaulted our village many days ago. We've been rebuilding and reinforcing our village ever since.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.
//-- [RESPONSE NOTE]
//-- PLAYER: I am tough enough to pull the ears off a gundark.
if (branchId == 3 && response == "s_17446822")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: Well we need good skirmishers to meet them head on. Speak to Captain Sarguillo, right over there.
string_id message = new string_id (c_stringFile, "s_ae755ac3");
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm a crack shot with a blaster.
if (branchId == 3 && response == "s_f24ae96")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: Captain Sarguillo has need of good soldiers like you. He's right over there.
string_id message = new string_id (c_stringFile, "s_e0741a0c");
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.
//-- [RESPONSE NOTE]
//-- PLAYER: I am a medic. I could help heal your soldiers.
if (branchId == 3 && response == "s_4d4da25b")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: I am sure Sivarra will need all the help she can get. You can find her at the medic tent to the Northwest.
string_id message = new string_id (c_stringFile, "s_8c109ae0");
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm a crafter, what can I do in a battle?
if (branchId == 3 && response == "s_97092ac2")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: Speak to our new chief engineer, he is new and a bit frazzled. You would be a great help to him. You can find him to the East at his hut near the sensor array.
string_id message = new string_id (c_stringFile, "s_48fd623");
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Apparently not. I think they are looking to finish us off this time.
//-- [RESPONSE NOTE]
//-- PLAYER: Well they are going to have a tough time with all the new defenses.
if (branchId == 8 && response == "s_de1f69ee")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.
string_id message = new string_id (c_stringFile, "s_12b92ec4");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I am tough enough to pull the ears off a gundark.
boolean hasResponse0 = false;
if (village_elder_4_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm a crack shot with a blaster.
boolean hasResponse1 = false;
if (village_elder_4_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I am a medic. I could help heal your soldiers.
boolean hasResponse2 = false;
if (village_elder_4_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
//-- PLAYER: I'm a crafter, what can I do in a battle?
boolean hasResponse3 = false;
if (village_elder_4_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse3 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_17446822");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_f24ae96");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_4d4da25b");
if (hasResponse3)
responses [responseIndex++] = new string_id (c_stringFile, "s_97092ac2");
setObjVar (player, "conversation.village_elder_4.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Apparently not. I think they are looking to finish us off this time.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.
//-- [RESPONSE NOTE]
//-- PLAYER: I am tough enough to pull the ears off a gundark.
if (branchId == 9 && response == "s_17446822")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: Well we need good skirmishers to meet them head on. Speak to Captain Sarguillo, right over there.
string_id message = new string_id (c_stringFile, "s_ae755ac3");
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm a crack shot with a blaster.
if (branchId == 9 && response == "s_f24ae96")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: Captain Sarguillo has need of good soldiers like you. He's right over there.
string_id message = new string_id (c_stringFile, "s_e0741a0c");
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.
//-- [RESPONSE NOTE]
//-- PLAYER: I am a medic. I could help heal your soldiers.
if (branchId == 9 && response == "s_4d4da25b")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: I am sure Sivarra will need all the help she can get. You can find her at the medic tent to the Northwest.
string_id message = new string_id (c_stringFile, "s_8c109ae0");
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm a crafter, what can I do in a battle?
if (branchId == 9 && response == "s_97092ac2")
{
//-- [NOTE]
if (village_elder_4_condition__defaultCondition (player, self))
{
//-- NPC: Speak to our new chief engineer, he is new and a bit frazzled. You would be a great help to him. You can find him to the East at his hut near the sensor array.
string_id message = new string_id (c_stringFile, "s_48fd623");
removeObjVar (player, "conversation.village_elder_4.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'I sure hope so, but I think we're going to need more help than just the shield generator and blaster turrets.' were false.");
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
removeObjVar (player, "conversation.village_elder_4.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================