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

630 lines
19 KiB
Plaintext

// ======================================================================
//
// xandank_trophy.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// Created with SwgConversationEditor 1.35 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.groundquests;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/xandank_trophy";
// ======================================================================
// Script Conditions
// ======================================================================
boolean xandank_trophy_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean xandank_trophy_condition_isOnTask (obj_id player, obj_id npc)
{
return groundquests.isQuestActive(player, "som_xandank_trophey");
}
// ----------------------------------------------------------------------
boolean xandank_trophy_condition_hasFinishedTask (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "som_xandank_trophey", "xandank_trophy_nine");
}
// ----------------------------------------------------------------------
boolean xandank_trophy_condition_hasFinishedQuest (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "som_xandank_trophey");
}
// ======================================================================
// Script Actions
// ======================================================================
void xandank_trophy_action_startMission (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "som_xandank_trophey");
}
// ----------------------------------------------------------------------
void xandank_trophy_action_giveReward (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "xandank_trophy_signal_three");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int xandank_trophy_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hello again. Did you manage to track down that pack of xandanks?
//-- [RESPONSE NOTE]
//-- PLAYER: Sure did. And I brought back the pack leader head too.
if (response == "s_19")
{
doAnimationAction (player, "manipulate_medium");
//-- [NOTE]
if (xandank_trophy_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "manipulate_medium");
xandank_trophy_action_giveReward (player, npc);
//-- NPC: That is the best news that I have heard in a long time. I must say that I am highly impressed that you were able to do this so quickly. Hold on for a moment...there...done. Here, please take this for your troubles. It is a trophy to show everyone what an excellent xandank hunter you are. Thanks again, my friend.
string_id message = new string_id (c_stringFile, "s_20");
utils.removeScriptVar (player, "conversation.xandank_trophy.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int xandank_trophy_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: How is the hunt for those xandanks going?
//-- [RESPONSE NOTE]
//-- PLAYER: Still trying to track them down.
if (response == "s_17")
{
//-- [NOTE]
if (xandank_trophy_condition__defaultCondition (player, npc))
{
//-- NPC: Okay. I cannot thank you enough for trying to help us out with this little problem.
string_id message = new string_id (c_stringFile, "s_18");
utils.removeScriptVar (player, "conversation.xandank_trophy.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int xandank_trophy_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Welcome, off-worlder. I wish I could greet you in a time when things were not so dire. But I am afraid that we have lots of troubles.
//-- [RESPONSE NOTE]
//-- PLAYER: Really? What could be so...er....dire?
if (response == "s_16")
{
//-- [NOTE]
if (xandank_trophy_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: Well, as you can see, work in this camp has shut down. Headquarters simply is working us too hard without proper compensation, so we have to stand up for ourselves. Naturally, that means we haven't seen any fresh supplies in days. And to make matters worse, we are being hounded by a pack of xandanks.
string_id message = new string_id (c_stringFile, "s_22");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Xandanks? Aren't they usually further east?
boolean hasResponse0 = false;
if (xandank_trophy_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_24");
utils.setScriptVar (player, "conversation.xandank_trophy.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.xandank_trophy.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int xandank_trophy_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well, as you can see, work in this camp has shut down. Headquarters simply is working us too hard without proper compensation, so we have to stand up for ourselves. Naturally, that means we haven't seen any fresh supplies in days. And to make matters worse, we are being hounded by a pack of xandanks.
//-- [RESPONSE NOTE]
//-- PLAYER: Xandanks? Aren't they usually further east?
if (response == "s_24")
{
doAnimationAction (player, "rub_chin_thoughtful");
//-- [NOTE]
if (xandank_trophy_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "sigh_deeply");
//-- NPC: Yeah. It is very strange to see a pack this far west. We have our suspicions that someone might have intentionally placed this pack in this region just to cause us problems. Not that we can prove anything, of course. That pack has been causing all sorts of problems with our crews out in the field trying to gather up any supplies we can get our hands on.
string_id message = new string_id (c_stringFile, "s_26");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Why don't you just hunt down and kill the pack?
boolean hasResponse0 = false;
if (xandank_trophy_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_28");
utils.setScriptVar (player, "conversation.xandank_trophy.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.xandank_trophy.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int xandank_trophy_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Yeah. It is very strange to see a pack this far west. We have our suspicions that someone might have intentionally placed this pack in this region just to cause us problems. Not that we can prove anything, of course. That pack has been causing all sorts of problems with our crews out in the field trying to gather up any supplies we can get our hands on.
//-- [RESPONSE NOTE]
//-- PLAYER: Why don't you just hunt down and kill the pack?
if (response == "s_28")
{
//-- [NOTE]
if (xandank_trophy_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: I wish we could. With everything else going on, we just do not have the manpower to spend hunting down a pack of xandanks that are really just a nuisance.
string_id message = new string_id (c_stringFile, "s_30");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Tell you what...I will hunt them down for you.
boolean hasResponse0 = false;
if (xandank_trophy_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Yeah, sounds like you do have troubles. Good luck with that.
boolean hasResponse1 = false;
if (xandank_trophy_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_32");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_36");
utils.setScriptVar (player, "conversation.xandank_trophy.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.xandank_trophy.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int xandank_trophy_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I wish we could. With everything else going on, we just do not have the manpower to spend hunting down a pack of xandanks that are really just a nuisance.
//-- [RESPONSE NOTE]
//-- PLAYER: Tell you what...I will hunt them down for you.
if (response == "s_32")
{
//-- [NOTE]
if (xandank_trophy_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_away");
xandank_trophy_action_startMission (player, npc);
//-- NPC: You would? That would be wonderful. I am not sure where they are, but I do know the last place they were spotted. If you can search around that area, maybe you can track them down. I would just ask that if you find them, you eliminate the whole pack, especially the pack leader. In fact, bring me back the head of the pack leader, so I can report to the boys that the xandanks are all dead. Thanks again.
string_id message = new string_id (c_stringFile, "s_34");
utils.removeScriptVar (player, "conversation.xandank_trophy.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Yeah, sounds like you do have troubles. Good luck with that.
if (response == "s_36")
{
//-- [NOTE]
if (xandank_trophy_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: Yeah, I will say we do.
string_id message = new string_id (c_stringFile, "s_38");
utils.removeScriptVar (player, "conversation.xandank_trophy.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.xandank_trophy");
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable (self, true);
setCondition( self, CONDITION_INTERESTING );
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable (self, true);
setCondition( self, CONDITION_INTERESTING );
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.xandank_trophy");
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 (xandank_trophy_condition_hasFinishedQuest (player, npc))
{
doAnimationAction (npc, "wave1");
//-- NPC: Things have been going a little easier for us now that those xandanks have been taken care of. We really appreciate you helping us out like that.
string_id message = new string_id (c_stringFile, "s_4");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (xandank_trophy_condition_hasFinishedTask (player, npc))
{
doAnimationAction (npc, "greet");
//-- NPC: Hello again. Did you manage to track down that pack of xandanks?
string_id message = new string_id (c_stringFile, "s_6");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Sure did. And I brought back the pack leader head too.
boolean hasResponse0 = false;
if (xandank_trophy_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_19");
utils.setScriptVar (player, "conversation.xandank_trophy.branchId", 2);
npcStartConversation (player, npc, "xandank_trophy", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (xandank_trophy_condition_isOnTask (player, npc))
{
//-- NPC: How is the hunt for those xandanks going?
string_id message = new string_id (c_stringFile, "s_10");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Still trying to track them down.
boolean hasResponse0 = false;
if (xandank_trophy_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_17");
utils.setScriptVar (player, "conversation.xandank_trophy.branchId", 4);
npcStartConversation (player, npc, "xandank_trophy", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (xandank_trophy_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: Welcome, off-worlder. I wish I could greet you in a time when things were not so dire. But I am afraid that we have lots of troubles.
string_id message = new string_id (c_stringFile, "s_14");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Really? What could be so...er....dire?
boolean hasResponse0 = false;
if (xandank_trophy_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_16");
utils.setScriptVar (player, "conversation.xandank_trophy.branchId", 6);
npcStartConversation (player, npc, "xandank_trophy", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false.");
return SCRIPT_CONTINUE;
}
// ----------------------------------------------------------------------
trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response)
{
if (conversationId != "xandank_trophy")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.xandank_trophy.branchId");
if (branchId == 2 && xandank_trophy_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && xandank_trophy_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && xandank_trophy_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && xandank_trophy_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && xandank_trophy_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && xandank_trophy_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.xandank_trophy.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================