mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
438 lines
16 KiB
Plaintext
438 lines
16 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// coa3lgeneralveers.script
|
|
//
|
|
//
|
|
//
|
|
// DO NOT EDIT THIS AUTO-GENERATED FILE. PLEASE USE THE CONVERATION EDITOR!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.badge;
|
|
include library.chat;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/coa3lgeneralveers";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean coa3lgeneralveers_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean coa3lgeneralveers_condition_spokeCoordinatorLast (obj_id player, obj_id npc)
|
|
{
|
|
return getIntObjVar (player, "coa3.convTracker") == 401;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean coa3lgeneralveers_condition_finalMissionActive (obj_id player, obj_id npc)
|
|
{
|
|
return getIntObjVar (player, "coa3.convTracker") == 402;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean coa3lgeneralveers_condition_hasFinishedStory (obj_id player, obj_id npc)
|
|
{
|
|
// If the player has completed the story and has COA3 badge;
|
|
return (badge.hasBadge(player, "event_coa3_imperial"));
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void coa3lgeneralveers_action__defaultAction (obj_id player, obj_id npc)
|
|
{
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void coa3lgeneralveers_action_getFinalMission (obj_id player, obj_id npc)
|
|
{
|
|
setObjVar (player, "coa3.convTracker", 402);
|
|
|
|
// Give player final mission.
|
|
dictionary params = new dictionary();
|
|
params.put("player", player);
|
|
params.put("npc", npc);
|
|
params.put("value", 5);
|
|
|
|
messageTo(npc, "messageStartMission", params, 0, false);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void coa3lgeneralveers_action_refreshFinalMission (obj_id player, obj_id npc)
|
|
{
|
|
setObjVar (player, "coa3.convTracker", 402);
|
|
|
|
// Refresh mission
|
|
dictionary params = new dictionary();
|
|
params.put("player", player);
|
|
params.put("npc", npc);
|
|
params.put("value", 5);
|
|
|
|
messageTo(npc, "messageStartMission", params, 0, false);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void coa3lgeneralveers_action_abortFinalMission (obj_id player, obj_id npc)
|
|
{
|
|
setObjVar (player, "coa3.convTracker", 401);
|
|
|
|
// Abort final mission
|
|
dictionary params = new dictionary();
|
|
params.put("player", player);
|
|
params.put("npc", npc);
|
|
params.put("value", 5);
|
|
|
|
messageTo(player, "handleAbortMission", params, 0, false);
|
|
}
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "npc.conversation.coa3lgeneralveers");
|
|
|
|
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, "npc.conversation.coa3lgeneralveers");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnStartNpcConversation (obj_id player)
|
|
{
|
|
if (ai_lib.isInCombat (self) || ai_lib.isInCombat (player))
|
|
return SCRIPT_OVERRIDE;
|
|
|
|
//-- [NOTE] If the player has completed the story and has COA3 badge
|
|
if (coa3lgeneralveers_condition_hasFinishedStory (player, self))
|
|
{
|
|
//-- NPC: Great work taking out that research facility that really hit them where it counts! If you continue your service to the Empire in this manner, I see great things in your future.
|
|
string_id message = new string_id (c_stringFile, "s_bea4597");
|
|
chat.chat (self, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] The player has spoken to the coordinator for the last time and has recieved the off-world waypoint.
|
|
if (coa3lgeneralveers_condition_spokeCoordinatorLast (player, self))
|
|
{
|
|
//-- NPC: So you're the one we've been hearing so much about. I wanted to personally thank you for doing such a commendable job. The Empire needs more Soldiers like you. Thanks to your efforts we were able to find one of their research facilities. Destroying this facility would strike a serious blow against them and could significantly hamper their efforts. We need that facility destroyed and I think you're just the person for the job. Can I count on you?
|
|
string_id message = new string_id (c_stringFile, "s_1cfbefd4");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: You can count on me.
|
|
boolean hasResponse0 = false;
|
|
if (coa3lgeneralveers_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm not able to do this now
|
|
boolean hasResponse1 = false;
|
|
if (coa3lgeneralveers_condition__defaultCondition (player, self))
|
|
{
|
|
++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_fdba7430");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_2977a9a3");
|
|
|
|
setObjVar (player, "conversation.coa3lgeneralveers.branchId", 2);
|
|
|
|
npcStartConversation (player, self, "coa3lgeneralveers", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (self, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] The final mission is active.
|
|
if (coa3lgeneralveers_condition_finalMissionActive (player, self))
|
|
{
|
|
//-- NPC: What's the matter, don't know how to follow orders? Why haven't you destroyed the facility yet?
|
|
string_id message = new string_id (c_stringFile, "s_370a3d89");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll get on it right now.
|
|
boolean hasResponse0 = false;
|
|
if (coa3lgeneralveers_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I wasn't able to located the facility
|
|
boolean hasResponse1 = false;
|
|
if (coa3lgeneralveers_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I can not do this right now
|
|
boolean hasResponse2 = false;
|
|
if (coa3lgeneralveers_condition__defaultCondition (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_92d64a93");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_6be1cd6b");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_2cdb5dd0");
|
|
|
|
setObjVar (player, "conversation.coa3lgeneralveers.branchId", 5);
|
|
|
|
npcStartConversation (player, self, "coa3lgeneralveers", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (self, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] None of the above.
|
|
if (coa3lgeneralveers_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: I don't have time to talk right now, I'm waiting for someone.
|
|
string_id message = new string_id (c_stringFile, "s_4d8cedd4");
|
|
chat.chat (self, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnStartNpcConversation were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response)
|
|
{
|
|
if (conversationId != "coa3lgeneralveers")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
int branchId = getIntObjVar (player, "conversation.coa3lgeneralveers.branchId");
|
|
|
|
//-- [BRANCH NOTE] The player has spoken to the coordinator for the last time and has recieved the off-world waypoint.
|
|
//-- NPC: So you're the one we've been hearing so much about. I wanted to personally thank you for doing such a commendable job. The Empire needs more Soldiers like you. Thanks to your efforts we were able to find one of their research facilities. Destroying this facility would strike a serious blow against them and could significantly hamper their efforts. We need that facility destroyed and I think you're just the person for the job. Can I count on you?
|
|
//-- [RESPONSE NOTE] Player is given final destroy mission.
|
|
//-- PLAYER: You can count on me.
|
|
if (branchId == 2 && response == "s_fdba7430")
|
|
{
|
|
coa3lgeneralveers_action_getFinalMission (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (coa3lgeneralveers_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Good. Here's the location of the facility. Reduce it to rubble and destroy any traitors there you find. The destruction of this facility will seriously hamper their efforts to find an Alderaanian Flora alternative. This is not an easy mission, so you may want to recruit some help to destroy it.
|
|
string_id message = new string_id (c_stringFile, "s_1a6ba35a");
|
|
removeObjVar (player, "conversation.coa3lgeneralveers.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'So you're the one we've been hearing so much about. I wanted to personally thank you for doing such a commendable job. The Empire needs more Soldiers like you. Thanks to your efforts we were able to find one of their research facilities. Destroying this facility would strike a serious blow against them and could significantly hamper their efforts. We need that facility destroyed and I think you're just the person for the job. Can I count on you?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE] The player has spoken to the coordinator for the last time and has recieved the off-world waypoint.
|
|
//-- NPC: So you're the one we've been hearing so much about. I wanted to personally thank you for doing such a commendable job. The Empire needs more Soldiers like you. Thanks to your efforts we were able to find one of their research facilities. Destroying this facility would strike a serious blow against them and could significantly hamper their efforts. We need that facility destroyed and I think you're just the person for the job. Can I count on you?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm not able to do this now
|
|
if (branchId == 2 && response == "s_2977a9a3")
|
|
{
|
|
//-- [NOTE]
|
|
if (coa3lgeneralveers_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: What? This is not acceptable! Perhaps you are not as good as the stories I've been hearing about you. Get out of my sight.
|
|
string_id message = new string_id (c_stringFile, "s_efae2d69");
|
|
removeObjVar (player, "conversation.coa3lgeneralveers.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'So you're the one we've been hearing so much about. I wanted to personally thank you for doing such a commendable job. The Empire needs more Soldiers like you. Thanks to your efforts we were able to find one of their research facilities. Destroying this facility would strike a serious blow against them and could significantly hamper their efforts. We need that facility destroyed and I think you're just the person for the job. Can I count on you?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE] The final mission is active.
|
|
//-- NPC: What's the matter, don't know how to follow orders? Why haven't you destroyed the facility yet?
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll get on it right now.
|
|
if (branchId == 5 && response == "s_92d64a93")
|
|
{
|
|
//-- [NOTE]
|
|
if (coa3lgeneralveers_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Get to it and don't leave anything standing!
|
|
string_id message = new string_id (c_stringFile, "s_a486253d");
|
|
removeObjVar (player, "conversation.coa3lgeneralveers.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'What's the matter, don't know how to follow orders? Why haven't you destroyed the facility yet?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE] The final mission is active.
|
|
//-- NPC: What's the matter, don't know how to follow orders? Why haven't you destroyed the facility yet?
|
|
//-- [RESPONSE NOTE] Refresh the mission waypoint
|
|
//-- PLAYER: I wasn't able to located the facility
|
|
if (branchId == 5 && response == "s_6be1cd6b")
|
|
{
|
|
coa3lgeneralveers_action_refreshFinalMission (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (coa3lgeneralveers_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Perhaps our data was faulty. I've uploaded some fresh intel to your datapad.
|
|
string_id message = new string_id (c_stringFile, "s_b02864c6");
|
|
removeObjVar (player, "conversation.coa3lgeneralveers.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'What's the matter, don't know how to follow orders? Why haven't you destroyed the facility yet?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE] The final mission is active.
|
|
//-- NPC: What's the matter, don't know how to follow orders? Why haven't you destroyed the facility yet?
|
|
//-- [RESPONSE NOTE] Abort the final mission. Set objvar back to 401.
|
|
//-- PLAYER: I can not do this right now
|
|
if (branchId == 5 && response == "s_2cdb5dd0")
|
|
{
|
|
coa3lgeneralveers_action_abortFinalMission (player, self);
|
|
|
|
//-- [NOTE]
|
|
if (coa3lgeneralveers_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: I hope you realize that we don't take look kindly on failure. I'll overlook it this one time. If you wish to try it again some time in the future, you let me know.
|
|
string_id message = new string_id (c_stringFile, "s_4461239");
|
|
removeObjVar (player, "conversation.coa3lgeneralveers.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'What's the matter, don't know how to follow orders? Why haven't you destroyed the facility yet?' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
removeObjVar (player, "conversation.coa3lgeneralveers.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|