mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
588 lines
19 KiB
Plaintext
588 lines
19 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// mtp_meatlump_king.script
|
|
//
|
|
//
|
|
//
|
|
// 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/mtp_meatlump_king";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean mtp_meatlump_king_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_readyforAct2Story (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActiveOrComplete(player, "mtp_hideout_pointer") &&
|
|
!groundquests.isQuestActiveOrComplete(player, "mtp_meatlump_king_story");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb01 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 1;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb02 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 2;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb03 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 3;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb04 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 4;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb05 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 5;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb06 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 6;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb07 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 7;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb08 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 8;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb09 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 9;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb10 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 10;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb11 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 11;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb12 (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 12;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean mtp_meatlump_king_condition_blurb_rare (obj_id player, obj_id npc)
|
|
{
|
|
return utils.getIntScriptVar(player, "mtp_meatlumpKingBlurb") == 9999;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void mtp_meatlump_king_action_grantAct2Story (obj_id player, obj_id npc)
|
|
{
|
|
chat.thinkTo(player, player, new string_id("theme_park/corellia/quest", "mtp_king_story_quest"));
|
|
|
|
groundquests.grantQuest(player, "mtp_meatlump_king_story");
|
|
return;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void mtp_meatlump_king_action_setEmperorAppearance (obj_id player, obj_id npc)
|
|
{
|
|
location here = getLocation(npc);
|
|
playClientEffectLoc(getPlayerCreaturesInRange(here, 100.0f), "clienteffect/jedi_master_cloak_good.cef", here, 0.0f);
|
|
setObjectAppearance(npc, "object/mobile/shared_palpatine.iff");
|
|
|
|
messageTo(npc, "handlePointToSelf", null, 1, false);
|
|
messageTo(npc, "handleResetMeatlumpKingAppearance", null, 5, false);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int mtp_meatlump_king_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Ah, a new Meatlump. Welcome. I am the King.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How did you become King of the Meatlumps?
|
|
if (response == "s_6")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_king_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I was the first. When I started, I was the only one. Though back then, the name meatlump only referred to a delicious snack. It was Draykken who named us Meatlumps! But even so, it is only right that I am King. For I am the tallest and the most glorious.
|
|
string_id message = new string_id (c_stringFile, "s_8");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I almost asked if it was because you were most glorious.
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_king_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Being glorious isn't a basis for government. How about we vote?
|
|
boolean hasResponse1 = false;
|
|
if (mtp_meatlump_king_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_11");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_14");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_king.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_king.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int mtp_meatlump_king_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I was the first. When I started, I was the only one. Though back then, the name meatlump only referred to a delicious snack. It was Draykken who named us Meatlumps! But even so, it is only right that I am King. For I am the tallest and the most glorious.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I almost asked if it was because you were most glorious.
|
|
if (response == "s_11")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_king_condition__defaultCondition (player, npc))
|
|
{
|
|
mtp_meatlump_king_action_grantAct2Story (player, npc);
|
|
|
|
//-- NPC: You are astute and wise beyond what your otherwise dreary countenance would suggest. Make yourself at home in my Empire.
|
|
string_id message = new string_id (c_stringFile, "s_12");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_king.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Being glorious isn't a basis for government. How about we vote?
|
|
if (response == "s_14")
|
|
{
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_king_condition__defaultCondition (player, npc))
|
|
{
|
|
mtp_meatlump_king_action_grantAct2Story (player, npc);
|
|
|
|
//-- NPC: Hush you. And begone from my sight before I have you thrown in jail like a common droid.
|
|
string_id message = new string_id (c_stringFile, "s_16");
|
|
utils.removeScriptVar (player, "conversation.mtp_meatlump_king.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_king");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler handlePointToSelf()
|
|
{
|
|
doAnimationAction(self, "point_to_self");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler handleResetMeatlumpKingAppearance()
|
|
{
|
|
location here = getLocation(self);
|
|
playClientEffectLoc(getPlayerCreaturesInRange(here, 100.0f), "clienteffect/jedi_master_cloak_good.cef", here, 0.0f);
|
|
revertObjectAppearance(self);
|
|
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);
|
|
|
|
int blurb = rand(0,12);
|
|
if ( rand(0,999) == 99 )
|
|
{
|
|
blurb = 9999;
|
|
}
|
|
utils.setScriptVar(player, "mtp_meatlumpKingBlurb", blurb);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnIncapacitated (obj_id killer)
|
|
{
|
|
clearCondition (self, CONDITION_CONVERSABLE);
|
|
detachScript (self, "conversation.mtp_meatlump_king");
|
|
|
|
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_king_condition_readyforAct2Story (player, npc))
|
|
{
|
|
//-- NPC: Ah, a new Meatlump. Welcome. I am the King.
|
|
string_id message = new string_id (c_stringFile, "s_4");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How did you become King of the Meatlumps?
|
|
boolean hasResponse0 = false;
|
|
if (mtp_meatlump_king_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_6");
|
|
|
|
utils.setScriptVar (player, "conversation.mtp_meatlump_king.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "mtp_meatlump_king", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_king_condition_blurb_rare (player, npc))
|
|
{
|
|
mtp_meatlump_king_action_setEmperorAppearance (player, npc);
|
|
|
|
//-- NPC: I do not seek to rule the entire Galaxy...unlike others I will not bother to name [*wink*]. I merely seek my own sanctuary, down here below Coronet, where I might find peace.
|
|
string_id message = new string_id (c_stringFile, "s_43");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] Spirited Away
|
|
if (mtp_meatlump_king_condition_blurb12 (player, npc))
|
|
{
|
|
//-- NPC: Once, not long ago, I dropped my meatlump into a river. When I tried to get it back, I fell in. I thought I'd drown, but the water carried me to the shore. From then on, I always ate my snacks away from water.
|
|
string_id message = new string_id (c_stringFile, "s_30");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] The Big Lebowski
|
|
if (mtp_meatlump_king_condition_blurb11 (player, npc))
|
|
{
|
|
//-- NPC: These rugs really tie the room together.
|
|
string_id message = new string_id (c_stringFile, "s_29");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] Princess Mononoke
|
|
if (mtp_meatlump_king_condition_blurb10 (player, npc))
|
|
{
|
|
//-- NPC: Now watch closely, everyone. I'm going to show you how to eat a meatlump. A meatlump of meat and lumpiness. The trick is not to fear it. Or to chew.
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] Blade Runner
|
|
if (mtp_meatlump_king_condition_blurb09 (player, npc))
|
|
{
|
|
//-- NPC: Maybe in these moments I love life more than I ever had before. Not just my life...anybody's life...your life. All I want are the same answers anybody wants. Where did I come from? Where am I going? How long have I got? Could I have a bite of that meatlump?
|
|
string_id message = new string_id (c_stringFile, "s_27");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] Eternal Sunshine of the Spotless Mind
|
|
if (mtp_meatlump_king_condition_blurb08 (player, npc))
|
|
{
|
|
//-- NPC: Too many Meatlumps think I'm a concept, or I complete them, or I'm gonna make them alive. But I've got my own peace of mind. I don't need yours and won't give you mine.
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] A Clockwork Orange
|
|
if (mtp_meatlump_king_condition_blurb07 (player, npc))
|
|
{
|
|
//-- NPC: It's amazing how the colors of the real world only seem truly real when you see them in my coat.
|
|
string_id message = new string_id (c_stringFile, "s_25");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] Se7en
|
|
if (mtp_meatlump_king_condition_blurb06 (player, npc))
|
|
{
|
|
//-- NPC: Anyone who spends a significant amount of time with me finds me quite agreeable. Just ask...well anybody.
|
|
string_id message = new string_id (c_stringFile, "s_31");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] The Usual Suspects
|
|
if (mtp_meatlump_king_condition_blurb05 (player, npc))
|
|
{
|
|
//-- NPC: What CorSec has never figured out, and what I know well, is that these Meatlumps would never break, never lie down, never bend over for anybody. Anybody. Well, other than for me.
|
|
string_id message = new string_id (c_stringFile, "s_33");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] Raiders of the Lost Arc
|
|
if (mtp_meatlump_king_condition_blurb04 (player, npc))
|
|
{
|
|
//-- NPC: This hideout demonstrates one of the great dangers of being a Meatlump. Not to life and limb...what could possibly harm a Meatlump? I'm talking about excess anger.
|
|
string_id message = new string_id (c_stringFile, "s_35");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] Shawshank Redemption
|
|
if (mtp_meatlump_king_condition_blurb03 (player, npc))
|
|
{
|
|
//-- NPC: I must admit I didn't think much of you the first time I laid eyes on you; looked like a stiff breeze would blow you over. I'm still working on my second impression.
|
|
string_id message = new string_id (c_stringFile, "s_37");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] The Princess Bride
|
|
if (mtp_meatlump_king_condition_blurb02 (player, npc))
|
|
{
|
|
//-- NPC: Look, I don't mean to be rude but being Meatlump King is not as easy as it looks, so I'd appreciate it if you wouldn't distract me.
|
|
string_id message = new string_id (c_stringFile, "s_39");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] The Godfather
|
|
if (mtp_meatlump_king_condition_blurb01 (player, npc))
|
|
{
|
|
//-- NPC: I live my life. I don't apologize for taking care of my Meatlumps. And I refused to be a fool dancing on the strings held by any of those Imperial or Rebel big shots. That's my life and I don't apologize for that.
|
|
string_id message = new string_id (c_stringFile, "s_41");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (mtp_meatlump_king_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "huge");
|
|
|
|
//-- NPC: These chambers and tunnels are my Empire, though it is most definitely not divided. All Meatlumps are welcome here.
|
|
string_id message = new string_id (c_stringFile, "s_44");
|
|
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_king")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.mtp_meatlump_king.branchId");
|
|
|
|
if (branchId == 1 && mtp_meatlump_king_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && mtp_meatlump_king_handleBranch2 (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_king.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|