Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/quest_u10_bossk.script
T
2013-09-10 23:17:15 -07:00

415 lines
13 KiB
Plaintext

// ======================================================================
//
// quest_u10_bossk.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/quest_u10_bossk";
// ======================================================================
// Script Conditions
// ======================================================================
boolean quest_u10_bossk_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean quest_u10_bossk_condition_quest_u10_02_03_active (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "quest_u10_02", "quest_u10_02_03");
}
// ----------------------------------------------------------------------
boolean quest_u10_bossk_condition_quest_u10_01_04_active (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "quest_u10_02", "quest_u10_02_04") ||
groundquests.hasCompletedTask(player, "quest_u10_02", "quest_u10_02_04");
}
// ----------------------------------------------------------------------
boolean quest_u10_bossk_condition_quest_u10_03_needed (obj_id player, obj_id npc)
{
return !groundquests.isQuestActiveOrComplete(player, "quest_u10_03");
}
// ----------------------------------------------------------------------
boolean quest_u10_bossk_condition_quest_u10_02_02_active (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "quest_u10_02", "quest_u10_02_02");
}
// ======================================================================
// Script Actions
// ======================================================================
void quest_u10_bossk_action_quest_u10_02_02_signal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "quest_u10_02_02");
}
// ----------------------------------------------------------------------
void quest_u10_bossk_action_quest_u10_03_grant (obj_id player, obj_id npc)
{
groundquests.requestGrantQuest(player, "quest_u10_03");
}
// ----------------------------------------------------------------------
void quest_u10_bossk_action_quest_u10_02_04_signal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "quest_u10_02_04");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int quest_u10_bossk_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Not bad. Not bad at all. You handle yourself well. The Bofa Treat Gang never stood a chance.
//-- [RESPONSE NOTE]
//-- PLAYER: The pleasure was all mine.
if (response == "s_31")
{
//-- [NOTE]
if (quest_u10_bossk_condition__defaultCondition (player, npc))
{
quest_u10_bossk_action_quest_u10_03_grant (player, npc);
//-- NPC: Tell you what. I have three bounties on Lok I haven't had a chance to collect. You take care of them for me, and I'll split the bounty with you. An associate of mine, named Balfur, has been tracking them. Speak with him for more details. He should still be in his camp outside of Nym's Stronghold on Lok.
string_id message = new string_id (c_stringFile, "s_32");
utils.removeScriptVar (player, "conversation.quest_u10_bossk.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int quest_u10_bossk_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Who are you? Oh, you're here for Louis? I suppose that can work. We'll find out soon enough. I have Louis here as my prisoner. If you do what I ask, I'll let him go.
//-- [RESPONSE NOTE]
//-- PLAYER: What do you want me to do?
if (response == "s_33")
{
//-- [NOTE]
if (quest_u10_bossk_condition__defaultCondition (player, npc))
{
quest_u10_bossk_action_quest_u10_02_02_signal (player, npc);
//-- NPC: The bounty on Louis, as well as his brothers, was placed by a man named Lucien. He leads the Bofa Treat Gang who use this bunker here as their hideout. What Lucien apparently does not realize is that there is a much larger bounty on him. I would prefer that larger bounty. You take care of Lucien and his gang, and I'll let Louis go.
string_id message = new string_id (c_stringFile, "s_35");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'll do it.
boolean hasResponse0 = false;
if (quest_u10_bossk_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.quest_u10_bossk.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.quest_u10_bossk.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int quest_u10_bossk_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The bounty on Louis, as well as his brothers, was placed by a man named Lucien. He leads the Bofa Treat Gang who use this bunker here as their hideout. What Lucien apparently does not realize is that there is a much larger bounty on him. I would prefer that larger bounty. You take care of Lucien and his gang, and I'll let Louis go.
//-- [RESPONSE NOTE]
//-- PLAYER: I'll do it.
if (response == "s_12")
{
//-- [NOTE]
if (quest_u10_bossk_condition__defaultCondition (player, npc))
{
quest_u10_bossk_action_quest_u10_02_02_signal (player, npc);
//-- NPC: You'll find them all inside of that nearby bunker a bit to the south. Go on, I don't have all day to wait.
string_id message = new string_id (c_stringFile, "s_14");
utils.removeScriptVar (player, "conversation.quest_u10_bossk.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.quest_u10_bossk");
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.quest_u10_bossk");
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 (quest_u10_bossk_condition_quest_u10_01_04_active (player, npc))
{
quest_u10_bossk_action_quest_u10_02_04_signal (player, npc);
//-- NPC: Not bad. Not bad at all. You handle yourself well. The Bofa Treat Gang never stood a chance.
string_id message = new string_id (c_stringFile, "s_30");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: The pleasure was all mine.
boolean hasResponse0 = false;
if (quest_u10_bossk_condition_quest_u10_03_needed (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_31");
utils.setScriptVar (player, "conversation.quest_u10_bossk.branchId", 1);
npcStartConversation (player, npc, "quest_u10_bossk", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (quest_u10_bossk_condition_quest_u10_02_03_active (player, npc))
{
//-- NPC: If you're too afraid to take on the Bofa Treat Gang, say so now. Either Louis' brothers will have to make an appearance, or I'll just collect his bounty.
string_id message = new string_id (c_stringFile, "s_37");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (quest_u10_bossk_condition_quest_u10_02_02_active (player, npc))
{
//-- NPC: Who are you? Oh, you're here for Louis? I suppose that can work. We'll find out soon enough. I have Louis here as my prisoner. If you do what I ask, I'll let him go.
string_id message = new string_id (c_stringFile, "s_8");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What do you want me to do?
boolean hasResponse0 = false;
if (quest_u10_bossk_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_33");
utils.setScriptVar (player, "conversation.quest_u10_bossk.branchId", 4);
npcStartConversation (player, npc, "quest_u10_bossk", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (quest_u10_bossk_condition__defaultCondition (player, npc))
{
//-- NPC: Calm down, Meatlump. I'm sure your brothers will be along soon. For your sake, you should hope so anyway. I'm getting paid either way.
string_id message = new string_id (c_stringFile, "s_29");
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 != "quest_u10_bossk")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.quest_u10_bossk.branchId");
if (branchId == 1 && quest_u10_bossk_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && quest_u10_bossk_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && quest_u10_bossk_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.quest_u10_bossk.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================