mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
503 lines
15 KiB
Plaintext
503 lines
15 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// maneater_ulon.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// Created with SwgConversationEditor 1.35 - 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/maneater_ulon";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean maneater_ulon_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean maneater_ulon_condition_isOnTask (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActive(player, "som_maneater");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean maneater_ulon_condition_failedEncounter (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "som_maneater", "mustafar_maneater_four");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean maneater_ulon_condition_wonTask (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "som_maneater", "mustafar_maneater_five");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean maneater_ulon_condition_hasWonMission (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "som_maneater");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void maneater_ulon_action_startMission (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "som_maneater");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void maneater_ulon_action_clearMission (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.clearQuest(player, "som_maneater");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void maneater_ulon_action_rewardTime (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "mustafar_maneater_reward");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int maneater_ulon_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We really need to find that rogue tulrus. The attacks are getting worse and our crews are scared.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will take care of it.
|
|
if (response == "s_14")
|
|
{
|
|
//-- [NOTE]
|
|
if (maneater_ulon_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "thank");
|
|
|
|
//-- NPC: That puts a lot of miners' minds at ease. Thank you.
|
|
string_id message = new string_id (c_stringFile, "s_16");
|
|
utils.removeScriptVar (player, "conversation.maneater_ulon.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I had it and I lost it.
|
|
if (response == "s_15")
|
|
{
|
|
doAnimationAction (player, "slump_head");
|
|
|
|
maneater_ulon_action_clearMission (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (maneater_ulon_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "pound_fist_palm");
|
|
|
|
maneater_ulon_action_startMission (player, npc);
|
|
|
|
//-- NPC: That is too bad. We are going to have to go back to our original plan and start hunting tulrus in the area again. Hopefully, we will get another break and you will get it this time.
|
|
string_id message = new string_id (c_stringFile, "s_17");
|
|
utils.removeScriptVar (player, "conversation.maneater_ulon.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int maneater_ulon_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I am afraid that I do not have time to talk to you right now. We have a crisis brewing here and I need to focus on getting the problem dealt with.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Maybe I can help.
|
|
if (response == "s_20")
|
|
{
|
|
//-- [NOTE]
|
|
if (maneater_ulon_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "rub_chin_thoughtful");
|
|
|
|
//-- NPC: Hmmm...you do look like someone who might be able to help us. There has been a series of attacks on our miners by a tulrus. Those things normally don't bother anyone unless provoked, but this one seems different. It has already attacked numerous miners, killing several of them. Our crews refuse to go out unless we can take care of the problem.
|
|
string_id message = new string_id (c_stringFile, "s_22");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I am an expert hunter. I will help out.
|
|
boolean hasResponse0 = false;
|
|
if (maneater_ulon_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Sounds like you have a lot to deal with. Good luck.
|
|
boolean hasResponse1 = false;
|
|
if (maneater_ulon_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_24");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_28");
|
|
|
|
utils.setScriptVar (player, "conversation.maneater_ulon.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.maneater_ulon.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int maneater_ulon_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Hmmm...you do look like someone who might be able to help us. There has been a series of attacks on our miners by a tulrus. Those things normally don't bother anyone unless provoked, but this one seems different. It has already attacked numerous miners, killing several of them. Our crews refuse to go out unless we can take care of the problem.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I am an expert hunter. I will help out.
|
|
if (response == "s_24")
|
|
{
|
|
doAnimationAction (player, "pose_proudly");
|
|
|
|
//-- [NOTE]
|
|
if (maneater_ulon_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "celebrate");
|
|
|
|
maneater_ulon_action_startMission (player, npc);
|
|
|
|
//-- NPC: That is the best news I have heard all day. We do not know which tulrus is doing this, so I am afraid we are going to have to kill tulrus in the areas of the attacks until we find it. Find tulrus and examine their stomach contents. That is the only way we can be sure.
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
utils.removeScriptVar (player, "conversation.maneater_ulon.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sounds like you have a lot to deal with. Good luck.
|
|
if (response == "s_28")
|
|
{
|
|
//-- [NOTE]
|
|
if (maneater_ulon_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "thank");
|
|
|
|
//-- NPC: Thank you, stranger. We will do our best.
|
|
string_id message = new string_id (c_stringFile, "s_30");
|
|
utils.removeScriptVar (player, "conversation.maneater_ulon.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.maneater_ulon");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable (self, true);
|
|
setCondition( self, CONDITION_INTERESTING );
|
|
setName (self, "Chief Ulon Glost");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable (self, true);
|
|
setCondition( self, CONDITION_INTERESTING );
|
|
setName (self, "Chief Ulon Glost");
|
|
|
|
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.maneater_ulon");
|
|
|
|
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 (maneater_ulon_condition_hasWonMission (player, npc))
|
|
{
|
|
doAnimationAction (npc, "wave1");
|
|
|
|
//-- NPC: Hey, ever since you took care of that tulrus, our productivity has been up. We can't thank you enough.
|
|
string_id message = new string_id (c_stringFile, "s_4");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (maneater_ulon_condition_wonTask (player, npc))
|
|
{
|
|
doAnimationAction (npc, "celebrate1");
|
|
|
|
doAnimationAction (player, "expect_tip");
|
|
|
|
maneater_ulon_action_rewardTime (player, npc);
|
|
|
|
//-- NPC: You do not know how much better all the men feel. Thank you for taking down that rogue tulrus. The company has authorized me to issue you this reward for your service. Thank you again, my friend.
|
|
string_id message = new string_id (c_stringFile, "s_6");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (maneater_ulon_condition_isOnTask (player, npc))
|
|
{
|
|
doAnimationAction (npc, "explain");
|
|
|
|
//-- NPC: We really need to find that rogue tulrus. The attacks are getting worse and our crews are scared.
|
|
string_id message = new string_id (c_stringFile, "s_8");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will take care of it.
|
|
boolean hasResponse0 = false;
|
|
if (maneater_ulon_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I had it and I lost it.
|
|
boolean hasResponse1 = false;
|
|
if (maneater_ulon_condition_failedEncounter (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_14");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_15");
|
|
|
|
utils.setScriptVar (player, "conversation.maneater_ulon.branchId", 3);
|
|
|
|
npcStartConversation (player, npc, "maneater_ulon", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (maneater_ulon_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "check_wrist_device");
|
|
|
|
//-- NPC: I am afraid that I do not have time to talk to you right now. We have a crisis brewing here and I need to focus on getting the problem dealt with.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Maybe I can help.
|
|
boolean hasResponse0 = false;
|
|
if (maneater_ulon_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_20");
|
|
|
|
utils.setScriptVar (player, "conversation.maneater_ulon.branchId", 6);
|
|
|
|
npcStartConversation (player, npc, "maneater_ulon", 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 != "maneater_ulon")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.maneater_ulon.branchId");
|
|
|
|
if (branchId == 3 && maneater_ulon_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && maneater_ulon_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && maneater_ulon_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.maneater_ulon.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|