mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-04 04:15:52 -04:00
1126 lines
32 KiB
Plaintext
1126 lines
32 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// mtp_meatlump_wine.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.buff;
|
|
include library.chat;
|
|
include library.collection;
|
|
include library.conversation;
|
|
include library.static_item;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/mtp_meatlump_wine";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean mtp_meatlump_wine_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_wine_condition_hasLockoutBuff (obj_id player, obj_id npc)
|
|
{
|
|
if(buff.hasBuff(player, "mtp_wine_lockout"))
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_wine_condition_readyForTurnIn (obj_id player, obj_id npc)
|
|
{
|
|
if(hasCompletedCollectionSlot(player, "meatlump_wine_juicer_slot") && !hasCompletedCollection(player, "col_meatlump_wine_01"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_wine_condition_wineCollectionComplete_01 (obj_id player, obj_id npc)
|
|
{
|
|
//collection has been completed - don't offer it again.
|
|
if(hasCompletedCollection(player, "col_meatlump_wine_01"))
|
|
{
|
|
return false;
|
|
}
|
|
//collection is currently active - do not offer it again.
|
|
if(hasCompletedCollectionSlotPrereq(player, "meatlump_wine_juicer_slot") && !hasCompletedCollection(player, "col_meatlump_wine_01"))
|
|
{
|
|
return false;
|
|
}
|
|
//player is eligible for the collection - display conversation
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_wine_condition_wineCollectionComplete_02 (obj_id player, obj_id npc)
|
|
{
|
|
if(hasCompletedCollection(player, "col_meatlump_wine_01"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void mtp_meatlump_wine_action_grantWineCollection (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasCompletedCollectionSlotPrereq(player, "meatlump_wine_juicer_slot"))
|
|
{
|
|
modifyCollectionSlotValue(player, "meatlump_wine_starter_slot", 1);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void mtp_meatlump_wine_action_resetWineCollection (obj_id player, obj_id npc)
|
|
{
|
|
if(hasCompletedCollection(player, "col_meatlump_wine_01"))
|
|
{
|
|
//remove the collection
|
|
collection.removeCompletedCollection(player, "col_meatlump_wine_01");
|
|
//activate the collection
|
|
modifyCollectionSlotValue(player, "meatlump_wine_starter_slot", 1);
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void mtp_meatlump_wine_action_finishWineCollection (obj_id player, obj_id npc)
|
|
{
|
|
if(hasCompletedCollectionSlot(player, "meatlump_wine_starter_slot") &&
|
|
hasCompletedCollectionSlot(player, "meatlump_wine_juicer_slot"))
|
|
{
|
|
//complete the collection
|
|
modifyCollectionSlotValue(player, "meatlump_wine_finish_slot", 1);
|
|
//give the player the lockout buff
|
|
buff.applyBuff(player, "mtp_wine_lockout");
|
|
}
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int mtp_meatlump_wine_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Hi there! I'm the Meatlump King's personal chef. He is very particular in what he eats and drinks.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Really? He doesn't look like he's picky about what he eats.
|
|
if (response == "s_15")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh, he is! However, when he finds something he likes, he eats a lot of it.
|
|
string_id message = new string_id (c_stringFile, "s_36");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm curious, what is his favorite food?
|
|
if (response == "s_28")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: It would definitely be our specialty of Meatlump meatlumps.
|
|
string_id message = new string_id (c_stringFile, "s_37");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Mmmm...sounds *cough* tasty. How do you make them?
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Yeah, I've already tried one. They're pretty good.
|
|
boolean hasResponse1 = false;
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I tried one earlier. They're good if it's the last thing in the Galaxy to eat!
|
|
boolean hasResponse2 = false;
|
|
if (mtp_meatlump_wine_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_38");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_55");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_56");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_wine.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What is his favorite drink?
|
|
if (response == "s_35")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Meatlump Wine of course.
|
|
string_id message = new string_id (c_stringFile, "s_40");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Meatlump Wine? Can I try some?
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_wine_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_41");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_wine.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to collect some more 'ooze' for some Meatlump Wine.
|
|
if (response == "s_59")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition_hasLockoutBuff (player, npc))
|
|
{
|
|
//-- NPC: Ah, I can reset the collection for you if you want. This will make it so you can start over and get another bottle of wine.
|
|
string_id message = new string_id (c_stringFile, "s_60");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes! That's what I would like to do. I understand that it will reset the collection.
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Oh, No Thanks! I don't want to reset the collection.
|
|
boolean hasResponse1 = false;
|
|
if (mtp_meatlump_wine_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_62");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_66");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_wine.branchId", 15);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (!mtp_meatlump_wine_condition_hasLockoutBuff (player, npc))
|
|
{
|
|
//-- NPC: We don't need any more wine at the moment. You may want to check back with me tomorrow.
|
|
string_id message = new string_id (c_stringFile, "s_70");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sounds good, I'll try back then.
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_wine_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_72");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_wine.branchId", 18);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I've finished collecting the 'ooze' for the Meatlump Wine.
|
|
if (response == "s_76")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
mtp_meatlump_wine_action_finishWineCollection (player, npc);
|
|
|
|
//-- NPC: That's great! I actually have enough wine for today's meals so you can keep this bottle for yourself.
|
|
string_id message = new string_id (c_stringFile, "s_78");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Very nice! Thanks!
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_wine_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_80");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_wine.branchId", 20);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int mtp_meatlump_wine_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: It would definitely be our specialty of Meatlump meatlumps.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Mmmm...sounds *cough* tasty. How do you make them?
|
|
if (response == "s_38")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh, I can't tell you that. If that recipe were to get out, everyone in the Galaxy would be making them.
|
|
string_id message = new string_id (c_stringFile, "s_39");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Can I try one?
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_wine_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_53");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_wine.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yeah, I've already tried one. They're pretty good.
|
|
if (response == "s_55")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Ah, glad to hear you like them. Feel free to drop by and grab another every now and then.
|
|
string_id message = new string_id (c_stringFile, "s_57");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I tried one earlier. They're good if it's the last thing in the Galaxy to eat!
|
|
if (response == "s_56")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: It's an acquired taste...
|
|
string_id message = new string_id (c_stringFile, "s_58");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int mtp_meatlump_wine_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Oh, I can't tell you that. If that recipe were to get out, everyone in the Galaxy would be making them.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Can I try one?
|
|
if (response == "s_53")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Sure! I have a few over there on the grills. Help yourself to one.
|
|
string_id message = new string_id (c_stringFile, "s_54");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int mtp_meatlump_wine_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Meatlump Wine of course.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Meatlump Wine? Can I try some?
|
|
if (response == "s_41")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Unfortunately we are running low right now. I could give you a bottle if you would be willing to help me with something.
|
|
string_id message = new string_id (c_stringFile, "s_42");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sorry, I'm busy right now. I'll try back some other time.
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: What do you need me to do?
|
|
boolean hasResponse1 = false;
|
|
if (mtp_meatlump_wine_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_43");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_44");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_wine.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int mtp_meatlump_wine_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Unfortunately we are running low right now. I could give you a bottle if you would be willing to help me with something.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sorry, I'm busy right now. I'll try back some other time.
|
|
if (response == "s_43")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Alright, let me know when you can lend a hand and I'll give you a sample.
|
|
string_id message = new string_id (c_stringFile, "s_46");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What do you need me to do?
|
|
if (response == "s_44")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well, Meatlump Wine is made from...well...
|
|
string_id message = new string_id (c_stringFile, "s_45");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Juices? From rodents? You can't be serious...
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_wine_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_47");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_wine.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int mtp_meatlump_wine_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well, Meatlump Wine is made from...well...
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Juices? From rodents? You can't be serious...
|
|
if (response == "s_47")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: One taste of our wine will remove that look of disgust from your face. Will you help me?
|
|
string_id message = new string_id (c_stringFile, "s_48");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sure. I just squash every rodent I see?
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No way. I don't care how 'good' it supposedly tastes, you're not getting me to try it!
|
|
boolean hasResponse1 = false;
|
|
if (mtp_meatlump_wine_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_49");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_50");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_wine.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int mtp_meatlump_wine_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: One taste of our wine will remove that look of disgust from your face. Will you help me?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sure. I just squash every rodent I see?
|
|
if (response == "s_49")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
mtp_meatlump_wine_action_grantWineCollection (player, npc);
|
|
|
|
//-- NPC: Yes, that's it. Return to me when you're done.
|
|
string_id message = new string_id (c_stringFile, "s_51");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No way. I don't care how 'good' it supposedly tastes, you're not getting me to try it!
|
|
if (response == "s_50")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well, I'm always here just in case you change your mind. Take care.
|
|
string_id message = new string_id (c_stringFile, "s_52");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int mtp_meatlump_wine_handleBranch15 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Ah, I can reset the collection for you if you want. This will make it so you can start over and get another bottle of wine.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes! That's what I would like to do. I understand that it will reset the collection.
|
|
if (response == "s_62")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
mtp_meatlump_wine_action_resetWineCollection (player, npc);
|
|
|
|
//-- NPC: Ok, I'm resetting your collection and activating it now.
|
|
string_id message = new string_id (c_stringFile, "s_64");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Oh, No Thanks! I don't want to reset the collection.
|
|
if (response == "s_66")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I'm here if you ever change your mind.
|
|
string_id message = new string_id (c_stringFile, "s_68");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int mtp_meatlump_wine_handleBranch18 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We don't need any more wine at the moment. You may want to check back with me tomorrow.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sounds good, I'll try back then.
|
|
if (response == "s_72")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Take care.
|
|
string_id message = new string_id (c_stringFile, "s_74");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int mtp_meatlump_wine_handleBranch20 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: That's great! I actually have enough wine for today's meals so you can keep this bottle for yourself.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Very nice! Thanks!
|
|
if (response == "s_80")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Check back in a day or so, I may need some more then. Take care.
|
|
string_id message = new string_id (c_stringFile, "s_82");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isTangible (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.mtp_meatlump_wine");
|
|
|
|
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.mtp_meatlump_wine");
|
|
|
|
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 (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Hi there! I'm the Meatlump King's personal chef. He is very particular in what he eats and drinks.
|
|
string_id message = new string_id (c_stringFile, "s_13");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Really? He doesn't look like he's picky about what he eats.
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm curious, what is his favorite food?
|
|
boolean hasResponse1 = false;
|
|
if (mtp_meatlump_wine_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: What is his favorite drink?
|
|
boolean hasResponse2 = false;
|
|
if (mtp_meatlump_wine_condition_wineCollectionComplete_01 (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to collect some more 'ooze' for some Meatlump Wine.
|
|
boolean hasResponse3 = false;
|
|
if (mtp_meatlump_wine_condition_wineCollectionComplete_02 (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I've finished collecting the 'ooze' for the Meatlump Wine.
|
|
boolean hasResponse4 = false;
|
|
if (mtp_meatlump_wine_condition_readyForTurnIn (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_15");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_28");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_35");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_59");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_76");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_wine.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "mtp_meatlump_wine", message, responses);
|
|
}
|
|
else
|
|
{
|
|
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 != "mtp_meatlump_wine")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
if (branchId == 1 && mtp_meatlump_wine_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && mtp_meatlump_wine_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && mtp_meatlump_wine_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && mtp_meatlump_wine_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && mtp_meatlump_wine_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && mtp_meatlump_wine_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && mtp_meatlump_wine_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 15 && mtp_meatlump_wine_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 18 && mtp_meatlump_wine_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 20 && mtp_meatlump_wine_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_wine.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|