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

552 lines
17 KiB
Plaintext

// ======================================================================
//
// disgruntled_leader.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.conversation;
include library.groundquests;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/disgruntled_leader";
// ======================================================================
// Script Conditions
// ======================================================================
boolean disgruntled_leader_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean disgruntled_leader_condition_hasQuest (obj_id player, obj_id npc)
{
faceTo(npc, player);
return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findTownsPeople");
}
// ----------------------------------------------------------------------
boolean disgruntled_leader_condition_hasFinishedQuest (obj_id player, obj_id npc)
{
faceTo(npc, player);
return groundquests.isTaskActive(player, "u16_nym_return_townsperson", "returnToTownsPerson");
}
// ----------------------------------------------------------------------
boolean disgruntled_leader_condition_isWorkingOnIt (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findFiltrationGuy")
|| (groundquests.hasCompletedQuest(player, "u16_nym_meet_townspeople")
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson"));
}
// ======================================================================
// Script Actions
// ======================================================================
void disgruntled_leader_action_signalToGoToNym (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasFoundTownsPeopleAgain");
}
// ----------------------------------------------------------------------
void disgruntled_leader_action_hasMetTownsPeople (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasFoundTownsPeople");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int disgruntled_leader_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Oh you want my thanks because you lifted a finger? You tell Nym that this is only the beginning. We need things fixed around this city. You tell him I'm making a list and if he thinks this is the last he's heard from us then he's got another think coming! And that's not all, we...
//-- [RESPONSE NOTE]
//-- PLAYER: You're welcome.
if (response == "s_17")
{
doAnimationAction (player, "shake_head_disgust");
//-- [NOTE]
if (disgruntled_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
disgruntled_leader_action_signalToGoToNym (player, npc);
//-- NPC: Fine! Walk off while I'm talking! Nym will hear about how rude his so-called 'Champion' is, too, you can count on that!
string_id message = new string_id (c_stringFile, "s_18");
utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int disgruntled_leader_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Who are you?
//-- [RESPONSE NOTE]
//-- PLAYER: I'm the Champion...oh never mind.
if (response == "s_10")
{
doAnimationAction (player, "point_to_self");
//-- [NOTE]
if (disgruntled_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_accusingly");
//-- NPC: Do you work for Nym?
string_id message = new string_id (c_stringFile, "s_12");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes, Nym asked me...
boolean hasResponse0 = false;
if (disgruntled_leader_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_14");
utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int disgruntled_leader_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Do you work for Nym?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, Nym asked me...
if (response == "s_14")
{
doAnimationAction (player, "taken_aback");
//-- [NOTE]
if (disgruntled_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "poke");
//-- NPC: Look. We need Nym to take care of some basic needs! It is obvious by his total reluctance to talk to his citizens that he doesn't care. But I bet he will when we all leave. Maybe a better name for this hole is Nym's Ghost Town!
string_id message = new string_id (c_stringFile, "s_19");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Take it easy. I'm...
boolean hasResponse0 = false;
if (disgruntled_leader_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_21");
utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int disgruntled_leader_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Look. We need Nym to take care of some basic needs! It is obvious by his total reluctance to talk to his citizens that he doesn't care. But I bet he will when we all leave. Maybe a better name for this hole is Nym's Ghost Town!
//-- [RESPONSE NOTE]
//-- PLAYER: Take it easy. I'm...
if (response == "s_21")
{
doAnimationAction (player, "taken_aback");
//-- [NOTE]
if (disgruntled_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
//-- NPC: How about you make yourself useful and fix the water supply before we all die. If you didn't notice the streams on this planet are not drinkable. We used to have access to filtered water, but now we don't. We haven't even been able to properly bathe in weeks! Yes, it is quite obvious that Nym is trying to kill us all!
string_id message = new string_id (c_stringFile, "s_23");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'll take care of it.
boolean hasResponse0 = false;
if (disgruntled_leader_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_25");
utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int disgruntled_leader_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: How about you make yourself useful and fix the water supply before we all die. If you didn't notice the streams on this planet are not drinkable. We used to have access to filtered water, but now we don't. We haven't even been able to properly bathe in weeks! Yes, it is quite obvious that Nym is trying to kill us all!
//-- [RESPONSE NOTE]
//-- PLAYER: I'll take care of it.
if (response == "s_25")
{
//-- [NOTE]
if (disgruntled_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_away");
disgruntled_leader_action_hasMetTownsPeople (player, npc);
//-- NPC: Sure you will. Here is the location of Phor Cl-lan. He's the so-called Water Treatment Tech. Maybe a 'Champion' can squeeze some fresh water out of him... if you can manage not to get lost.
string_id message = new string_id (c_stringFile, "s_27");
utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.disgruntled_leader");
setCondition (self, CONDITION_CONVERSABLE);
setCondition( self, CONDITION_INTERESTING );
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition( self, CONDITION_INTERESTING );
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.disgruntled_leader");
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 (disgruntled_leader_condition_hasFinishedQuest (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
//-- NPC: Oh you want my thanks because you lifted a finger? You tell Nym that this is only the beginning. We need things fixed around this city. You tell him I'm making a list and if he thinks this is the last he's heard from us then he's got another think coming! And that's not all, we...
string_id message = new string_id (c_stringFile, "s_16");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You're welcome.
boolean hasResponse0 = false;
if (disgruntled_leader_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_17");
utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 1);
npcStartConversation (player, npc, "disgruntled_leader", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (disgruntled_leader_condition_isWorkingOnIt (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
doAnimationAction (player, "standing_placate");
//-- NPC: What? Got lost? Tired? Want a Gualaar? I can't even get a Gualaar and I'm a town veteran! And another thing...!
string_id message = new string_id (c_stringFile, "s_29");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (disgruntled_leader_condition_hasQuest (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
//-- NPC: Who are you?
string_id message = new string_id (c_stringFile, "s_8");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm the Champion...oh never mind.
boolean hasResponse0 = false;
if (disgruntled_leader_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.disgruntled_leader.branchId", 4);
npcStartConversation (player, npc, "disgruntled_leader", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (disgruntled_leader_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
//-- NPC: My grievances will be heard by someone in charge!
string_id message = new string_id (c_stringFile, "s_30");
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 != "disgruntled_leader")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.disgruntled_leader.branchId");
if (branchId == 1 && disgruntled_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && disgruntled_leader_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && disgruntled_leader_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && disgruntled_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && disgruntled_leader_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================