mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
420 lines
13 KiB
Plaintext
420 lines
13 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// hutt_informant.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.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/hutt_informant";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean hutt_informant_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean hutt_informant_condition_HasItem (obj_id player, obj_id npc)
|
|
{
|
|
if ( hasObjVar(player, "bestine.mess") )
|
|
{
|
|
if (utils.playerHasItemByTemplate(player, "object/tangible/loot/quest/sean_history_disk.iff") )
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void hutt_informant_action__defaultAction (obj_id player, obj_id npc)
|
|
{
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void hutt_informant_action_destroyDisk (obj_id player, obj_id npc)
|
|
{
|
|
if (isIdValid(player))
|
|
{
|
|
obj_id disk = utils.getItemPlayerHasByTemplate(player, "object/tangible/loot/quest/sean_history_disk.iff");
|
|
if ( isIdValid(disk) )
|
|
{
|
|
destroyObject(disk);
|
|
|
|
obj_id playerInv = getObjectInSlot( player, "inventory" );
|
|
if(isIdValid(playerInv))
|
|
{
|
|
obj_id item = createObject( "object/weapon/ranged/grenade/grenade_cryoban_loot_medium.iff", playerInv, "" );
|
|
if(isIdValid(item))
|
|
{
|
|
setObjVar( player, "bestine.hutt", true );
|
|
removeObjVar(player, "bestine.mess");
|
|
|
|
if ( hasObjVar(player, "bestine.contactWaypoint") )
|
|
{
|
|
obj_id waypoint = getObjIdObjVar(player, "bestine.contactWaypoint");
|
|
if ( isIdValid(waypoint) )
|
|
destroyWaypointInDatapad(waypoint, player);
|
|
|
|
removeObjVar(player, "bestine.contactWaypoint");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "npc.conversation.hutt_informant");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
if( !hasScript(self, "city.bestine.hutt_informant_approach") )
|
|
{
|
|
attachScript(self, "city.bestine.hutt_informant_approach");
|
|
}
|
|
|
|
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.hutt_informant");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnStartNpcConversation (obj_id player)
|
|
{
|
|
if (ai_lib.isInCombat (self) || ai_lib.isInCombat (player))
|
|
return SCRIPT_OVERRIDE;
|
|
|
|
//-- [NOTE]
|
|
if (hutt_informant_condition_HasItem (player, self))
|
|
{
|
|
//-- NPC: I can take care of this... mess for you.
|
|
string_id message = new string_id (c_stringFile, "s_fb7697b2");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What mess?
|
|
boolean hasResponse0 = false;
|
|
if (hutt_informant_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_f660c800");
|
|
|
|
setObjVar (player, "conversation.hutt_informant.branchId", 1);
|
|
|
|
npcStartConversation (player, self, "hutt_informant", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (self, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (hutt_informant_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Get lost. I have no business to conduct with you. Too many people in arms about the Sand People attacking Bestine. It'll be easy for me, I can just leave just as easily as I've come. Go away. I have things to do, people to bribe.
|
|
string_id message = new string_id (c_stringFile, "s_7b45b993");
|
|
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 != "hutt_informant")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
int branchId = getIntObjVar (player, "conversation.hutt_informant.branchId");
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I can take care of this... mess for you.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What mess?
|
|
if (branchId == 1 && response == "s_f660c800")
|
|
{
|
|
//-- [NOTE]
|
|
if (hutt_informant_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Why do the dirty work of a politician when I can do it for you? Let me take that disk off your hands. In fact, I know I may have something with which I can pay you for your... generosity.
|
|
string_id message = new string_id (c_stringFile, "s_dfffcfb");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Why do you want the disk?
|
|
boolean hasResponse0 = false;
|
|
if (hutt_informant_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Here take it. Give me my payment.
|
|
boolean hasResponse1 = false;
|
|
if (hutt_informant_condition_HasItem (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I won't give it to you.
|
|
boolean hasResponse2 = false;
|
|
if (hutt_informant_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_139f41b9");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_54b54bd0");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_4ddc07ed");
|
|
|
|
setObjVar (player, "conversation.hutt_informant.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.hutt_informant.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'I can take care of this... mess for you.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Why do the dirty work of a politician when I can do it for you? Let me take that disk off your hands. In fact, I know I may have something with which I can pay you for your... generosity.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Why do you want the disk?
|
|
if (branchId == 2 && response == "s_139f41b9")
|
|
{
|
|
//-- [NOTE]
|
|
if (hutt_informant_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Why wouldn't I? It contains pertinent information regarding a highly-regarded politician and I'm one of Jabba's informants. Again, I ask... why wouldn't I want it?
|
|
string_id message = new string_id (c_stringFile, "s_70142360");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Here take it. Give me my payment.
|
|
boolean hasResponse0 = false;
|
|
if (hutt_informant_condition_HasItem (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_54b54bd0");
|
|
|
|
setObjVar (player, "conversation.hutt_informant.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.hutt_informant.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Why do the dirty work of a politician when I can do it for you? Let me take that disk off your hands. In fact, I know I may have something with which I can pay you for your... generosity.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Why do the dirty work of a politician when I can do it for you? Let me take that disk off your hands. In fact, I know I may have something with which I can pay you for your... generosity.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Here take it. Give me my payment.
|
|
if (branchId == 2 && response == "s_54b54bd0")
|
|
{
|
|
//-- [NOTE]
|
|
if (hutt_informant_condition__defaultCondition (player, self))
|
|
{
|
|
hutt_informant_action_destroyDisk (player, self);
|
|
|
|
//-- NPC: Oh and don't blame me if you can't use this thing. It was all I had on me. Go sell it or something. You didn't deserve that great of a reward. It's been a pleasure doing business with you. Good day.
|
|
string_id message = new string_id (c_stringFile, "s_53f349b7");
|
|
removeObjVar (player, "conversation.hutt_informant.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Why do the dirty work of a politician when I can do it for you? Let me take that disk off your hands. In fact, I know I may have something with which I can pay you for your... generosity.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Why do the dirty work of a politician when I can do it for you? Let me take that disk off your hands. In fact, I know I may have something with which I can pay you for your... generosity.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I won't give it to you.
|
|
if (branchId == 2 && response == "s_4ddc07ed")
|
|
{
|
|
//-- [NOTE]
|
|
if (hutt_informant_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: You're a fool. Get out of my sight.
|
|
string_id message = new string_id (c_stringFile, "s_eed9dce1");
|
|
removeObjVar (player, "conversation.hutt_informant.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Why do the dirty work of a politician when I can do it for you? Let me take that disk off your hands. In fact, I know I may have something with which I can pay you for your... generosity.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Why wouldn't I? It contains pertinent information regarding a highly-regarded politician and I'm one of Jabba's informants. Again, I ask... why wouldn't I want it?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Here take it. Give me my payment.
|
|
if (branchId == 3 && response == "s_54b54bd0")
|
|
{
|
|
//-- [NOTE]
|
|
if (hutt_informant_condition__defaultCondition (player, self))
|
|
{
|
|
hutt_informant_action_destroyDisk (player, self);
|
|
|
|
//-- NPC: Oh and don't blame me if you can't use this thing. It was all I had on me. Go sell it or something. You didn't deserve that great of a reward. It's been a pleasure doing business with you. Good day.
|
|
string_id message = new string_id (c_stringFile, "s_53f349b7");
|
|
removeObjVar (player, "conversation.hutt_informant.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Why wouldn't I? It contains pertinent information regarding a highly-regarded politician and I'm one of Jabba's informants. Again, I ask... why wouldn't I want it?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
removeObjVar (player, "conversation.hutt_informant.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|