mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-17 08:02:55 -04:00
355 lines
11 KiB
Plaintext
355 lines
11 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// ep3_myyydril_herder.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// Created with SwgConversationEditor 1.30 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/ep3_myyydril_herder";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean ep3_myyydril_herder_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_myyydril_herder_condition_hasLanguage (obj_id player, obj_id npc)
|
|
{
|
|
return utils.canSpeakWookiee(player, npc);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void ep3_myyydril_herder_action_Language (obj_id player, obj_id npc)
|
|
{
|
|
utils.emoteWookieeConfusion (player, npc);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int ep3_myyydril_herder_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: [The herder hums a little tune.] Oh, a new visitor..
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: [You nod.] What are these things, if you don't mind my asking.
|
|
if (response == "s_486")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_herder_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: [The herder looks at the beetle.] It's called a Uwari Beetle. We, the Myyydril people, harvest them for their meats. Not only are their meat wonderful to the taste, they also make great pets. The ones you see here are small and immature. We keep them safe until it is time for the harvesting. Of course, some are hostile... There are hostile Uwari in the caverns above us.
|
|
string_id message = new string_id (c_stringFile, "s_488");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: And the mushrooms?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_herder_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_490");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_herder.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_herder.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_herder_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: [The herder looks at the beetle.] It's called a Uwari Beetle. We, the Myyydril people, harvest them for their meats. Not only are their meat wonderful to the taste, they also make great pets. The ones you see here are small and immature. We keep them safe until it is time for the harvesting. Of course, some are hostile... There are hostile Uwari in the caverns above us.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: And the mushrooms?
|
|
if (response == "s_490")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_herder_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Luilris Mushrooms. They make great pies and are wonderful light sources. They grow in dark, damp areas like this. We have multiple mushroom gardens, as I'm sure you've already seen.
|
|
string_id message = new string_id (c_stringFile, "s_492");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thank you for the information.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_herder_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_494");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_herder.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_herder.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_myyydril_herder_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Luilris Mushrooms. They make great pies and are wonderful light sources. They grow in dark, damp areas like this. We have multiple mushroom gardens, as I'm sure you've already seen.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thank you for the information.
|
|
if (response == "s_494")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_herder_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: [The herder nods.] Watch yourself around here. It can be dangerous.
|
|
string_id message = new string_id (c_stringFile, "s_496");
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_herder.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.ep3_myyydril_herder");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable(self, true);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable(self, true);
|
|
|
|
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.ep3_myyydril_herder");
|
|
|
|
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 (ep3_myyydril_herder_condition_hasLanguage (player, npc))
|
|
{
|
|
//-- NPC: Rrwoorr!
|
|
string_id message = new string_id (c_stringFile, "s_674");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_myyydril_herder_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: [The herder hums a little tune.] Oh, a new visitor..
|
|
string_id message = new string_id (c_stringFile, "s_484");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: [You nod.] What are these things, if you don't mind my asking.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_myyydril_herder_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_486");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_myyydril_herder.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "ep3_myyydril_herder", 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 != "ep3_myyydril_herder")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.ep3_myyydril_herder.branchId");
|
|
|
|
if (branchId == 2 && ep3_myyydril_herder_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && ep3_myyydril_herder_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && ep3_myyydril_herder_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.ep3_myyydril_herder.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|