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

2282 lines
65 KiB
Plaintext

// ======================================================================
//
// npe_brawler.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.npe;
include library.space_quest;
include library.static_item;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/npe_brawler";
// ======================================================================
// Script Conditions
// ======================================================================
boolean npe_brawler_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_isTaskActiveAny (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "npe_brawler_2hand", "kill") ||
groundquests.isTaskActive(player, "npe_brawler_1hand", "kill") ||
groundquests.isTaskActive(player, "npe_brawler_unarmed", "kill") ||
groundquests.isTaskActive(player, "npe_brawler_polearm", "kill"));
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_isTaskCompleteUnarmed (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_brawler_unarmed", "wait");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_isTaskComplete1hand (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_brawler_1hand", "wait");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_isTaskComplete2hand (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_brawler_2hand", "wait");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_isTaskCompletePolearm (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_brawler_polearm", "wait");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_isTaskActiveStory1 (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "npe_brawler_1", "flits") ||
groundquests.isTaskActive(player, "npe_brawler_1", "elevator_up") ||
groundquests.isTaskActive(player, "npe_brawler_1", "scyks") &&
!groundquests.hasCompletedQuest(player, "npe_brawler_1"));
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasCompletedTaskStory1 (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_brawler_1", "return");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasCompletedStory1 (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_brawler_1");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_isTaskActiveStory2 (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "npe_brawler_2", "tiarsis_talk") ||
groundquests.isTaskActive(player, "npe_brawler_2", "killdude") ||
groundquests.isTaskActive(player, "npe_brawler_2", "npe_brawler_tiasris_wait"));
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasCompletedTaskSmugglers (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_brawler_2", "npe_smuggler_finish");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasCompletedStory2 (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_brawler_2");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_isTaskActiveStory4 (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "npe_brawler_4a", "stims") ||
groundquests.isTaskActive(player, "npe_brawler_4a", "boss") &&
!groundquests.hasCompletedQuest(player, "npe_brawler_4a"));
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasCompletedTaskStory4 (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_brawler_4a", "npe_brawler4_2h_finish");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasCompletedStory4 (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_brawler_4a");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_isTaskActiveSmuggler (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "npe_brawler_2", "elev_down") ||
groundquests.isTaskActive(player, "npe_brawler_2", "waiting"));
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasCompletedAll (obj_id player, obj_id npc)
{
return (npe_brawler_condition_hasFinished1Hand(player, npc) && npe_brawler_condition_hasFinished2Hand(player, npc) && npe_brawler_condition_hasFinishedPolearm(player, npc) && npe_brawler_condition_hasFinishedUnarmed(player, npc));
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_cantHelp (obj_id player, obj_id npc)
{
return !npe_brawler_condition_hasCompletedTemplate(player, npc);
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasCompletedTemplate (obj_id player, obj_id npc)
{
return hasObjVar(player, "npe.finishedTemplate");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasFinishedUnarmed (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_brawler_unarmed");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasFinishedPolearm (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_brawler_polearm");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasFinished1Hand (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_brawler_1hand");
}
// ----------------------------------------------------------------------
boolean npe_brawler_condition_hasFinished2Hand (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_brawler_2hand");
}
// ======================================================================
// Script Actions
// ======================================================================
void npe_brawler_action_givePolearmQuest (obj_id player, obj_id npc)
{
// Apply the first quest to the player here
groundquests.grantQuest(player, "npe_brawler_polearm");
//groundquests.grantQuest(player, "npe_brawler_polearmreward", false);
groundquests.sendSignal(player, "talked_to_rydel");
npe.givePolePopUp(player, npc);
npe.giveAutoPopUp(player, npc);
boolean hasItem = false;
obj_id[] weapons = new obj_id[1];
obj_id[] playerStuff = getInventoryAndEquipment(player);
//loop thru players inventory, make sure they dont have the item already.
for(int i =0; i < playerStuff.length; i++)
{
string templateName = static_item.getStaticItemName(playerStuff[i]);
if(templateName != null)
{
if(templateName == "weapon_polearm_02_02")
hasItem = true;
}
}
if(hasItem == false)
{
obj_id polearm = static_item.createNewItemFunction("weapon_polearm_02_02", player);
weapons[0] = polearm;
showLootBox(player, weapons);
}
}
// ----------------------------------------------------------------------
void npe_brawler_action_giveUnarmedQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "npe_brawler_unarmed");
groundquests.sendSignal(player, "talked_to_rydel");
npe.giveUnarmPopUp(player, npc);
npe.giveAutoPopUp(player, npc);
}
// ----------------------------------------------------------------------
void npe_brawler_action_give1handquest (obj_id player, obj_id npc)
{
// Apply the first quest to the player here
groundquests.grantQuest(player, "npe_brawler_1hand");
//groundquests.grantQuest(player, "npe_brawler_1handreward", false);
groundquests.sendSignal(player, "talked_to_rydel");
npe.give1hPopUp(player, npc);
npe.giveAutoPopUp(player, npc);
boolean hasItem = false;
obj_id[] weapons = new obj_id[1];
obj_id[] playerStuff = getInventoryAndEquipment(player);
//loop thru players inventory, make sure they dont have the item already.
for(int i =0; i < playerStuff.length; i++)
{
string templateName = static_item.getStaticItemName(playerStuff[i]);
if(templateName != null)
{
if(templateName == "weapon_sword_1h_02_02")
hasItem = true;
}
}
if(hasItem == false)
{
obj_id sword = static_item.createNewItemFunction("weapon_sword_1h_02_02", player);
weapons[0] = sword;
showLootBox(player, weapons);
}
}
// ----------------------------------------------------------------------
void npe_brawler_action_give2handquest (obj_id player, obj_id npc)
{
// Apply the first quest to the player here
groundquests.grantQuest(player, "npe_brawler_2hand");
//groundquests.grantQuest(player, "npe_brawler_2handreward", false);
groundquests.sendSignal(player, "talked_to_rydel");
npe.give2hPopUp(player, npc);
npe.giveAutoPopUp(player, npc);
boolean hasItem = false;
obj_id[] weapons = new obj_id[1];
obj_id[] playerStuff = getInventoryAndEquipment(player);
//loop thru players inventory, make sure they dont have the item already.
for(int i =0; i < playerStuff.length; i++)
{
string templateName = static_item.getStaticItemName(playerStuff[i]);
if(templateName != null)
{
if(templateName == "weapon_sword_2h_02_02")
hasItem = true;
}
}
if(hasItem == false)
{
obj_id sword = static_item.createNewItemFunction("weapon_sword_2h_02_02", player);
weapons[0] = sword;
showLootBox(player, weapons);
}
}
// ----------------------------------------------------------------------
void npe_brawler_action_giveStory1 (obj_id player, obj_id npc)
{
// Apply the first quest to the player here
groundquests.requestGrantQuest(player, "npe_brawler_1");
}
// ----------------------------------------------------------------------
void npe_brawler_action_giveSingalUnarmed (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_brawler_unarmed");
groundquests.sendSignal(player, "finished_rydel");
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
}
// ----------------------------------------------------------------------
void npe_brawler_action_giveSignal1hand (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_brawler_1hand");
groundquests.sendSignal(player, "finished_rydel");
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
//npe.giveCreditPopUp(player, npc);
}
// ----------------------------------------------------------------------
void npe_brawler_action_giveSignal2hand (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_brawler_2hand");
groundquests.sendSignal(player, "finished_rydel");
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
//npe.giveCreditPopUp(player, npc);
}
// ----------------------------------------------------------------------
void npe_brawler_action_giveSignalPolearm (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_brawler_polearm");
groundquests.sendSignal(player, "finished_rydel");
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
//npe.giveCreditPopUp(player, npc);
}
// ----------------------------------------------------------------------
void npe_brawler_action_giveSignalStory1 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_brawler_killstuff");
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
}
// ----------------------------------------------------------------------
void npe_brawler_action_giveStory2 (obj_id player, obj_id npc)
{
// Apply the first quest to the player here
groundquests.requestGrantQuest(player, "npe_brawler_2");
}
// ----------------------------------------------------------------------
void npe_brawler_action_grantStory4 (obj_id player, obj_id npc)
{
// Apply the first quest to the player here
groundquests.requestGrantQuest(player, "npe_brawler_4a");
}
// ----------------------------------------------------------------------
void npe_brawler_action_giveSignalSmuggs (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_brawler_smugglers");
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
}
// ----------------------------------------------------------------------
void npe_brawler_action_facePlayer (obj_id player, obj_id npc)
{
faceTo(npc, player);
}
// ----------------------------------------------------------------------
void npe_brawler_action_giveSignalStory4 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_brawler4a_done");
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int npe_brawler_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I have no other work for you.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you again for your guidance.
if (response == "s_260")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "bow");
//-- NPC: It was my pleasure, young %TU.
string_id message = new string_id (c_stringFile, "s_261");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: How did you do, young %TU, with your fight against the crimelord?
//-- [RESPONSE NOTE]
//-- PLAYER: I succeeded. The crimelord will bother us no more.
if (response == "s_262")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
//-- NPC: You are a lifesaver, literally! Thankfully, things have quieted down for now, so I have no other work for you. I hope you pass on what you've learned to others. We need more brave beings such as yourself.
string_id message = new string_id (c_stringFile, "s_263");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I will. Thank you.
boolean hasResponse0 = false;
if (npe_brawler_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_264");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You are a lifesaver, literally! Thankfully, things have quieted down for now, so I have no other work for you. I hope you pass on what you've learned to others. We need more brave beings such as yourself.
//-- [RESPONSE NOTE]
//-- PLAYER: I will. Thank you.
if (response == "s_264")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "feed_creature_medium");
npe_brawler_action_giveSignalStory4 (player, npc);
//-- NPC: Before you go, please choose a weapon from my collection. You have definitely earned it!
string_id message = new string_id (c_stringFile, "s_265");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Why are you here? Were you successful in your assignment against the crimelord?
//-- [RESPONSE NOTE]
//-- PLAYER: Not yet. I'll try again.
if (response == "s_256")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "bow");
//-- NPC: Hurry! We dare not wait and see what they do.
string_id message = new string_id (c_stringFile, "s_257");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I have just received some disturbing information from Inaldra.
//-- [RESPONSE NOTE]
//-- PLAYER: This must be pretty serious.
if (response == "s_249")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
//-- NPC: Indeed it is, %TU. On the bottom floor of the Tansarii Point Station, some pirates have broken through the outer hull and are creating a dangerous situation. One of their leaders, a crimelord, is taking charge and instructing his cronies to cause havoc on our beloved Space Station. There is no telling what terrible feats they are capable of.
string_id message = new string_id (c_stringFile, "s_250");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: The thugs I keep running into... we should stop them.
boolean hasResponse0 = false;
if (npe_brawler_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_251");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 9);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcSpeak (player, pp);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Indeed it is, %TU. On the bottom floor of the Tansarii Point Station, some pirates have broken through the outer hull and are creating a dangerous situation. One of their leaders, a crimelord, is taking charge and instructing his cronies to cause havoc on our beloved Space Station. There is no telling what terrible feats they are capable of.
//-- [RESPONSE NOTE]
//-- PLAYER: The thugs I keep running into... we should stop them.
if (response == "s_251")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_grantStory4 (player, npc);
//-- NPC: I am glad that we are in agreement on the matter. It may be a difficult fight, so first, you should stop by the Medical Center and pick up a few stimpacks.
string_id message = new string_id (c_stringFile, "s_252");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Have you spoken with Tiarsis yet? No? I think you should speak with her. Unfortunately, I'm quite busy.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm on my way.
if (response == "s_238")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: Good.
string_id message = new string_id (c_stringFile, "s_239");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You seem excited. What is it?
//-- [RESPONSE NOTE]
//-- PLAYER: I found out about some possible sabotage.
if (response == "s_108")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
//-- NPC: Hmm, you had better investigate this.
string_id message = new string_id (c_stringFile, "s_110");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch15 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You've shown bravery. I just heard about the disturbance down in the storage areas. You handled those thugs impressively.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you. I knew I had to do something.
if (response == "s_241")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_giveSignalSmuggs (player, npc);
//-- NPC: We like proactive beings around here. I have something for you. You may choose your reward for all your hard work. You can use it or sell it as you see fit.
string_id message = new string_id (c_stringFile, "s_242");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch17 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Go speak with Tiarsis in the Cantina. She knows all the rumors and may know some people who need help.
//-- [RESPONSE NOTE]
//-- PLAYER: I will, sir.
if (response == "s_234")
{
doAnimationAction (player, "bow");
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_giveStory2 (player, npc);
//-- NPC: Remember to keep your wits about you, my friend.
string_id message = new string_id (c_stringFile, "s_235");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch19 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Were you successful in your assignment, my friend? Were you able to defeat the creatures?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, I was successful.
if (response == "s_221")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_giveSignalStory1 (player, npc);
//-- NPC: Good. We appreciate it. The situation was getting out of hand. Take this. It's a little token of my appreciation.
string_id message = new string_id (c_stringFile, "s_222");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch21 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I see you have returned. A little too soon though, I must say. Reports indicate that there is still an overabundance of creatures up there. Did you vanquish all the creatures I asked you to in the Atrium?
//-- [RESPONSE NOTE]
//-- PLAYER: No, not yet. But I will.
if (response == "s_218")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "bow");
//-- NPC: Then go. I await your return.
string_id message = new string_id (c_stringFile, "s_219");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch23 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Amazing! Your fists destroyed the droids as if they were made of cloth.
//-- [RESPONSE NOTE]
//-- PLAYER: I am honored by your kind words.
if (response == "s_160")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_giveSingalUnarmed (player, npc);
//-- NPC: I shudder to think of what you shall do to your enemies in the future.
string_id message = new string_id (c_stringFile, "s_161");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch25 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Not bad at all. You are shaping up to become one magnificent warrior. The staff looked as if it were an extension of your arms.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you.
if (response == "s_164")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_giveSignalPolearm (player, npc);
//-- NPC: It is an honor to work with one such as yourself.
string_id message = new string_id (c_stringFile, "s_165");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch27 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Very impressive. You seem to have a natural fluidity with two-handed weapons.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you.
if (response == "s_156")
{
doAnimationAction (player, "bow");
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_giveSignal2hand (player, npc);
//-- NPC: Here. You'll need this. It will be useful to you, %TU.
string_id message = new string_id (c_stringFile, "s_157");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch29 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Your skills with the one-handed weapons are improving!
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you, sir.
if (response == "s_152")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_giveSignal1hand (player, npc);
//-- NPC: Here, take this, %TU. May it aid you in your future endeavors.
string_id message = new string_id (c_stringFile, "s_153");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch31 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I sense, my friend, that you haven't completed the tasks I presented you with. I expect you to continue... in due time, of course.
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, sir. I will come back with them done!
if (response == "s_117")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "bow");
//-- NPC: Good.
string_id message = new string_id (c_stringFile, "s_119");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch33 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Ah, yes. I heard you might be coming, %TU. I have an important assignment for you. Perhaps you might be interested?
//-- [RESPONSE NOTE]
//-- PLAYER: I'm ready, sir.
if (response == "s_103")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
//-- NPC: To fully understand your potential, I need to place you in a real combat situation. It's the only way you can truly test yourself.
string_id message = new string_id (c_stringFile, "s_105");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I will do whatever it takes.
boolean hasResponse0 = false;
if (npe_brawler_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: You got me so far. Tell me more.
boolean hasResponse1 = false;
if (npe_brawler_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_344");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_107");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 34);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I think I would like to practice first.
if (response == "s_87")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
//-- NPC: Certainly, what arts would you like to practice?
string_id message = new string_id (c_stringFile, "s_88");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would like to practice my unarmed skills.
boolean hasResponse0 = false;
if (!npe_brawler_condition_hasFinishedUnarmed (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I would like to practice my two-handed weapon skills.
boolean hasResponse1 = false;
if (!npe_brawler_condition_hasFinished2Hand (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I would like to practice my one-hand weapon skills.
boolean hasResponse2 = false;
if (!npe_brawler_condition_hasFinished1Hand (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
//-- PLAYER: I would like to practice my polearm skills.
boolean hasResponse3 = false;
if (!npe_brawler_condition_hasFinishedPolearm (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse3 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_90");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_99");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_104");
if (hasResponse3)
responses [responseIndex++] = new string_id (c_stringFile, "s_113");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 39);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch34 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: To fully understand your potential, I need to place you in a real combat situation. It's the only way you can truly test yourself.
//-- [RESPONSE NOTE]
//-- PLAYER: I will do whatever it takes.
if (response == "s_344")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_giveStory1 (player, npc);
//-- NPC: Good, go to the Atrium and remove some of the menacing creatures up there.
string_id message = new string_id (c_stringFile, "s_347");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: You got me so far. Tell me more.
if (response == "s_107")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
//-- NPC: The upper level of the Tansarii Point Station houses the Atrium. We normally have it populated with some mild-mannered creatures, but lately they have been acting strangely. It seems that they are breeding much more rapidly than we expected.
string_id message = new string_id (c_stringFile, "s_109");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Would you like me to investigate?
boolean hasResponse0 = false;
if (npe_brawler_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_386");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 36);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch36 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The upper level of the Tansarii Point Station houses the Atrium. We normally have it populated with some mild-mannered creatures, but lately they have been acting strangely. It seems that they are breeding much more rapidly than we expected.
//-- [RESPONSE NOTE]
//-- PLAYER: Would you like me to investigate?
if (response == "s_386")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
//-- NPC: Yes, please. With so many creatures fighting for a small amount of food, they are becoming increasingly hostile and bold. I'm afraid they might harm others. Before this gets really out of control, you'll need to investigate and remove 10 of the creatures to stem some of their population.
string_id message = new string_id (c_stringFile, "s_387");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'll come back successful.
boolean hasResponse0 = false;
if (npe_brawler_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_389");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 37);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch37 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Yes, please. With so many creatures fighting for a small amount of food, they are becoming increasingly hostile and bold. I'm afraid they might harm others. Before this gets really out of control, you'll need to investigate and remove 10 of the creatures to stem some of their population.
//-- [RESPONSE NOTE]
//-- PLAYER: I'll come back successful.
if (response == "s_389")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_giveStory1 (player, npc);
//-- NPC: Good. I await your return, young %TU.
string_id message = new string_id (c_stringFile, "s_391");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_brawler_handleBranch39 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Certainly, what arts would you like to practice?
//-- [RESPONSE NOTE]
//-- PLAYER: I would like to practice my unarmed skills.
if (response == "s_90")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_giveUnarmedQuest (player, npc);
//-- NPC: Let's get started. Try practicing against my training droids.
string_id message = new string_id (c_stringFile, "s_96");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I would like to practice my two-handed weapon skills.
if (response == "s_99")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_give2handquest (player, npc);
//-- NPC: Here, take this axe and let's get started. Destroy some of my practice droids.
string_id message = new string_id (c_stringFile, "s_101");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I would like to practice my one-hand weapon skills.
if (response == "s_104")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_give1handquest (player, npc);
//-- NPC: Here, this should help you. Now, go and destroy some training droids.
string_id message = new string_id (c_stringFile, "s_111");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I would like to practice my polearm skills.
if (response == "s_113")
{
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
npe_brawler_action_givePolearmQuest (player, npc);
//-- NPC: Let's begin your training. Take this training staff, and destroy some training droids.
string_id message = new string_id (c_stringFile, "s_116");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.npe_brawler");
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable( self, true );
//setCondition( self, CONDITION_INTERESTING );
setName( self, "Rydel Delan" );
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable( self, true );
//setCondition( self, CONDITION_INTERESTING );
setName( self, "Rydel Delan" );
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.npe_brawler");
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 (npe_brawler_condition_hasCompletedStory4 (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: I have no other work for you.
string_id message = new string_id (c_stringFile, "s_259");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you again for your guidance.
boolean hasResponse0 = false;
if (npe_brawler_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_260");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 1);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_hasCompletedTaskStory4 (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: How did you do, young %TU, with your fight against the crimelord?
string_id message = new string_id (c_stringFile, "s_258");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I succeeded. The crimelord will bother us no more.
boolean hasResponse0 = false;
if (npe_brawler_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_262");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 3);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_brawler", 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 (npe_brawler_condition_isTaskActiveStory4 (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: Why are you here? Were you successful in your assignment against the crimelord?
string_id message = new string_id (c_stringFile, "s_255");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Not yet. I'll try again.
boolean hasResponse0 = false;
if (npe_brawler_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_256");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 6);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_hasCompletedStory2 (player, npc))
{
doAnimationAction (npc, "nod");
npe_brawler_action_facePlayer (player, npc);
//-- NPC: I have just received some disturbing information from Inaldra.
string_id message = new string_id (c_stringFile, "s_247");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: This must be pretty serious.
boolean hasResponse0 = false;
if (npe_brawler_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_249");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 8);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_isTaskActiveStory2 (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: Have you spoken with Tiarsis yet? No? I think you should speak with her. Unfortunately, I'm quite busy.
string_id message = new string_id (c_stringFile, "s_236");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm on my way.
boolean hasResponse0 = false;
if (npe_brawler_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_238");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 11);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_isTaskActiveSmuggler (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: You seem excited. What is it?
string_id message = new string_id (c_stringFile, "s_334");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I found out about some possible sabotage.
boolean hasResponse0 = false;
if (npe_brawler_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_108");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 13);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_hasCompletedTaskSmugglers (player, npc))
{
doAnimationAction (npc, "bow");
npe_brawler_action_facePlayer (player, npc);
//-- NPC: You've shown bravery. I just heard about the disturbance down in the storage areas. You handled those thugs impressively.
string_id message = new string_id (c_stringFile, "s_240");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you. I knew I had to do something.
boolean hasResponse0 = false;
if (npe_brawler_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_241");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 15);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_hasCompletedStory1 (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: Go speak with Tiarsis in the Cantina. She knows all the rumors and may know some people who need help.
string_id message = new string_id (c_stringFile, "s_217");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I will, sir.
boolean hasResponse0 = false;
if (npe_brawler_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_234");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 17);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_hasCompletedTaskStory1 (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: Were you successful in your assignment, my friend? Were you able to defeat the creatures?
string_id message = new string_id (c_stringFile, "s_216");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes, I was successful.
boolean hasResponse0 = false;
if (npe_brawler_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_221");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 19);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_isTaskActiveStory1 (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: I see you have returned. A little too soon though, I must say. Reports indicate that there is still an overabundance of creatures up there. Did you vanquish all the creatures I asked you to in the Atrium?
string_id message = new string_id (c_stringFile, "s_215");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: No, not yet. But I will.
boolean hasResponse0 = false;
if (npe_brawler_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_218");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 21);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_isTaskCompleteUnarmed (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: Amazing! Your fists destroyed the droids as if they were made of cloth.
string_id message = new string_id (c_stringFile, "s_94");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I am honored by your kind words.
boolean hasResponse0 = false;
if (npe_brawler_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_160");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 23);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_isTaskCompletePolearm (player, npc))
{
doAnimationAction (npc, "nod");
npe_brawler_action_facePlayer (player, npc);
//-- NPC: Not bad at all. You are shaping up to become one magnificent warrior. The staff looked as if it were an extension of your arms.
string_id message = new string_id (c_stringFile, "s_93");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you.
boolean hasResponse0 = false;
if (npe_brawler_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_164");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 25);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_isTaskComplete2hand (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: Very impressive. You seem to have a natural fluidity with two-handed weapons.
string_id message = new string_id (c_stringFile, "s_92");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you.
boolean hasResponse0 = false;
if (npe_brawler_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_156");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 27);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_isTaskComplete1hand (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: Your skills with the one-handed weapons are improving!
string_id message = new string_id (c_stringFile, "s_91");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you, sir.
boolean hasResponse0 = false;
if (npe_brawler_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_152");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 29);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_isTaskActiveAny (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: I sense, my friend, that you haven't completed the tasks I presented you with. I expect you to continue... in due time, of course.
string_id message = new string_id (c_stringFile, "s_115");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes, sir. I will come back with them done!
boolean hasResponse0 = false;
if (npe_brawler_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_117");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 31);
npcStartConversation (player, npc, "npe_brawler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition_hasCompletedTemplate (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: Ah, yes. I heard you might be coming, %TU. I have an important assignment for you. Perhaps you might be interested?
string_id message = new string_id (c_stringFile, "s_97");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm ready, sir.
boolean hasResponse0 = false;
if (npe_brawler_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I think I would like to practice first.
boolean hasResponse1 = false;
if (!npe_brawler_condition_hasCompletedAll (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_103");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_87");
utils.setScriptVar (player, "conversation.npe_brawler.branchId", 33);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_brawler", 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 (npe_brawler_condition_cantHelp (player, npc))
{
npe_brawler_action_facePlayer (player, npc);
//-- NPC: Yes, is there something you need?
string_id message = new string_id (c_stringFile, "s_141");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_brawler_condition__defaultCondition (player, npc))
{
//-- NPC: I have nothing else to teach you.
string_id message = new string_id (c_stringFile, "s_143");
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 != "npe_brawler")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.npe_brawler.branchId");
if (branchId == 1 && npe_brawler_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && npe_brawler_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && npe_brawler_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && npe_brawler_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && npe_brawler_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && npe_brawler_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && npe_brawler_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && npe_brawler_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 15 && npe_brawler_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 17 && npe_brawler_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 19 && npe_brawler_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 21 && npe_brawler_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 23 && npe_brawler_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 25 && npe_brawler_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 27 && npe_brawler_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 29 && npe_brawler_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 31 && npe_brawler_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 33 && npe_brawler_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 34 && npe_brawler_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 36 && npe_brawler_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 37 && npe_brawler_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 39 && npe_brawler_handleBranch39 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.npe_brawler.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================