Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/illicit_broker_2.script
T

1498 lines
42 KiB
Plaintext

// ======================================================================
//
// illicit_broker_2.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.factions;
include library.groundquests;
include library.money;
include library.smuggler;
include library.static_item;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/illicit_broker_2";
// ======================================================================
// Script Conditions
// ======================================================================
boolean illicit_broker_2_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean illicit_broker_2_condition_isNonSmuggler (obj_id player, obj_id npc)
{
if(utils.getPlayerProfession(player) != utils.SMUGGLER)
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean illicit_broker_2_condition_isDoingMission (obj_id player, obj_id npc)
{
if (groundquests.isDoingSmugglerMission(player))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean illicit_broker_2_condition_smugglerAboveMissionTier (obj_id player, obj_id npc)
{
float underworldFaction = factions.getFactionStanding( player, "underworld" );
int brokerTier = 2;
if (smuggler.getSmuggleTier(underworldFaction) > brokerTier)
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean illicit_broker_2_condition_hasMissionContrabandBusiness (obj_id player, obj_id npc)
{
int brokerTier = 2;
if (smuggler.hasMissionContrabandForTransaction(player, brokerTier))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean illicit_broker_2_condition_hasSomeContraband (obj_id player, obj_id npc)
{
if (smuggler.hasIllicitContraband(player))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean illicit_broker_2_condition_hasMissionContraband (obj_id player, obj_id npc)
{
if (smuggler.hasIllicitMissionContraband(player))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean illicit_broker_2_condition_hasMissionContrabandToDeliver (obj_id player, obj_id npc)
{
float underworldFaction = factions.getFactionStanding( player, "underworld" );
int brokerTier = 2;
if (smuggler.getSmuggleTier(underworldFaction) == brokerTier)
{
return true;
}
return false;
}
// ======================================================================
// Script Actions
// ======================================================================
void illicit_broker_2_action_startGiveQuest (obj_id player, obj_id npc)
{
string illicit_broker_2_tokenTO_contrabandName = utils.getStringScriptVar(player, "illicitContrabandTrade");
obj_id pInv = utils.getInventoryContainer(player);
obj_id[] missionContraband = utils.getAllStaticItemsInPlayerInventory(player, illicit_broker_2_tokenTO_contrabandName);
int contrabandSize = utils.countOfStackedItemsInArray(missionContraband);
if( contrabandSize >= 5 )
{
static_item.decrementUnstackedStaticItemAmount (missionContraband, 5);
utils.removeScriptVar(player, "illicitContrabandTrade");
CustomerServiceLog("SMUGGLER_SYSTEM", player + "Received Tier 2 Illicit Contraband mission from "+npc);
groundquests.requestGrantQuest(player, "quest/smuggle_illicit_2", true);
}
}
// ----------------------------------------------------------------------
void illicit_broker_2_action_giveIllicitPointerQuest (obj_id player, obj_id npc)
{
int missionTier = smuggler.getMissionCotrabandPointerTier(player);
string pointerQuest = "";
switch (missionTier)
{
case 1:
pointerQuest = "quest/smuggle_pointer_illicit_1";
break;
case 2:
pointerQuest = "quest/smuggle_pointer_illicit_2";
break;
case 3:
pointerQuest = "quest/smuggle_pointer_illicit_3";
break;
case 4:
pointerQuest = "quest/smuggle_pointer_illicit_4";
break;
case 5:
pointerQuest = "quest/smuggle_pointer_illicit_5";
break;
default:
break;
}
if (!groundquests.isQuestActive(player, pointerQuest))
{
groundquests.requestGrantQuest(player, pointerQuest, true);
}
}
// ----------------------------------------------------------------------
void illicit_broker_2_action_sellContraband (obj_id player, obj_id npc)
{
string illicit_broker_2_tokenTO_contrabandName = utils.getStringScriptVar(player, "illicitContrabandTrade");
obj_id pInv = utils.getInventoryContainer(player);
obj_id[] tradeContraband = utils.getAllStaticItemsInPlayerInventory(player, illicit_broker_2_tokenTO_contrabandName);
int contrabandSize = utils.countOfStackedItemsInArray(tradeContraband);
if( contrabandSize >= 5 )
{
static_item.decrementUnstackedStaticItemAmount (tradeContraband, 5);
dictionary params = new dictionary();
money.systemPayout(money.ACCT_RELIC_DEALER, player, smuggler.TIER_2_ILLICIT_SELL_VALUE, null, params);
utils.removeScriptVar(player, "illicitContrabandTrade");
}
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
string illicit_broker_2_tokenTO_contrabandName (obj_id player, obj_id npc)
{
int brokerTier = 2;
string contraband = smuggler.getMissionContrabandForTransactionName(player, brokerTier);
if (contraband != null)
{
utils.setScriptVar(player, "illicitContrabandTrade", contraband);
string_id contrabandId = new string_id ("static_item_n", contraband);
string contrabandItemName = getString(contrabandId);
return contrabandItemName;
}
return "";
}
// ======================================================================
// Script %DI Tokens
// ======================================================================
int illicit_broker_2_tokenDI_cashValue (obj_id player, obj_id npc)
{
return (smuggler.TIER_2_ILLICIT_SELL_VALUE);
}
// ======================================================================
// Script %DF Tokens
// ======================================================================
float illicit_broker_2_tokenDF_tokenDF0001 (obj_id player, obj_id npc)
{
return 0.f;
}
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int illicit_broker_2_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I see you have some %TO. I have some customers who are interested in these.
//-- [RESPONSE NOTE]
//-- PLAYER: I would like to sell it to you.
if (response == "s_52")
{
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: I will give you %DI credits for (5) %TO.
string_id message = new string_id (c_stringFile, "s_54");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You have a deal.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No. I will hold onto it for now.
boolean hasResponse1 = false;
if (illicit_broker_2_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_58");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_60");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 6);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
pp.other.set (illicit_broker_2_tokenTO_contrabandName (player, npc));
pp.digitInteger = illicit_broker_2_tokenDI_cashValue (player, npc);
npcSpeak (player, pp);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
pp.other.set (illicit_broker_2_tokenTO_contrabandName (player, npc));
pp.digitInteger = illicit_broker_2_tokenDI_cashValue (player, npc);
npcEndConversationWithMessage (player, pp);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I would like an assignment to deliver this rare contraband to one of your customers.
if (response == "s_53")
{
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: I will pack it up for you in a container so the customer will know its authentic.
string_id message = new string_id (c_stringFile, "s_57");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: OK.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Never mind. I changed my mind.
boolean hasResponse1 = false;
if (illicit_broker_2_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_19");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_23");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Can I deliver these for you?
if (response == "s_27")
{
//-- [NOTE]
if (illicit_broker_2_condition_smugglerAboveMissionTier (player, npc))
{
//-- NPC: Thanks for the offer but you have advanced in our organization to the point these missions are beneath someone with your skills. I will find someone else to deliver these items for me.
string_id message = new string_id (c_stringFile, "s_29");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would like to sell it to you.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I would like an assignment to deliver this rare contraband to one of your customers.
boolean hasResponse1 = false;
if (illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Can I deliver these for you?
boolean hasResponse2 = false;
if (!illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++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_52");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_53");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_27");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (!illicit_broker_2_condition_smugglerAboveMissionTier (player, npc))
{
//-- NPC: I am afraid you haven't demonstrated enough skill to deliver these. You have to build a level of trust in our organization before I will trust you with such valuable cargo deliveries.
string_id message = new string_id (c_stringFile, "s_31");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would like to sell it to you.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I would like an assignment to deliver this rare contraband to one of your customers.
boolean hasResponse1 = false;
if (illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Can I deliver these for you?
boolean hasResponse2 = false;
if (!illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++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_52");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_53");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_27");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int illicit_broker_2_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I will give you %DI credits for (5) %TO.
//-- [RESPONSE NOTE]
//-- PLAYER: You have a deal.
if (response == "s_58")
{
illicit_broker_2_action_sellContraband (player, npc);
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: Thank you! I deposited %DI credits into your account. I will get someone else to deliver this for me. Pleasure doing business with you.
string_id message = new string_id (c_stringFile, "s_59");
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
pp.digitInteger = illicit_broker_2_tokenDI_cashValue (player, npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No. I will hold onto it for now.
if (response == "s_60")
{
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: Suit yourself.
string_id message = new string_id (c_stringFile, "s_61");
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int illicit_broker_2_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I will pack it up for you in a container so the customer will know its authentic.
//-- [RESPONSE NOTE]
//-- PLAYER: OK.
if (response == "s_19")
{
illicit_broker_2_action_startGiveQuest (player, npc);
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: Thanks you! I am sure it is in safe hands with you. Good luck.
string_id message = new string_id (c_stringFile, "s_22");
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Never mind. I changed my mind.
if (response == "s_23")
{
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: Suit yourself.
string_id message = new string_id (c_stringFile, "s_25");
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int illicit_broker_2_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Thanks for the offer but you have advanced in our organization to the point these missions are beneath someone with your skills. I will find someone else to deliver these items for me.
//-- [RESPONSE NOTE]
//-- PLAYER: I would like to sell it to you.
if (response == "s_52")
{
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: I will give you %DI credits for (5) %TO.
string_id message = new string_id (c_stringFile, "s_54");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You have a deal.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No. I will hold onto it for now.
boolean hasResponse1 = false;
if (illicit_broker_2_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_58");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_60");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 6);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
pp.other.set (illicit_broker_2_tokenTO_contrabandName (player, npc));
pp.digitInteger = illicit_broker_2_tokenDI_cashValue (player, npc);
npcSpeak (player, pp);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
pp.other.set (illicit_broker_2_tokenTO_contrabandName (player, npc));
pp.digitInteger = illicit_broker_2_tokenDI_cashValue (player, npc);
npcEndConversationWithMessage (player, pp);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I would like an assignment to deliver this rare contraband to one of your customers.
if (response == "s_53")
{
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: I will pack it up for you in a container so the customer will know its authentic.
string_id message = new string_id (c_stringFile, "s_57");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: OK.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Never mind. I changed my mind.
boolean hasResponse1 = false;
if (illicit_broker_2_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_19");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_23");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Can I deliver these for you?
if (response == "s_27")
{
//-- [NOTE]
if (illicit_broker_2_condition_smugglerAboveMissionTier (player, npc))
{
//-- NPC: Thanks for the offer but you have advanced in our organization to the point these missions are beneath someone with your skills. I will find someone else to deliver these items for me.
string_id message = new string_id (c_stringFile, "s_29");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would like to sell it to you.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I would like an assignment to deliver this rare contraband to one of your customers.
boolean hasResponse1 = false;
if (illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Can I deliver these for you?
boolean hasResponse2 = false;
if (!illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++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_52");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_53");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_27");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (!illicit_broker_2_condition_smugglerAboveMissionTier (player, npc))
{
//-- NPC: I am afraid you haven't demonstrated enough skill to deliver these. You have to build a level of trust in our organization before I will trust you with such valuable cargo deliveries.
string_id message = new string_id (c_stringFile, "s_31");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would like to sell it to you.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I would like an assignment to deliver this rare contraband to one of your customers.
boolean hasResponse1 = false;
if (illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Can I deliver these for you?
boolean hasResponse2 = false;
if (!illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++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_52");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_53");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_27");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int illicit_broker_2_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I am afraid you haven't demonstrated enough skill to deliver these. You have to build a level of trust in our organization before I will trust you with such valuable cargo deliveries.
//-- [RESPONSE NOTE]
//-- PLAYER: I would like to sell it to you.
if (response == "s_52")
{
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: I will give you %DI credits for (5) %TO.
string_id message = new string_id (c_stringFile, "s_54");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You have a deal.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No. I will hold onto it for now.
boolean hasResponse1 = false;
if (illicit_broker_2_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_58");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_60");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 6);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
pp.other.set (illicit_broker_2_tokenTO_contrabandName (player, npc));
pp.digitInteger = illicit_broker_2_tokenDI_cashValue (player, npc);
npcSpeak (player, pp);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
pp.other.set (illicit_broker_2_tokenTO_contrabandName (player, npc));
pp.digitInteger = illicit_broker_2_tokenDI_cashValue (player, npc);
npcEndConversationWithMessage (player, pp);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I would like an assignment to deliver this rare contraband to one of your customers.
if (response == "s_53")
{
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: I will pack it up for you in a container so the customer will know its authentic.
string_id message = new string_id (c_stringFile, "s_57");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: OK.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Never mind. I changed my mind.
boolean hasResponse1 = false;
if (illicit_broker_2_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_19");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_23");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Can I deliver these for you?
if (response == "s_27")
{
//-- [NOTE]
if (illicit_broker_2_condition_smugglerAboveMissionTier (player, npc))
{
//-- NPC: Thanks for the offer but you have advanced in our organization to the point these missions are beneath someone with your skills. I will find someone else to deliver these items for me.
string_id message = new string_id (c_stringFile, "s_29");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would like to sell it to you.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I would like an assignment to deliver this rare contraband to one of your customers.
boolean hasResponse1 = false;
if (illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Can I deliver these for you?
boolean hasResponse2 = false;
if (!illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++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_52");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_53");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_27");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (!illicit_broker_2_condition_smugglerAboveMissionTier (player, npc))
{
//-- NPC: I am afraid you haven't demonstrated enough skill to deliver these. You have to build a level of trust in our organization before I will trust you with such valuable cargo deliveries.
string_id message = new string_id (c_stringFile, "s_31");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would like to sell it to you.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I would like an assignment to deliver this rare contraband to one of your customers.
boolean hasResponse1 = false;
if (illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Can I deliver these for you?
boolean hasResponse2 = false;
if (!illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++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_52");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_53");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_27");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int illicit_broker_2_handleBranch14 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: If you want to turn in those other illicit contraband items, you will need to see one of my associates.
//-- [RESPONSE NOTE]
//-- PLAYER: Who do I need to see to turn them in?
if (response == "s_34")
{
illicit_broker_2_action_giveIllicitPointerQuest (player, npc);
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: Tell them I said you were ok.
string_id message = new string_id (c_stringFile, "s_36");
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Not right now.
if (response == "s_38")
{
//-- [NOTE]
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
//-- NPC: Suit yourself then.
string_id message = new string_id (c_stringFile, "s_40");
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.illicit_broker_2");
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);
groundquests.sendSignal(player, "dalyaPointer");
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.illicit_broker_2");
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 (illicit_broker_2_condition_isNonSmuggler (player, npc))
{
//-- NPC: We have nothing to discuss.
string_id message = new string_id (c_stringFile, "s_4");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (illicit_broker_2_condition_isDoingMission (player, npc))
{
//-- NPC: I see you currently have an assignment. My customers do not like to be kept waiting. Finish your current delivery and then we can talk.
string_id message = new string_id (c_stringFile, "s_6");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (!illicit_broker_2_condition_hasSomeContraband (player, npc))
{
//-- NPC: I only deal in rare contraband, it appears you do not have any. We have no business at this time.
string_id message = new string_id (c_stringFile, "s_49");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (!illicit_broker_2_condition_hasMissionContraband (player, npc))
{
//-- NPC: I see you have some rare contraband but not in the quantity required. When you have collected at least 5 of the same type, come back and talk to me and we can do business.
string_id message = new string_id (c_stringFile, "s_50");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (illicit_broker_2_condition_hasMissionContrabandBusiness (player, npc))
{
//-- NPC: I see you have some %TO. I have some customers who are interested in these.
string_id message = new string_id (c_stringFile, "s_51");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would like to sell it to you.
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I would like an assignment to deliver this rare contraband to one of your customers.
boolean hasResponse1 = false;
if (illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Can I deliver these for you?
boolean hasResponse2 = false;
if (!illicit_broker_2_condition_hasMissionContrabandToDeliver (player, npc))
{
++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_52");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_53");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_27");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 5);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
pp.other.set (illicit_broker_2_tokenTO_contrabandName (player, npc));
npcStartConversation (player, npc, "illicit_broker_2", null, pp, responses);
}
else
{
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
pp.other.set (illicit_broker_2_tokenTO_contrabandName (player, npc));
chat.chat (npc, player, null, null, pp);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (illicit_broker_2_condition_hasMissionContraband (player, npc))
{
//-- NPC: If you want to turn in those other illicit contraband items, you will need to see one of my associates.
string_id message = new string_id (c_stringFile, "s_62");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Who do I need to see to turn them in?
boolean hasResponse0 = false;
if (illicit_broker_2_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Not right now.
boolean hasResponse1 = false;
if (illicit_broker_2_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_34");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_38");
utils.setScriptVar (player, "conversation.illicit_broker_2.branchId", 14);
npcStartConversation (player, npc, "illicit_broker_2", 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 != "illicit_broker_2")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.illicit_broker_2.branchId");
if (branchId == 5 && illicit_broker_2_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && illicit_broker_2_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && illicit_broker_2_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && illicit_broker_2_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && illicit_broker_2_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 14 && illicit_broker_2_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.illicit_broker_2.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================