mirror of
https://bitbucket.org/seefoe/dsrc.git
synced 2026-07-31 01:15:55 -04:00
434 lines
12 KiB
Plaintext
434 lines
12 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// padawan_architect_02.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// Created with SwgConversationEditor 1.34 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.jedi_trials;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/padawan_architect_02";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean padawan_architect_02_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean padawan_architect_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("architect") )
|
|
{
|
|
return !hasObjVar(player, "jedi_trials.padawan_trials.temp.spokeToTarget_01");
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void padawan_architect_02_action_spokeToNpc (obj_id player, obj_id npc)
|
|
{
|
|
setObjVar(player, "jedi_trials.padawan_trials.temp.spokeToTarget_01", true);
|
|
stopCombat(npc);
|
|
setInvulnerable (npc, true);
|
|
|
|
messageTo(player, "handleSetBeginLoc", null, 1, false);
|
|
return;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void padawan_architect_02_action_npcAttacks (obj_id player, obj_id npc)
|
|
{
|
|
dictionary webster = new dictionary();
|
|
webster.put("player", player);
|
|
|
|
messageTo(npc, "handleQuestStartAttack", webster, 1, false);
|
|
return;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int padawan_architect_02_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yesa, howsa can wesa helps you?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You are trespassing on my client's land.
|
|
if (response == "s_17f3f71f")
|
|
{
|
|
//-- [NOTE]
|
|
if (padawan_architect_02_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "shake_head_no");
|
|
|
|
//-- NPC: Trespassing? Wesa lived here for evers. Yousa are the ones trespassing.
|
|
string_id message = new string_id (c_stringFile, "s_a7079eee");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: If that is true, why was this land up for sale?
|
|
boolean hasResponse0 = false;
|
|
if (padawan_architect_02_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_55ff5c74");
|
|
|
|
utils.setScriptVar (player, "conversation.padawan_architect_02.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.padawan_architect_02.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int padawan_architect_02_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Trespassing? Wesa lived here for evers. Yousa are the ones trespassing.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: If that is true, why was this land up for sale?
|
|
if (response == "s_55ff5c74")
|
|
{
|
|
//-- [NOTE]
|
|
if (padawan_architect_02_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "wave_on_dismissing");
|
|
|
|
//-- NPC: Wesa don't know anythings abouts no sales. Yousa needs to be moving off our lands now though, yousa starting to upset me.
|
|
string_id message = new string_id (c_stringFile, "s_d7cc9593");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will do just that. I apologize for intruding and upsetting you.
|
|
boolean hasResponse0 = false;
|
|
if (padawan_architect_02_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I don't care anything about all that. You must leave or else.
|
|
boolean hasResponse1 = false;
|
|
if (padawan_architect_02_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_5e71d8b7");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_7280c4d8");
|
|
|
|
utils.setScriptVar (player, "conversation.padawan_architect_02.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.padawan_architect_02.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int padawan_architect_02_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Wesa don't know anythings abouts no sales. Yousa needs to be moving off our lands now though, yousa starting to upset me.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will do just that. I apologize for intruding and upsetting you.
|
|
if (response == "s_5e71d8b7")
|
|
{
|
|
doAnimationAction (player, "standing_placate");
|
|
|
|
//-- [NOTE]
|
|
if (padawan_architect_02_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod_head_multiple");
|
|
|
|
padawan_architect_02_action_spokeToNpc (player, npc);
|
|
|
|
//-- NPC: Yousa tells yousa client dat mesa lands not for sells and to leaves mesa alone.
|
|
string_id message = new string_id (c_stringFile, "s_20c05fd8");
|
|
utils.removeScriptVar (player, "conversation.padawan_architect_02.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't care anything about all that. You must leave or else.
|
|
if (response == "s_7280c4d8")
|
|
{
|
|
doAnimationAction (player, "point_accusingly");
|
|
|
|
//-- [NOTE] Gungans at this point attack the player.
|
|
if (padawan_architect_02_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "threaten_combat");
|
|
|
|
padawan_architect_02_action_npcAttacks (player, npc);
|
|
|
|
//-- NPC: Wesa sees whosa going to be leavings.
|
|
string_id message = new string_id (c_stringFile, "s_56dcc3ba");
|
|
utils.removeScriptVar (player, "conversation.padawan_architect_02.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.padawan_architect_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)
|
|
{
|
|
if ( !isIncapacitated(self) )
|
|
{
|
|
int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null);
|
|
menu_info_data menuInfoData = menuInfo.getMenuItemById (menu);
|
|
menuInfoData.setServerNotify (false);
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
}
|
|
else
|
|
{
|
|
clearCondition (self, CONDITION_CONVERSABLE);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnIncapacitated (obj_id killer)
|
|
{
|
|
clearCondition (self, CONDITION_CONVERSABLE);
|
|
detachScript (self, "conversation.padawan_architect_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)
|
|
{
|
|
obj_id npc = self;
|
|
|
|
if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player))
|
|
return SCRIPT_OVERRIDE;
|
|
|
|
//-- [NOTE]
|
|
if (padawan_architect_02_condition_isTrialPlayer (player, npc))
|
|
{
|
|
//-- NPC: Yesa, howsa can wesa helps you?
|
|
string_id message = new string_id (c_stringFile, "s_c8e2f57a");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: You are trespassing on my client's land.
|
|
boolean hasResponse0 = false;
|
|
if (padawan_architect_02_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_17f3f71f");
|
|
|
|
utils.setScriptVar (player, "conversation.padawan_architect_02.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "padawan_architect_02", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (padawan_architect_02_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Mesa no have speaksa to yousa.
|
|
string_id message = new string_id (c_stringFile, "s_26b9a00f");
|
|
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 != "padawan_architect_02")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.padawan_architect_02.branchId");
|
|
|
|
if (branchId == 1 && padawan_architect_02_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && padawan_architect_02_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && padawan_architect_02_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.padawan_architect_02.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|