mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
3326 lines
87 KiB
Plaintext
3326 lines
87 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// faction_recruiter_general.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.conversation;
|
|
include library.faction_perk;
|
|
include library.factions;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/faction_recruiter_general";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean faction_recruiter_general_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean faction_recruiter_general_condition_isInFaction (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc,player);
|
|
return (factions.isInFriendlyFaction(player, npc)&&(!factions.isOnLeaveFromFriendlyFaction(player,npc)))&&(!factions.isPVPStatusChanging(player));
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean faction_recruiter_general_condition_isEnemyFaction (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc,player);
|
|
return (factions.isInEnemyFaction(player, npc)&&(!factions.isPVPStatusChanging(player)));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean faction_recruiter_general_condition_playerQualifiesForPromotion (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc,player);
|
|
return (factions.qualifiesForPromotion(player, pvpGetAlignedFaction(npc))&&(!factions.isPVPStatusChanging(player)));
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean faction_recruiter_general_condition_isChangingFaction (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc,player);
|
|
return factions.isPVPStatusChanging(player);
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean faction_recruiter_general_condition_onLeaveFromFriendlyFaction (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc,player);
|
|
return (factions.isOnLeaveFromFriendlyFaction(player, npc)&&(!factions.isPVPStatusChanging(player)));
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean faction_recruiter_general_condition_onLeaveFromEnemyFaction (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc,player);
|
|
return (factions.isOnLeaveFromEnemyFaction(player, npc)&&(!factions.isPVPStatusChanging(player)));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean faction_recruiter_general_condition_isCovert (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc,player);
|
|
return(pvpGetType(player)==PVPTYPE_COVERT)&&(!factions.isPVPStatusChanging(player));
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean faction_recruiter_general_condition_isOvert (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc,player);
|
|
return ((pvpGetType(player)==PVPTYPE_DECLARED)&&(!factions.isPVPStatusChanging(player)));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean faction_recruiter_general_condition_playerCanBuyFaction (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc,player);
|
|
return (factions.isSmuggler(player)&&(factions.canBuyFaction(player, npc))&&(!factions.isPVPStatusChanging(player)));
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean faction_recruiter_general_condition_isAllowedToJoinFaction (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc,player);
|
|
return factions.canJoinFaction(player, pvpGetAlignedFaction(npc));
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void faction_recruiter_general_action_enablePVPTimer (obj_id player, obj_id npc)
|
|
{
|
|
factions.goOvertWithDelay(player,30);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void faction_recruiter_general_action_playerJoinFaction (obj_id player, obj_id npc)
|
|
{
|
|
factions.joinFaction(player,pvpGetAlignedFaction(npc));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void faction_recruiter_general_action_playerGoOnLeaveTimer (obj_id player, obj_id npc)
|
|
{
|
|
factions.goOnLeaveWithDelay(player,300);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void faction_recruiter_general_action_playerGoCovertTimer (obj_id player, obj_id npc)
|
|
{
|
|
factions.goCovertWithDelay(player,300);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void faction_recruiter_general_action_grantPromotion (obj_id player, obj_id npc)
|
|
{
|
|
factions.applyPromotion(player, pvpGetAlignedFaction(npc));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void faction_recruiter_general_action_buy1250FactionPoints (obj_id player, obj_id npc)
|
|
{
|
|
factions.buyFaction(player, npc, 100000);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void faction_recruiter_general_action_buy250FactionPoints (obj_id player, obj_id npc)
|
|
{
|
|
factions.buyFaction(player, npc, 20000);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void faction_recruiter_general_action_completelyResign (obj_id player, obj_id npc)
|
|
{
|
|
|
|
factions.leaveFaction(player, pvpGetAlignedFaction(npc));
|
|
//factions.leaveFaction(player, pvpGetAlignedFaction(npc));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void faction_recruiter_general_action_goCovertShortTimer (obj_id player, obj_id npc)
|
|
{
|
|
factions.goCovertWithDelay(player,30);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void faction_recruiter_general_action_showGcwRewardsList (obj_id player, obj_id npc)
|
|
{
|
|
int playerGcwRank = pvpGetCurrentGcwRank(player);
|
|
int faction_id = pvpGetAlignedFaction(player);
|
|
string playerGcwFaction = factions.getFactionNameByHashCode(faction_id);
|
|
|
|
faction_perk.displayAvailableFactionItemRanks(player, npc, playerGcwRank, playerGcwFaction);
|
|
|
|
return;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
string faction_recruiter_general_tokenTO_getFactionRankName (obj_id player, obj_id npc)
|
|
{
|
|
int current_rank = pvpGetCurrentGcwRank(player);
|
|
string faction = factions.getFaction(player);
|
|
if (current_rank > factions.MAXIMUM_RANK)
|
|
current_rank = 1;
|
|
|
|
return "@faction_recruiter:" + factions.getRankName(current_rank, faction);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
int faction_recruiter_general_tokenDI_getImperialScore (obj_id player, obj_id npc)
|
|
{
|
|
return getIntObjVar(npc, "Imperial.controlScore");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
float faction_recruiter_general_tokenDF_getRebelScore (obj_id player, obj_id npc)
|
|
{
|
|
return (float)getIntObjVar(npc, "Rebel.controlScore");
|
|
}
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int faction_recruiter_general_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Is On Leave from friendly faction
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm done being on leave
|
|
if (response == "s_1577")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You sure?
|
|
string_id message = new string_id (c_stringFile, "s_1578");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yesir!
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No.
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_1579");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1580");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You sure?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yesir!
|
|
if (response == "s_1579")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
faction_recruiter_general_action_goCovertShortTimer (player, npc);
|
|
|
|
//-- NPC: You'll be flagged correctly in 30 seonds.
|
|
string_id message = new string_id (c_stringFile, "s_1582");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No.
|
|
if (response == "s_1580")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: OKay
|
|
string_id message = new string_id (c_stringFile, "s_1581");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: If you're in my faction
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I wanna buy things
|
|
if (response == "s_29")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
faction_recruiter_general_action_showGcwRewardsList (player, npc);
|
|
|
|
//-- NPC: Like what?
|
|
string_id message = new string_id (c_stringFile, "s_37");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
if (response == "s_55")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isOvert (player, npc))
|
|
{
|
|
//-- NPC: You're pvp enabled. Wanna not be?
|
|
string_id message = new string_id (c_stringFile, "s_57");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_59");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_63");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isCovert (player, npc))
|
|
{
|
|
//-- NPC: You're not pvp enabled. Wanna bre?
|
|
string_id message = new string_id (c_stringFile, "s_66");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: no
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_68");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_79");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to go on leave.
|
|
if (response == "s_84")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You sure?
|
|
string_id message = new string_id (c_stringFile, "s_86");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_88");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_92");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 15);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How goes gcw?
|
|
if (response == "s_1599")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Score is Imperial: %DI and Rebel : %DF
|
|
string_id message = new string_id (c_stringFile, "s_1600");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I wanna buy things
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to go on leave.
|
|
boolean hasResponse2 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: How goes gcw?
|
|
boolean hasResponse3 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to resign completely.
|
|
boolean hasResponse4 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_55");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_84");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1599");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_96");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 7);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
pp.digitInteger = faction_recruiter_general_tokenDI_getImperialScore (player, npc);
|
|
pp.digitFloat = faction_recruiter_general_tokenDF_getRebelScore (player, npc);
|
|
|
|
npcSpeak (player, pp);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
pp.digitInteger = faction_recruiter_general_tokenDI_getImperialScore (player, npc);
|
|
pp.digitFloat = faction_recruiter_general_tokenDF_getRebelScore (player, npc);
|
|
|
|
npcEndConversationWithMessage (player, pp);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to resign completely.
|
|
if (response == "s_96")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You sure?
|
|
string_id message = new string_id (c_stringFile, "s_98");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_100");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_104");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 19);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You're pvp enabled. Wanna not be?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes
|
|
if (response == "s_59")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
faction_recruiter_general_action_playerGoCovertTimer (player, npc);
|
|
|
|
//-- NPC: Okay. You're not pvp enabled in 5 minutes.
|
|
string_id message = new string_id (c_stringFile, "s_61");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No
|
|
if (response == "s_63")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Boo
|
|
string_id message = new string_id (c_stringFile, "s_80");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I wanna buy things
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to go on leave.
|
|
boolean hasResponse2 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: How goes gcw?
|
|
boolean hasResponse3 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to resign completely.
|
|
boolean hasResponse4 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_55");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_84");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1599");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_96");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Boo
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I wanna buy things
|
|
if (response == "s_29")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
faction_recruiter_general_action_showGcwRewardsList (player, npc);
|
|
|
|
//-- NPC: Like what?
|
|
string_id message = new string_id (c_stringFile, "s_37");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
if (response == "s_55")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isOvert (player, npc))
|
|
{
|
|
//-- NPC: You're pvp enabled. Wanna not be?
|
|
string_id message = new string_id (c_stringFile, "s_57");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_59");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_63");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isCovert (player, npc))
|
|
{
|
|
//-- NPC: You're not pvp enabled. Wanna bre?
|
|
string_id message = new string_id (c_stringFile, "s_66");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: no
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_68");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_79");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to go on leave.
|
|
if (response == "s_84")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You sure?
|
|
string_id message = new string_id (c_stringFile, "s_86");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_88");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_92");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 15);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How goes gcw?
|
|
if (response == "s_1599")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Score is Imperial: %DI and Rebel : %DF
|
|
string_id message = new string_id (c_stringFile, "s_1600");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I wanna buy things
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to go on leave.
|
|
boolean hasResponse2 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: How goes gcw?
|
|
boolean hasResponse3 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to resign completely.
|
|
boolean hasResponse4 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_55");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_84");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1599");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_96");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 7);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
pp.digitInteger = faction_recruiter_general_tokenDI_getImperialScore (player, npc);
|
|
pp.digitFloat = faction_recruiter_general_tokenDF_getRebelScore (player, npc);
|
|
|
|
npcSpeak (player, pp);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
pp.digitInteger = faction_recruiter_general_tokenDI_getImperialScore (player, npc);
|
|
pp.digitFloat = faction_recruiter_general_tokenDF_getRebelScore (player, npc);
|
|
|
|
npcEndConversationWithMessage (player, pp);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to resign completely.
|
|
if (response == "s_96")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You sure?
|
|
string_id message = new string_id (c_stringFile, "s_98");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_100");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_104");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 19);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You're not pvp enabled. Wanna bre?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes
|
|
if (response == "s_68")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
faction_recruiter_general_action_enablePVPTimer (player, npc);
|
|
|
|
//-- NPC: Okay. You'll be pvp enabled in 30 seconds.
|
|
string_id message = new string_id (c_stringFile, "s_70");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: no
|
|
if (response == "s_79")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Fine, Don't go pvp enabled. Go back to faction menu link.
|
|
string_id message = new string_id (c_stringFile, "s_82");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I wanna buy things
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to go on leave.
|
|
boolean hasResponse2 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: How goes gcw?
|
|
boolean hasResponse3 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to resign completely.
|
|
boolean hasResponse4 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_55");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_84");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1599");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_96");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch14 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Fine, Don't go pvp enabled. Go back to faction menu link.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I wanna buy things
|
|
if (response == "s_29")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
faction_recruiter_general_action_showGcwRewardsList (player, npc);
|
|
|
|
//-- NPC: Like what?
|
|
string_id message = new string_id (c_stringFile, "s_37");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
if (response == "s_55")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isOvert (player, npc))
|
|
{
|
|
//-- NPC: You're pvp enabled. Wanna not be?
|
|
string_id message = new string_id (c_stringFile, "s_57");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_59");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_63");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isCovert (player, npc))
|
|
{
|
|
//-- NPC: You're not pvp enabled. Wanna bre?
|
|
string_id message = new string_id (c_stringFile, "s_66");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: no
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_68");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_79");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to go on leave.
|
|
if (response == "s_84")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You sure?
|
|
string_id message = new string_id (c_stringFile, "s_86");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_88");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_92");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 15);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How goes gcw?
|
|
if (response == "s_1599")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Score is Imperial: %DI and Rebel : %DF
|
|
string_id message = new string_id (c_stringFile, "s_1600");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I wanna buy things
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to go on leave.
|
|
boolean hasResponse2 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: How goes gcw?
|
|
boolean hasResponse3 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to resign completely.
|
|
boolean hasResponse4 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_55");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_84");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1599");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_96");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 7);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
pp.digitInteger = faction_recruiter_general_tokenDI_getImperialScore (player, npc);
|
|
pp.digitFloat = faction_recruiter_general_tokenDF_getRebelScore (player, npc);
|
|
|
|
npcSpeak (player, pp);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
pp.digitInteger = faction_recruiter_general_tokenDI_getImperialScore (player, npc);
|
|
pp.digitFloat = faction_recruiter_general_tokenDF_getRebelScore (player, npc);
|
|
|
|
npcEndConversationWithMessage (player, pp);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to resign completely.
|
|
if (response == "s_96")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You sure?
|
|
string_id message = new string_id (c_stringFile, "s_98");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_100");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_104");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 19);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch15 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You sure?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes
|
|
if (response == "s_88")
|
|
{
|
|
faction_recruiter_general_action_playerGoOnLeaveTimer (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
faction_recruiter_general_action_playerGoOnLeaveTimer (player, npc);
|
|
|
|
//-- NPC: Okay you're on leave. Watch out for enemies. You'll be on leave in 5 mins.
|
|
string_id message = new string_id (c_stringFile, "s_90");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No
|
|
if (response == "s_92")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Boo
|
|
string_id message = new string_id (c_stringFile, "s_94");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I wanna buy things
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to go on leave.
|
|
boolean hasResponse2 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: How goes gcw?
|
|
boolean hasResponse3 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to resign completely.
|
|
boolean hasResponse4 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_55");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_84");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1599");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_96");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch17 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Boo
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I wanna buy things
|
|
if (response == "s_29")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
faction_recruiter_general_action_showGcwRewardsList (player, npc);
|
|
|
|
//-- NPC: Like what?
|
|
string_id message = new string_id (c_stringFile, "s_37");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
if (response == "s_55")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isOvert (player, npc))
|
|
{
|
|
//-- NPC: You're pvp enabled. Wanna not be?
|
|
string_id message = new string_id (c_stringFile, "s_57");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_59");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_63");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isCovert (player, npc))
|
|
{
|
|
//-- NPC: You're not pvp enabled. Wanna bre?
|
|
string_id message = new string_id (c_stringFile, "s_66");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: no
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_68");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_79");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to go on leave.
|
|
if (response == "s_84")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You sure?
|
|
string_id message = new string_id (c_stringFile, "s_86");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_88");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_92");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 15);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How goes gcw?
|
|
if (response == "s_1599")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Score is Imperial: %DI and Rebel : %DF
|
|
string_id message = new string_id (c_stringFile, "s_1600");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I wanna buy things
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to go on leave.
|
|
boolean hasResponse2 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: How goes gcw?
|
|
boolean hasResponse3 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to resign completely.
|
|
boolean hasResponse4 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_55");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_84");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1599");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_96");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 7);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
pp.digitInteger = faction_recruiter_general_tokenDI_getImperialScore (player, npc);
|
|
pp.digitFloat = faction_recruiter_general_tokenDF_getRebelScore (player, npc);
|
|
|
|
npcSpeak (player, pp);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
pp.digitInteger = faction_recruiter_general_tokenDI_getImperialScore (player, npc);
|
|
pp.digitFloat = faction_recruiter_general_tokenDF_getRebelScore (player, npc);
|
|
|
|
npcEndConversationWithMessage (player, pp);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to resign completely.
|
|
if (response == "s_96")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You sure?
|
|
string_id message = new string_id (c_stringFile, "s_98");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_100");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_104");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 19);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch18 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Score is Imperial: %DI and Rebel : %DF
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I wanna buy things
|
|
if (response == "s_29")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
faction_recruiter_general_action_showGcwRewardsList (player, npc);
|
|
|
|
//-- NPC: Like what?
|
|
string_id message = new string_id (c_stringFile, "s_37");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
if (response == "s_55")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isOvert (player, npc))
|
|
{
|
|
//-- NPC: You're pvp enabled. Wanna not be?
|
|
string_id message = new string_id (c_stringFile, "s_57");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_59");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_63");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isCovert (player, npc))
|
|
{
|
|
//-- NPC: You're not pvp enabled. Wanna bre?
|
|
string_id message = new string_id (c_stringFile, "s_66");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: no
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_68");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_79");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to go on leave.
|
|
if (response == "s_84")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You sure?
|
|
string_id message = new string_id (c_stringFile, "s_86");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_88");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_92");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 15);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How goes gcw?
|
|
if (response == "s_1599")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Score is Imperial: %DI and Rebel : %DF
|
|
string_id message = new string_id (c_stringFile, "s_1600");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I wanna buy things
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to go on leave.
|
|
boolean hasResponse2 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: How goes gcw?
|
|
boolean hasResponse3 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to resign completely.
|
|
boolean hasResponse4 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_55");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_84");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1599");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_96");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 7);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
pp.digitInteger = faction_recruiter_general_tokenDI_getImperialScore (player, npc);
|
|
pp.digitFloat = faction_recruiter_general_tokenDF_getRebelScore (player, npc);
|
|
|
|
npcSpeak (player, pp);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
pp.digitInteger = faction_recruiter_general_tokenDI_getImperialScore (player, npc);
|
|
pp.digitFloat = faction_recruiter_general_tokenDF_getRebelScore (player, npc);
|
|
|
|
npcEndConversationWithMessage (player, pp);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would like to resign completely.
|
|
if (response == "s_96")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You sure?
|
|
string_id message = new string_id (c_stringFile, "s_98");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_100");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_104");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 19);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch19 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You sure?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes
|
|
if (response == "s_100")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
faction_recruiter_general_action_completelyResign (player, npc);
|
|
|
|
//-- NPC: Okay.
|
|
string_id message = new string_id (c_stringFile, "s_102");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No
|
|
if (response == "s_104")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Okay
|
|
string_id message = new string_id (c_stringFile, "s_106");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch22 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: If you're not factional at all
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Can i join your faction?
|
|
if (response == "s_135")
|
|
{
|
|
//-- [NOTE]
|
|
if (!faction_recruiter_general_condition_isAllowedToJoinFaction (player, npc))
|
|
{
|
|
//-- NPC: No. We don't like you enough.
|
|
string_id message = new string_id (c_stringFile, "s_136");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isAllowedToJoinFaction (player, npc))
|
|
{
|
|
//-- NPC: Are you sure you wish to join my faction?
|
|
string_id message = new string_id (c_stringFile, "s_138");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes I am sure
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_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_140");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_146");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 24);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch24 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Are you sure you wish to join my faction?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes I am sure
|
|
if (response == "s_140")
|
|
{
|
|
faction_recruiter_general_action_playerJoinFaction (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Welcome aboard
|
|
string_id message = new string_id (c_stringFile, "s_142");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thanks
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_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_144");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 25);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No
|
|
if (response == "s_146")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Buh Bye
|
|
string_id message = new string_id (c_stringFile, "s_148");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int faction_recruiter_general_handleBranch25 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Welcome aboard
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thanks
|
|
if (response == "s_144")
|
|
{
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_onLeaveFromFriendlyFaction (player, npc))
|
|
{
|
|
//-- NPC: Is On Leave from friendly faction
|
|
string_id message = new string_id (c_stringFile, "s_4");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm done being on leave
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_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_1577");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 1);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_onLeaveFromEnemyFaction (player, npc))
|
|
{
|
|
//-- NPC: IsOnLeave from enemy faction. I hate you go awayu
|
|
string_id message = new string_id (c_stringFile, "s_12");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isEnemyFaction (player, npc))
|
|
{
|
|
//-- NPC: I'm not dealing with you you are enemy faction
|
|
string_id message = new string_id (c_stringFile, "s_108");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isInFaction (player, npc))
|
|
{
|
|
//-- NPC: If you're in my faction
|
|
string_id message = new string_id (c_stringFile, "s_15");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I wanna buy things
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to go on leave.
|
|
boolean hasResponse2 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: How goes gcw?
|
|
boolean hasResponse3 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to resign completely.
|
|
boolean hasResponse4 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_55");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_84");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1599");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_96");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (!faction_recruiter_general_condition_isChangingFaction (player, npc))
|
|
{
|
|
//-- NPC: If you're not factional at all
|
|
string_id message = new string_id (c_stringFile, "s_112");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Can i join your faction?
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_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_135");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 22);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Your pvp status is changing. Come back when it's done changing.
|
|
string_id message = new string_id (c_stringFile, "s_133");
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.faction_recruiter_general");
|
|
|
|
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, "conversation.faction_recruiter_general");
|
|
|
|
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 (faction_recruiter_general_condition_onLeaveFromFriendlyFaction (player, npc))
|
|
{
|
|
//-- NPC: Is On Leave from friendly faction
|
|
string_id message = new string_id (c_stringFile, "s_4");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm done being on leave
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_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_1577");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "faction_recruiter_general", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_onLeaveFromEnemyFaction (player, npc))
|
|
{
|
|
//-- NPC: IsOnLeave from enemy faction. I hate you go awayu
|
|
string_id message = new string_id (c_stringFile, "s_12");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isEnemyFaction (player, npc))
|
|
{
|
|
//-- NPC: I'm not dealing with you you are enemy faction
|
|
string_id message = new string_id (c_stringFile, "s_108");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition_isInFaction (player, npc))
|
|
{
|
|
//-- NPC: If you're in my faction
|
|
string_id message = new string_id (c_stringFile, "s_15");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I wanna buy things
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to change my PVP status.
|
|
boolean hasResponse1 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to go on leave.
|
|
boolean hasResponse2 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: How goes gcw?
|
|
boolean hasResponse3 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: I would like to resign completely.
|
|
boolean hasResponse4 = false;
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_55");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_84");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1599");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_96");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 7);
|
|
|
|
npcStartConversation (player, npc, "faction_recruiter_general", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (!faction_recruiter_general_condition_isChangingFaction (player, npc))
|
|
{
|
|
//-- NPC: If you're not factional at all
|
|
string_id message = new string_id (c_stringFile, "s_112");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Can i join your faction?
|
|
boolean hasResponse0 = false;
|
|
if (faction_recruiter_general_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_135");
|
|
|
|
utils.setScriptVar (player, "conversation.faction_recruiter_general.branchId", 22);
|
|
|
|
npcStartConversation (player, npc, "faction_recruiter_general", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (faction_recruiter_general_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Your pvp status is changing. Come back when it's done changing.
|
|
string_id message = new string_id (c_stringFile, "s_133");
|
|
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 != "faction_recruiter_general")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
if (branchId == 1 && faction_recruiter_general_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && faction_recruiter_general_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && faction_recruiter_general_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && faction_recruiter_general_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && faction_recruiter_general_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && faction_recruiter_general_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 14 && faction_recruiter_general_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 15 && faction_recruiter_general_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 17 && faction_recruiter_general_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 18 && faction_recruiter_general_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 19 && faction_recruiter_general_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 22 && faction_recruiter_general_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 24 && faction_recruiter_general_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 25 && faction_recruiter_general_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.faction_recruiter_general.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|