mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
504 lines
15 KiB
Plaintext
504 lines
15 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// prof_commando_mao.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/prof_commando_mao";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean prof_commando_mao_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean prof_commando_mao_condition_playerOnCOM11Reward (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "prof_commando_11", "talktomao");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean prof_commando_mao_condition_playerfinishedCOM11Quest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "prof_commando_11");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean prof_commando_mao_condition_playerStartingCOM11quest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "prof_commando_11", "giveassignment");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean prof_commando_mao_condition_questStarted (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedTask(player, "prof_commando_11", "giveassignment");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void prof_commando_mao_action_giveRewardSignal (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "prof_commando_11_reward");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void prof_commando_mao_action_giveAssignmentSignal (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "prof_commando_11_1_giveassignment");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void prof_commando_mao_action_faceplayer (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void prof_commando_mao_action_givequestDEBUG (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "prof_commando_11");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int prof_commando_mao_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: How did it go?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: It's done, if that's what you mean.
|
|
if (response == "s_20")
|
|
{
|
|
//-- [NOTE]
|
|
if (prof_commando_mao_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "bow");
|
|
|
|
prof_commando_mao_action_giveRewardSignal (player, npc);
|
|
|
|
//-- NPC: That's exactly what it means. Very good. My business associates thank you for keeping their trade safe. Here is your payment.
|
|
string_id message = new string_id (c_stringFile, "s_22");
|
|
utils.removeScriptVar (player, "conversation.prof_commando_mao.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int prof_commando_mao_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Ah. You look like the kind of person that can help me.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sgt. Snopel sent me to you.
|
|
if (response == "s_30")
|
|
{
|
|
//-- [NOTE]
|
|
if (prof_commando_mao_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Of course he did. I have a job for you. Won't be too easy, but shouldn't kill ya either. A bunch of sand pirates are interfering with my business partners.
|
|
string_id message = new string_id (c_stringFile, "s_32");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How are they interfering?
|
|
boolean hasResponse0 = false;
|
|
if (prof_commando_mao_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_33");
|
|
|
|
utils.setScriptVar (player, "conversation.prof_commando_mao.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.prof_commando_mao.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int prof_commando_mao_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Of course he did. I have a job for you. Won't be too easy, but shouldn't kill ya either. A bunch of sand pirates are interfering with my business partners.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How are they interfering?
|
|
if (response == "s_33")
|
|
{
|
|
//-- [NOTE]
|
|
if (prof_commando_mao_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Any transport that gets within a thousand meters of their base tends to have some unfortunate accidents...at the end of blaster bolts.
|
|
string_id message = new string_id (c_stringFile, "s_34");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: So what am I to do?
|
|
boolean hasResponse0 = false;
|
|
if (prof_commando_mao_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_35");
|
|
|
|
utils.setScriptVar (player, "conversation.prof_commando_mao.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.prof_commando_mao.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int prof_commando_mao_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Any transport that gets within a thousand meters of their base tends to have some unfortunate accidents...at the end of blaster bolts.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So what am I to do?
|
|
if (response == "s_35")
|
|
{
|
|
//-- [NOTE]
|
|
if (prof_commando_mao_condition__defaultCondition (player, npc))
|
|
{
|
|
prof_commando_mao_action_giveAssignmentSignal (player, npc);
|
|
|
|
//-- NPC: Simple. You go to their base, kill their leader, and make sure that no one will be able to use the base again.
|
|
string_id message = new string_id (c_stringFile, "s_36");
|
|
utils.removeScriptVar (player, "conversation.prof_commando_mao.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.prof_commando_mao");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "Coris Mao");
|
|
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "Coris Mao");
|
|
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
|
|
|
|
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.prof_commando_mao");
|
|
|
|
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 (prof_commando_mao_condition_playerfinishedCOM11Quest (player, npc))
|
|
{
|
|
prof_commando_mao_action_faceplayer (player, npc);
|
|
|
|
//-- NPC: Good work. You are a credit to your Senior Officers.
|
|
string_id message = new string_id (c_stringFile, "s_9");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (prof_commando_mao_condition_playerOnCOM11Reward (player, npc))
|
|
{
|
|
prof_commando_mao_action_faceplayer (player, npc);
|
|
|
|
//-- NPC: How did it go?
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: It's done, if that's what you mean.
|
|
boolean hasResponse0 = false;
|
|
if (prof_commando_mao_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.prof_commando_mao.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "prof_commando_mao", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (prof_commando_mao_condition_questStarted (player, npc))
|
|
{
|
|
prof_commando_mao_action_faceplayer (player, npc);
|
|
|
|
//-- NPC: Take care of that base. I won't pay you until the job is done. You should have all the information that you need in your journal.
|
|
string_id message = new string_id (c_stringFile, "s_31");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (prof_commando_mao_condition_playerStartingCOM11quest (player, npc))
|
|
{
|
|
prof_commando_mao_action_faceplayer (player, npc);
|
|
|
|
//-- NPC: Ah. You look like the kind of person that can help me.
|
|
string_id message = new string_id (c_stringFile, "s_29");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sgt. Snopel sent me to you.
|
|
boolean hasResponse0 = false;
|
|
if (prof_commando_mao_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_30");
|
|
|
|
utils.setScriptVar (player, "conversation.prof_commando_mao.branchId", 5);
|
|
|
|
npcStartConversation (player, npc, "prof_commando_mao", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (prof_commando_mao_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I'd love to do nothing more than chat, but I'm busy.
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
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 != "prof_commando_mao")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.prof_commando_mao.branchId");
|
|
|
|
if (branchId == 2 && prof_commando_mao_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && prof_commando_mao_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && prof_commando_mao_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && prof_commando_mao_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.prof_commando_mao.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|