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

374 lines
12 KiB
Plaintext

// ======================================================================
//
// ep3_trando_pressk.script
//
//
//
// Created with SwgConversationEditor 1.36 - 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/ep3_trando_pressk";
// ======================================================================
// Script Conditions
// ======================================================================
boolean ep3_trando_pressk_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean ep3_trando_pressk_condition_isOnTask01 (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "ep3_trando_ssiksik", "talkToPressk");
}
// ----------------------------------------------------------------------
boolean ep3_trando_pressk_condition_isOnTask02 (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "ep3_trando_ssiksik", "reportPressk");
}
// ----------------------------------------------------------------------
boolean ep3_trando_pressk_condition_hasCompletedQuest01 (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "ep3_trando_ssiksik");
}
// ----------------------------------------------------------------------
boolean ep3_trando_pressk_condition_hasCompletedTask01 (obj_id player, obj_id npc)
{
return groundquests.hasCompletedTask(player, "ep3_trando_ssiksik", "talkToPressk");
}
// ======================================================================
// Script Actions
// ======================================================================
void ep3_trando_pressk_action_doSignal01 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "startWookieeAttack");
}
// ----------------------------------------------------------------------
void ep3_trando_pressk_action_doSignal02 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "rewardSlaverLeader");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int ep3_trando_pressk_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You nearly got yourself killed walking in here like that! How did you get by all those furballs that have us surrounded? No matter...you are here now and I doubt you are going to be able to make it out again. Stay low and out of the way.
//-- [RESPONSE NOTE]
//-- PLAYER: Ssiksik sent me to offer you support.
if (response == "s_495")
{
//-- [NOTE]
if (ep3_trando_pressk_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "rub_chin_thoughtful");
//-- NPC: So Ssiksik got my last message. I was worried that the Wookiees had blocked the signal. Well I hope your ready for a fight. Those furballs hit us from all sides and took out half my crew in the first wave. We managed to fight them off...they do not have the courage to fight us straight up so they have been using hit and run tactics since in order to whittle our numbers down.
string_id message = new string_id (c_stringFile, "s_497");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: How many Wookiees are out there?
boolean hasResponse0 = false;
if (ep3_trando_pressk_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_499");
utils.setScriptVar (player, "conversation.ep3_trando_pressk.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_trando_pressk.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_trando_pressk_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: So Ssiksik got my last message. I was worried that the Wookiees had blocked the signal. Well I hope your ready for a fight. Those furballs hit us from all sides and took out half my crew in the first wave. We managed to fight them off...they do not have the courage to fight us straight up so they have been using hit and run tactics since in order to whittle our numbers down.
//-- [RESPONSE NOTE]
//-- PLAYER: How many Wookiees are out there?
if (response == "s_499")
{
//-- [NOTE]
if (ep3_trando_pressk_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shrug_hands");
ep3_trando_pressk_action_doSignal01 (player, npc);
//-- NPC: I am not really certain. I get the feeling that they have not yet been willing to commit their entire force to attacking us yet. We haven't been hit in a while so I am guessing that they will be attacking us any time now.
string_id message = new string_id (c_stringFile, "s_501");
utils.removeScriptVar (player, "conversation.ep3_trando_pressk.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.ep3_trando_pressk");
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable( self, true );
setCondition( self, CONDITION_INTERESTING );
setName(self, "Pressk (a slaver)");
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable( self, true );
setCondition( self, CONDITION_INTERESTING );
setName(self, "Pressk (a slaver)");
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);
faceTo(self, player);
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.ep3_trando_pressk");
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 (ep3_trando_pressk_condition_hasCompletedQuest01 (player, npc))
{
doAnimationAction (npc, "nod_head_once");
//-- NPC: We are just going to take care of our wounded and then be moving on. Thanks again for the help killing those furballs.
string_id message = new string_id (c_stringFile, "s_487");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_trando_pressk_condition_isOnTask02 (player, npc))
{
doAnimationAction (npc, "salute2");
ep3_trando_pressk_action_doSignal02 (player, npc);
//-- NPC: It looks like we are in the clear now. You have really proven yourself against those furballs today. We will clean ourselves up and then get out of here. I am not sure if Ssiksik promised you anything but without your help we probably all would be dead. Take this with my thanks.
string_id message = new string_id (c_stringFile, "s_489");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_trando_pressk_condition_hasCompletedTask01 (player, npc))
{
doAnimationAction (npc, "smell_air");
//-- NPC: We are not out of the woods yet. Keep alert.
string_id message = new string_id (c_stringFile, "s_491");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_trando_pressk_condition_isOnTask01 (player, npc))
{
doAnimationAction (npc, "pound_fist_palm");
//-- NPC: You nearly got yourself killed walking in here like that! How did you get by all those furballs that have us surrounded? No matter...you are here now and I doubt you are going to be able to make it out again. Stay low and out of the way.
string_id message = new string_id (c_stringFile, "s_493");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Ssiksik sent me to offer you support.
boolean hasResponse0 = false;
if (ep3_trando_pressk_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_495");
utils.setScriptVar (player, "conversation.ep3_trando_pressk.branchId", 4);
npcStartConversation (player, npc, "ep3_trando_pressk", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_trando_pressk_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "wave_on_dismissing");
//-- NPC: Not now...I don't have time to deal with the likes of you. Beat it, pal.
string_id message = new string_id (c_stringFile, "s_503");
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 != "ep3_trando_pressk")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.ep3_trando_pressk.branchId");
if (branchId == 4 && ep3_trando_pressk_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && ep3_trando_pressk_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.ep3_trando_pressk.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================