mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
284 lines
8.6 KiB
Plaintext
284 lines
8.6 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// padawan_pannaqa_02.script
|
|
// Copyright 2003, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// DO NOT EDIT THIS AUTO-GENERATED FILE. PLEASE USE THE CONVERATION EDITOR!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.jedi_trials;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/padawan_pannaqa_02";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean padawan_pannaqa_02_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean padawan_pannaqa_02_condition_isTrialPlayer (obj_id player, obj_id npc)
|
|
{
|
|
obj_id trialPlayer = getObjIdObjVar(npc, jedi_trials.PADAWAN_TRIAL_PLAYER_OBJVAR);
|
|
if ( player == trialPlayer )
|
|
{
|
|
string trialName = jedi_trials.getJediTrialName(player);
|
|
|
|
if ( trialName != null && trialName.equals("pannaqa") )
|
|
{
|
|
return !hasObjVar(player, "jedi_trials.padawan_trials.temp.spokeToTarget_01");
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void padawan_pannaqa_02_action_sendToThirdNpc (obj_id player, obj_id npc)
|
|
{
|
|
setObjVar(player, "jedi_trials.padawan_trials.temp.spokeToTarget_01", true);
|
|
messageTo(player, "handleSetThirdLoc", null, 1, false);
|
|
return;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "npc.conversation.padawan_pannaqa_02");
|
|
|
|
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, "npc.conversation.padawan_pannaqa_02");
|
|
|
|
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)
|
|
{
|
|
if (ai_lib.isInCombat (self) || ai_lib.isInCombat (player))
|
|
return SCRIPT_OVERRIDE;
|
|
|
|
//-- [NOTE]
|
|
if (padawan_pannaqa_02_condition_isTrialPlayer (player, self))
|
|
{
|
|
//-- NPC: Yes? May I help you?
|
|
string_id message = new string_id (c_stringFile, "s_e03f6fd1");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm looking for Shendo. I was told he might be here?
|
|
boolean hasResponse0 = false;
|
|
if (padawan_pannaqa_02_condition__defaultCondition (player, self))
|
|
{
|
|
++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_afd80a03");
|
|
|
|
setObjVar (player, "conversation.padawan_pannaqa_02.branchId", 1);
|
|
|
|
npcStartConversation (player, self, "padawan_pannaqa_02", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (self, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (padawan_pannaqa_02_condition__defaultCondition (player, self))
|
|
{
|
|
doAnimationAction (self, "wave_on_dismissing");
|
|
|
|
//-- NPC: Go away. I'm doing stuff here and you're bothering me.
|
|
string_id message = new string_id (c_stringFile, "s_62623109");
|
|
chat.chat (self, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnStartNpcConversation were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response)
|
|
{
|
|
if (conversationId != "padawan_pannaqa_02")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
int branchId = getIntObjVar (player, "conversation.padawan_pannaqa_02.branchId");
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yes? May I help you?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm looking for Shendo. I was told he might be here?
|
|
if (branchId == 1 && response == "s_afd80a03")
|
|
{
|
|
//-- [NOTE]
|
|
if (padawan_pannaqa_02_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: No, he's not around, as usual. He's off goofing around as always. I don't think I've ever seen him without a Sunburn in his hand and spice on his breath.
|
|
string_id message = new string_id (c_stringFile, "s_3c4de5b4");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Do you know where I might find him?
|
|
boolean hasResponse0 = false;
|
|
if (padawan_pannaqa_02_condition__defaultCondition (player, self))
|
|
{
|
|
++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_69850509");
|
|
|
|
setObjVar (player, "conversation.padawan_pannaqa_02.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.padawan_pannaqa_02.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Yes? May I help you?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: No, he's not around, as usual. He's off goofing around as always. I don't think I've ever seen him without a Sunburn in his hand and spice on his breath.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Do you know where I might find him?
|
|
if (branchId == 2 && response == "s_69850509")
|
|
{
|
|
//-- [NOTE]
|
|
if (padawan_pannaqa_02_condition__defaultCondition (player, self))
|
|
{
|
|
padawan_pannaqa_02_action_sendToThirdNpc (player, self);
|
|
|
|
//-- NPC: Yeah, I can help you. I'll upload the information to your datapad.
|
|
string_id message = new string_id (c_stringFile, "s_499c34de");
|
|
removeObjVar (player, "conversation.padawan_pannaqa_02.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'No, he's not around, as usual. He's off goofing around as always. I don't think I've ever seen him without a Sunburn in his hand and spice on his breath.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
removeObjVar (player, "conversation.padawan_pannaqa_02.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|