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

770 lines
22 KiB
Plaintext

// ======================================================================
//
// pvp_station_rebel.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// Created with SwgConversationEditor 1.25 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.space_battlefield;
include library.space_quest;
include library.space_transition;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/pvp_station_rebel";
// ======================================================================
// Script Conditions
// ======================================================================
boolean pvp_station_rebel_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean pvp_station_rebel_condition_isPlayerRebel (obj_id player, obj_id npc)
{
return space_battlefield.isInRebelShip(player);
}
// ----------------------------------------------------------------------
boolean pvp_station_rebel_condition_isPlayerImperial (obj_id player, obj_id npc)
{
return ( space_battlefield.isInImperialShip(player) || pvpGetAlignedFaction( player ) == ##"imperial" );
}
// ----------------------------------------------------------------------
boolean pvp_station_rebel_condition_isRebelFactionWithMission (obj_id player, obj_id npc)
{
if (space_battlefield.isInNeutralShip(player))
return ( ( pvpGetAlignedFaction( player ) == ##"rebel" ) && space_quest.hasQuest(player ) );
else
return false;
}
// ----------------------------------------------------------------------
boolean pvp_station_rebel_condition_isInYacht (obj_id player, obj_id npc)
{
obj_id ship = space_transition.getContainingShip(player);
if (isIdValid( ship) )
{
string template = getTemplateName(ship);
if ( template != null && template.endsWith("_yacht.iff") )
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean pvp_station_rebel_condition_isPlayerNeutral (obj_id player, obj_id npc)
{
if(space_battlefield.isInNeutralShip(player))
{
if ( pvpGetAlignedFaction( player ) == ##"rebel" )
return false;
else
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean pvp_station_rebel_condition_isTooFar (obj_id player, obj_id npc)
{
obj_id containingShip = space_transition.getContainingShip(player);
return ( getDistance( npc, containingShip ) > space_transition.STATION_COMM_MAX_DISTANCE );
}
// ======================================================================
// Script Actions
// ======================================================================
void pvp_station_rebel_action_setPlayerToOvertStatus (obj_id player, obj_id npc)
{
space_transition.setPlayerOvert( player, ##"rebel" );
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
int pvp_station_rebel_tokenDI_prestigeCost (obj_id player, obj_id npc)
{
return space_battlefield.getPrestigeCostForTransition(player, npc);
}
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int pvp_station_rebel_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: We could use your help fighting the Empire, %TU, but you seem to be busy doing something else.
//-- [RESPONSE NOTE]
//-- PLAYER: I have a mission
if (response == "s_32da2cf3")
{
//-- [NOTE]
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
//-- NPC: Finish it, or better yet abort your mission. We need your help!
string_id message = new string_id (c_stringFile, "s_1ef0f7f");
removeObjVar (player, "conversation.pvp_station_rebel.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int pvp_station_rebel_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Welcome to the Rebel Alliance Space Station, %TU. Would you like to declare your affiliation with the Rebel Alliance?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes
if (response == "s_370822d1")
{
//-- [NOTE]
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
pvp_station_rebel_action_setPlayerToOvertStatus (player, npc);
//-- NPC: Very well, %TU. Your ship will begin broadcasting your Rebel Alliance affiliation in 30 seconds. You may want to clear the area in the event there are hostiles nearby. Rebel Alliance Station, out.
string_id message = new string_id (c_stringFile, "s_62e7ee");
removeObjVar (player, "conversation.pvp_station_rebel.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
chat.chat (npc, player, pp);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No
if (response == "s_457a7010")
{
//-- [NOTE]
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
//-- NPC: In that case, please move away from the station.
string_id message = new string_id (c_stringFile, "s_b780e818");
removeObjVar (player, "conversation.pvp_station_rebel.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What does that mean?
if (response == "s_dd67013")
{
//-- [NOTE]
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
//-- NPC: Although you are a Rebel Alliance Pilot by profession, you have not Declared your factional affiliation. Many Imperial ships [players] will hold fire in the event you are not really affiliated with the Rebel Alliance. You may declare your affiliation with the Alliance to make it clear that you are willing to respond to their attacks.
string_id message = new string_id (c_stringFile, "s_d2cd41a5");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: How long does this last?
boolean hasResponse0 = false;
if (pvp_station_rebel_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_626fe576");
setObjVar (player, "conversation.pvp_station_rebel.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.pvp_station_rebel.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int pvp_station_rebel_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Although you are a Rebel Alliance Pilot by profession, you have not Declared your factional affiliation. Many Imperial ships [players] will hold fire in the event you are not really affiliated with the Rebel Alliance. You may declare your affiliation with the Alliance to make it clear that you are willing to respond to their attacks.
//-- [RESPONSE NOTE]
//-- PLAYER: How long does this last?
if (response == "s_626fe576")
{
//-- [NOTE]
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
//-- NPC: You will be a Declared Rebel until you land your ship. The next time you launch, if you want to be a Declared Rebel again, you must speak to a Rebel Alliance Station again.
string_id message = new string_id (c_stringFile, "s_392e22");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: All Imperial Pilots will be able to attack me?
boolean hasResponse0 = false;
if (pvp_station_rebel_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_dc5b544f");
setObjVar (player, "conversation.pvp_station_rebel.branchId", 11);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.pvp_station_rebel.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int pvp_station_rebel_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You will be a Declared Rebel until you land your ship. The next time you launch, if you want to be a Declared Rebel again, you must speak to a Rebel Alliance Station again.
//-- [RESPONSE NOTE]
//-- PLAYER: All Imperial Pilots will be able to attack me?
if (response == "s_dc5b544f")
{
//-- [NOTE]
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
//-- NPC: Not all of them, %TU. Just the ones that have Declared their affiliation with the Empire. You'll be able to attack them, and they will be able to attack you. Ready to declare?
string_id message = new string_id (c_stringFile, "s_e4046084");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes
boolean hasResponse0 = false;
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No
boolean hasResponse1 = false;
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: What does that mean?
boolean hasResponse2 = false;
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_370822d1");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_457a7010");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_dd67013");
setObjVar (player, "conversation.pvp_station_rebel.branchId", 7);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcSpeak (player, pp);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.pvp_station_rebel.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
chat.chat (npc, player, pp);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int pvp_station_rebel_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Not all of them, %TU. Just the ones that have Declared their affiliation with the Empire. You'll be able to attack them, and they will be able to attack you. Ready to declare?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes
if (response == "s_370822d1")
{
//-- [NOTE]
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
pvp_station_rebel_action_setPlayerToOvertStatus (player, npc);
//-- NPC: Very well, %TU. Your ship will begin broadcasting your Rebel Alliance affiliation in 30 seconds. You may want to clear the area in the event there are hostiles nearby. Rebel Alliance Station, out.
string_id message = new string_id (c_stringFile, "s_62e7ee");
removeObjVar (player, "conversation.pvp_station_rebel.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
chat.chat (npc, player, pp);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No
if (response == "s_457a7010")
{
//-- [NOTE]
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
//-- NPC: In that case, please move away from the station.
string_id message = new string_id (c_stringFile, "s_b780e818");
removeObjVar (player, "conversation.pvp_station_rebel.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What does that mean?
if (response == "s_dd67013")
{
//-- [NOTE]
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
//-- NPC: Although you are a Rebel Alliance Pilot by profession, you have not Declared your factional affiliation. Many Imperial ships [players] will hold fire in the event you are not really affiliated with the Rebel Alliance. You may declare your affiliation with the Alliance to make it clear that you are willing to respond to their attacks.
string_id message = new string_id (c_stringFile, "s_d2cd41a5");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: How long does this last?
boolean hasResponse0 = false;
if (pvp_station_rebel_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_626fe576");
setObjVar (player, "conversation.pvp_station_rebel.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.pvp_station_rebel.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
setCondition (self, CONDITION_CONVERSABLE);
setObjVar(self, "convo.appearance", "object/mobile/space_comm_rebel_transport_01.iff" );
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setObjVar(self, "convo.appearance", "object/mobile/space_comm_rebel_transport_01.iff" );
detachScript(self, "space.content_tools.spacestation");
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.pvp_station_rebel");
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 (pvp_station_rebel_condition_isInYacht (player, npc))
{
//-- NPC: There's nothing we can do for you while you're in that civilian ship.
string_id message = new string_id (c_stringFile, "s_358253b2");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (pvp_station_rebel_condition_isPlayerImperial (player, npc))
{
//-- NPC: You are not welcome at this station!
string_id message = new string_id (c_stringFile, "s_514ace33");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (pvp_station_rebel_condition_isRebelFactionWithMission (player, npc))
{
//-- NPC: We could use your help fighting the Empire, %TU, but you seem to be busy doing something else.
string_id message = new string_id (c_stringFile, "s_223d8c5f");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I have a mission
boolean hasResponse0 = false;
if (pvp_station_rebel_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_32da2cf3");
setObjVar (player, "conversation.pvp_station_rebel.branchId", 3);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "pvp_station_rebel", null, pp, responses);
}
else
{
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
chat.chat (npc, player, null, null, pp);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (pvp_station_rebel_condition_isPlayerNeutral (player, npc))
{
//-- NPC: Sign up with the Rebel Alliance and we'll talk.
string_id message = new string_id (c_stringFile, "s_17456755");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (pvp_station_rebel_condition_isTooFar (player, npc))
{
//-- NPC: You need to move closer to this station.
string_id message = new string_id (c_stringFile, "s_48f82131");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
//-- NPC: Welcome to the Rebel Alliance Space Station, %TU. Would you like to declare your affiliation with the Rebel Alliance?
string_id message = new string_id (c_stringFile, "s_e7fb4e63");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes
boolean hasResponse0 = false;
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No
boolean hasResponse1 = false;
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: What does that mean?
boolean hasResponse2 = false;
if (pvp_station_rebel_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_370822d1");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_457a7010");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_dd67013");
setObjVar (player, "conversation.pvp_station_rebel.branchId", 7);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "pvp_station_rebel", null, pp, responses);
}
else
{
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
chat.chat (npc, player, null, null, pp);
}
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 != "pvp_station_rebel")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = getIntObjVar (player, "conversation.pvp_station_rebel.branchId");
if (branchId == 3 && pvp_station_rebel_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && pvp_station_rebel_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && pvp_station_rebel_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && pvp_station_rebel_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && pvp_station_rebel_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
removeObjVar (player, "conversation.pvp_station_rebel.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================