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

728 lines
21 KiB
Plaintext

// ======================================================================
//
// porcellus.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.groundquests;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/porcellus";
// ======================================================================
// Script Conditions
// ======================================================================
boolean porcellus_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean porcellus_condition_completedPorcellus (obj_id player, obj_id npc)
{
if (groundquests.hasCompletedQuest (player, "quest/jabba_porcellus"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean porcellus_condition_completedEphantMon (obj_id player, obj_id npc)
{
if (groundquests.hasCompletedQuest (player, "quest/jabba_ephant_mon"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean porcellus_condition_gettingAppetizer (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive(player, "quest/jabba_porcellus", "appetizer"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean porcellus_condition_gettingSoup (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive(player, "quest/jabba_porcellus", "soup"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean porcellus_condition_gettingSalad (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive(player, "quest/jabba_porcellus", "salad"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean porcellus_condition_gettingEntree (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive(player, "quest/jabba_porcellus", "entree"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean porcellus_condition_gettingDessert (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive(player, "quest/jabba_porcellus", "dessert"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean porcellus_condition_gettingWine (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive(player, "quest/jabba_porcellus", "wine"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean porcellus_condition_returningIngredients (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive(player, "quest/jabba_porcellus", "delivery"))
{
return true;
}
return false;
}
// ======================================================================
// Script Actions
// ======================================================================
void porcellus_action_sendFinishSignal (obj_id player, obj_id npc)
{
faceTo(npc, player);
groundquests.sendSignal (player, "completedPorcellus");
}
// ----------------------------------------------------------------------
void porcellus_action_grantPorcellusQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest (player, "quest/jabba_porcellus");
}
// ----------------------------------------------------------------------
void porcellus_action_pointToBarada (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "pointer_barada");
}
// ----------------------------------------------------------------------
void porcellus_action_clearPointer (obj_id player, obj_id npc)
{
faceTo(npc, player);
groundquests.sendSignal(player, "found_porcellus");
}
// ----------------------------------------------------------------------
void porcellus_action_facePlayer (obj_id player, obj_id npc)
{
faceTo(npc, player);
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int porcellus_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Ah, yes, these ingredients will do perfectly! Oh, I can't thank you enough. Jabba will have to let me go after this meal. This is going to be the best meal I've ever cooked!
//-- [RESPONSE NOTE]
//-- PLAYER: Can you think of anything for me to do now?
if (response == "s_23")
{
//-- [NOTE]
if (porcellus_condition__defaultCondition (player, npc))
{
porcellus_action_pointToBarada (player, npc);
//-- NPC: You should head down to the garage and see Barada. I brought him some snacks a little while ago and he was complaining about needing help with something.
string_id message = new string_id (c_stringFile, "s_24");
utils.removeScriptVar (player, "conversation.porcellus.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int porcellus_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Say, you look handy. I could use someone to scrounge together some ingredients for me. Can you help me out?
//-- [RESPONSE NOTE]
//-- PLAYER: I don't cook.
if (response == "s_26")
{
//-- [NOTE]
if (porcellus_condition__defaultCondition (player, npc))
{
//-- NPC: Oh, it's just as well. You probably couldn't have handled it anyway.
string_id message = new string_id (c_stringFile, "s_28");
utils.removeScriptVar (player, "conversation.porcellus.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Just tell me what you need.
if (response == "s_30")
{
//-- [NOTE]
if (porcellus_condition__defaultCondition (player, npc))
{
porcellus_action_grantPorcellusQuest (player, npc);
//-- NPC: Fantastic. You're going to start by bringing me gizzards. Gizzards from lizards. Dune lizards to be exact. Dune lizard gizzards. Hey, that's fun to say! Ok, start with that, and I'll let you know what else we need after that.
string_id message = new string_id (c_stringFile, "s_32");
utils.removeScriptVar (player, "conversation.porcellus.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What exactly are you cooking?
if (response == "s_34")
{
//-- [NOTE]
if (porcellus_condition__defaultCondition (player, npc))
{
//-- NPC: Oh, this is going to be great. I've been Jabba's slave, er-I mean chef for too long. I'm going to make him the best meal he's ever had, and then when he's satiated and in a good mood I'm going to ask him to release me. He'll have to say yes.
string_id message = new string_id (c_stringFile, "s_36");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So, what are you cooking?
boolean hasResponse0 = false;
if (porcellus_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_38");
utils.setScriptVar (player, "conversation.porcellus.branchId", 13);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.porcellus.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int porcellus_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Oh, this is going to be great. I've been Jabba's slave, er-I mean chef for too long. I'm going to make him the best meal he's ever had, and then when he's satiated and in a good mood I'm going to ask him to release me. He'll have to say yes.
//-- [RESPONSE NOTE]
//-- PLAYER: So, what are you cooking?
if (response == "s_38")
{
//-- [NOTE]
if (porcellus_condition__defaultCondition (player, npc))
{
//-- NPC: A five course meal. Stuffed dune lizard gizzard appetizers, beetle broth, squill liver salad, dragonet steaks, and zucca fruit pastries for dessert. We'll probably also need some wine.
string_id message = new string_id (c_stringFile, "s_40");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Where should I start?
boolean hasResponse0 = false;
if (porcellus_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm not interested.
boolean hasResponse1 = false;
if (porcellus_condition__defaultCondition (player, npc))
{
++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_42");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_44");
utils.setScriptVar (player, "conversation.porcellus.branchId", 14);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.porcellus.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int porcellus_handleBranch14 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: A five course meal. Stuffed dune lizard gizzard appetizers, beetle broth, squill liver salad, dragonet steaks, and zucca fruit pastries for dessert. We'll probably also need some wine.
//-- [RESPONSE NOTE]
//-- PLAYER: Where should I start?
if (response == "s_42")
{
//-- [NOTE]
if (porcellus_condition__defaultCondition (player, npc))
{
porcellus_action_grantPorcellusQuest (player, npc);
//-- NPC: Fantastic. You're going to start by bringing me gizzards. Gizzards from lizards. Dune lizards to be exact. Dune lizard gizzards. Hey, that's fun to say! Ok, start with that, and I'll let you know what else we need after that.
string_id message = new string_id (c_stringFile, "s_32");
utils.removeScriptVar (player, "conversation.porcellus.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I'm not interested.
if (response == "s_44")
{
//-- [NOTE]
if (porcellus_condition__defaultCondition (player, npc))
{
//-- NPC: Oh, it's just as well. You probably couldn't have handled it anyway.
string_id message = new string_id (c_stringFile, "s_28");
utils.removeScriptVar (player, "conversation.porcellus.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.porcellus");
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.porcellus");
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 (porcellus_condition_completedPorcellus (player, npc))
{
porcellus_action_facePlayer (player, npc);
//-- NPC: That meal was exquisite. Jabba, of course, scarfed it down without tasting it, but what I sampled myself was incredible. I have you to thank for that.
string_id message = new string_id (c_stringFile, "s_4");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (porcellus_condition_returningIngredients (player, npc))
{
porcellus_action_sendFinishSignal (player, npc);
//-- NPC: Ah, yes, these ingredients will do perfectly! Oh, I can't thank you enough. Jabba will have to let me go after this meal. This is going to be the best meal I've ever cooked!
string_id message = new string_id (c_stringFile, "s_6");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Can you think of anything for me to do now?
boolean hasResponse0 = false;
if (porcellus_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_23");
utils.setScriptVar (player, "conversation.porcellus.branchId", 2);
npcStartConversation (player, npc, "porcellus", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (porcellus_condition_gettingWine (player, npc))
{
porcellus_action_facePlayer (player, npc);
//-- NPC: I'm going to need you to make sure that wine is unopened when you take it from Valarian's people. We can't serve opened wine bottles here, you know. We're not animals.
string_id message = new string_id (c_stringFile, "s_10");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (porcellus_condition_gettingDessert (player, npc))
{
porcellus_action_facePlayer (player, npc);
//-- NPC: We're going all out for this meal. I've got to convince Jabba to free me, and this is my best shot. Zucca Boar meat is needed!
string_id message = new string_id (c_stringFile, "s_12");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (porcellus_condition_gettingEntree (player, npc))
{
porcellus_action_facePlayer (player, npc);
//-- NPC: Have you ever had dragonet steaks? You have to cook them medium rare, it's the only way they maintain their flavor.
string_id message = new string_id (c_stringFile, "s_14");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (porcellus_condition_gettingSalad (player, npc))
{
porcellus_action_facePlayer (player, npc);
//-- NPC: You'd think he could just have vegetables, wouldn't you? It's all right. If you spice the squill livers just right they don't detract from the experience.
string_id message = new string_id (c_stringFile, "s_16");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (porcellus_condition_gettingSoup (player, npc))
{
porcellus_action_facePlayer (player, npc);
//-- NPC: I have to start the stock cooking for those beetles soon. You can never take too much time or put too much effort into making a good broth.
string_id message = new string_id (c_stringFile, "s_18");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (porcellus_condition_gettingAppetizer (player, npc))
{
porcellus_action_facePlayer (player, npc);
//-- NPC: I'm already chopping the ingredients I'll need to stuff the dune giz-, I mean the gune giz-, the uh, lune, no. What I meant to say was, the dune. Lizard. Gizzards. Yes, that's it.
string_id message = new string_id (c_stringFile, "s_20");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (porcellus_condition_completedEphantMon (player, npc))
{
porcellus_action_clearPointer (player, npc);
//-- NPC: Say, you look handy. I could use someone to scrounge together some ingredients for me. Can you help me out?
string_id message = new string_id (c_stringFile, "s_22");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I don't cook.
boolean hasResponse0 = false;
if (porcellus_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Just tell me what you need.
boolean hasResponse1 = false;
if (porcellus_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: What exactly are you cooking?
boolean hasResponse2 = false;
if (porcellus_condition__defaultCondition (player, npc))
{
++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_26");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_30");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_34");
utils.setScriptVar (player, "conversation.porcellus.branchId", 10);
npcStartConversation (player, npc, "porcellus", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (porcellus_condition__defaultCondition (player, npc))
{
porcellus_action_facePlayer (player, npc);
//-- NPC: I'm way too busy slaving over this stove to speak with you right now. Have you talked to Ephant Mon? I'm sure he could use your help.
string_id message = new string_id (c_stringFile, "s_46");
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 != "porcellus")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.porcellus.branchId");
if (branchId == 2 && porcellus_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && porcellus_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && porcellus_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 14 && porcellus_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.porcellus.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================