mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
1133 lines
33 KiB
Plaintext
1133 lines
33 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// lifeday04c.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// Created with SwgConversationEditor 1.28 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.factions;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/lifeday04c";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean lifeday04c_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean lifeday04c_condition_notSpokeWithElder (obj_id player, obj_id npc)
|
|
{
|
|
int convTracker = getIntObjVar(player, "lifeday04.convTracker");
|
|
|
|
if(convTracker < 1)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean lifeday04c_condition_isanImp (obj_id player, obj_id npc)
|
|
{
|
|
string pvpFaction = factions.getFaction(player);
|
|
|
|
return pvpFaction.equals("Imperial");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean lifeday04c_condition_noFaction (obj_id player, obj_id npc)
|
|
{
|
|
string pvpFaction = factions.getFaction(player);
|
|
|
|
if(pvpFaction == null)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean lifeday04c_condition_hasBeenReward (obj_id player, obj_id npc)
|
|
{
|
|
if(hasObjVar(player, "lifeday04.rewarded"))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void lifeday04c_action_setTalkedToYou (obj_id player, obj_id npc)
|
|
{
|
|
// I'm NPC flag 2
|
|
int convTracker = getIntObjVar(player, "lifeday04.convTracker");
|
|
|
|
if(convTracker != 3 && convTracker != 7 && convTracker != 11 && convTracker != 15 && !hasObjVar(player, "lifeday04.rewarded"))
|
|
{
|
|
convTracker += 2;
|
|
setObjVar(player, "lifeday04.convTracker", convTracker);
|
|
}
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int lifeday04c_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) I enjoyed our conversation earlier! Would you like to hear about the Renewal of Life again?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes, please tell me again.
|
|
if (response == "s_7a600ade")
|
|
{
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "explain");
|
|
|
|
//-- NPC: (Translated from Shyriiwook) Renewal of Life. This is one of the goals of Life Day. Because of how the Empire has treated so many of our kind, this aspect of Life Day has taken on even greater meaning.
|
|
string_id message = new string_id (c_stringFile, "s_f25a4a72");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What has the Empire done to Wookiees?
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_8e0ee46c");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No thank you.
|
|
if (response == "s_554c5307")
|
|
{
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod_head_once");
|
|
|
|
//-- NPC: (Translated from Shyriiwook) Well it's a pleasure to see you again. Happy Life Day!
|
|
string_id message = new string_id (c_stringFile, "s_1256a081");
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) Renewal of Life. This is one of the goals of Life Day. Because of how the Empire has treated so many of our kind, this aspect of Life Day has taken on even greater meaning.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What has the Empire done to Wookiees?
|
|
if (response == "s_8e0ee46c")
|
|
{
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: (Translated from Shyriiwook) Life on our homeworld was simple and peaceful. We did not make war, nor were we a violent race. This made us easy targets for the Empire who desired our strength. Many were forced into labor camps. Some Wookiees were even forced to help build the Death Star.
|
|
string_id message = new string_id (c_stringFile, "s_efa923bc");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I see. Go on.
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_959f717");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) Life on our homeworld was simple and peaceful. We did not make war, nor were we a violent race. This made us easy targets for the Empire who desired our strength. Many were forced into labor camps. Some Wookiees were even forced to help build the Death Star.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I see. Go on.
|
|
if (response == "s_959f717")
|
|
{
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: (Translated from Shyriiwook) Because of the Empire, we have learned to appreciate our freedom. We cannot take our lives for granted. Each sunrise, each childbirth, each breath is a renewal, a reminder that we must live each day to the fullest.
|
|
string_id message = new string_id (c_stringFile, "s_f34ce8c");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes. Go on.
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_b8b7ef2b");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) Because of the Empire, we have learned to appreciate our freedom. We cannot take our lives for granted. Each sunrise, each childbirth, each breath is a renewal, a reminder that we must live each day to the fullest.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes. Go on.
|
|
if (response == "s_b8b7ef2b")
|
|
{
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition_noFaction (player, npc))
|
|
{
|
|
//-- NPC: (Translated from Shyriiwook) I hope you will take our tale and share it with others so that others may learn how to live each day to the fullest...and to not take their own freedom for granted.
|
|
string_id message = new string_id (c_stringFile, "s_cf3aa2f6");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will do that.
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_9103b44a");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition_isanImp (player, npc))
|
|
{
|
|
doAnimationAction (npc, "shake_head_no");
|
|
|
|
//-- NPC: (Translated from Shyriiwook) I've heard you work for the Empire. If that's true, you should reconsider your allegiances. You may be good but the higher up you go, the darker the world becomes.
|
|
string_id message = new string_id (c_stringFile, "s_801a269f");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll consider your words.
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_bd5e746e");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: (Translated from Shyriiwook) Take our tale and share it with others so that others may learn how to live each day to the fullest...and to not take their own freedom for granted.
|
|
string_id message = new string_id (c_stringFile, "s_80535e5b");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will do that.
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_9103b44a");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) I hope you will take our tale and share it with others so that others may learn how to live each day to the fullest...and to not take their own freedom for granted.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will do that.
|
|
if (response == "s_9103b44a")
|
|
{
|
|
lifeday04c_action_setTalkedToYou (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "curtsey1");
|
|
|
|
//-- NPC: (Translated from Shyriiwook) Thank you. Remember to celebrate your life and the lives of those around you. Happy Life Day.
|
|
string_id message = new string_id (c_stringFile, "s_d7baeead");
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) I've heard you work for the Empire. If that's true, you should reconsider your allegiances. You may be good but the higher up you go, the darker the world becomes.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll consider your words.
|
|
if (response == "s_bd5e746e")
|
|
{
|
|
lifeday04c_action_setTalkedToYou (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: (Translated from Shyriiwook) I hope you will. Regardless, remember to be thankful for life and all that comes with it. Happy Life Day to you.
|
|
string_id message = new string_id (c_stringFile, "s_4f6d5fb7");
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) Take our tale and share it with others so that others may learn how to live each day to the fullest...and to not take their own freedom for granted.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will do that.
|
|
if (response == "s_9103b44a")
|
|
{
|
|
lifeday04c_action_setTalkedToYou (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "curtsey1");
|
|
|
|
//-- NPC: (Translated from Shyriiwook) Thank you. Remember to celebrate your life and the lives of those around you. Happy Life Day.
|
|
string_id message = new string_id (c_stringFile, "s_d7baeead");
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch13 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) Renewal of Life. This is one of the goals of Life Day. Because of how the Empire has treated so many of our kind, this aspect of Life Day has taken on even greater meaning.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What has the Empire done to Wookiees?
|
|
if (response == "s_8e0ee46c")
|
|
{
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: (Translated from Shyriiwook) Life on our homeworld was simple and peaceful. We did not make war, nor were we a violent race. This made us easy targets for the Empire who desired our strength. Many were forced into labor camps. Some Wookiees were even forced to help build the Death Star.
|
|
string_id message = new string_id (c_stringFile, "s_efa923bc");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I see. Go on.
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_959f717");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 14);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch14 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) Life on our homeworld was simple and peaceful. We did not make war, nor were we a violent race. This made us easy targets for the Empire who desired our strength. Many were forced into labor camps. Some Wookiees were even forced to help build the Death Star.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I see. Go on.
|
|
if (response == "s_959f717")
|
|
{
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: (Translated from Shyriiwook) Because of the Empire, we have learned to appreciate our freedom. We cannot take our lives for granted. Each sunrise, each childbirth, each breath is a renewal, a reminder that we must live each day to the fullest.
|
|
string_id message = new string_id (c_stringFile, "s_f34ce8c");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes. Go on.
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_b8b7ef2b");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 15);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch15 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) Because of the Empire, we have learned to appreciate our freedom. We cannot take our lives for granted. Each sunrise, each childbirth, each breath is a renewal, a reminder that we must live each day to the fullest.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes. Go on.
|
|
if (response == "s_b8b7ef2b")
|
|
{
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition_noFaction (player, npc))
|
|
{
|
|
//-- NPC: (Translated from Shyriiwook) I hope you will take our tale and share it with others so that others may learn how to live each day to the fullest and to not take their own freedom for granted.
|
|
string_id message = new string_id (c_stringFile, "s_a83b3c72");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will do that.
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_9103b44a");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 16);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition_isanImp (player, npc))
|
|
{
|
|
doAnimationAction (npc, "shake_head_no");
|
|
|
|
//-- NPC: (Translated from Shyriiwook) I've heard you work for the Empire. If that's true, you should reconsider your allegiances. You may be good but the higher up you go, the darker the world becomes.
|
|
string_id message = new string_id (c_stringFile, "s_801a269f");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll consider your words.
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_bd5e746e");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 18);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: (Translated from Shyriiwook) Take our tale and share it with others so that others may learn how to live each day to the fullest.
|
|
string_id message = new string_id (c_stringFile, "s_5d954138");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will do that.
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_9103b44a");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 20);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch16 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) I hope you will take our tale and share it with others so that others may learn how to live each day to the fullest and to not take their own freedom for granted.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will do that.
|
|
if (response == "s_9103b44a")
|
|
{
|
|
lifeday04c_action_setTalkedToYou (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "curtsey1");
|
|
|
|
//-- NPC: (Translated from Shyriiwook) Thank you. Remember to celebrate your life and the lives of those around you. Happy Life Day.
|
|
string_id message = new string_id (c_stringFile, "s_d7baeead");
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch18 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) I've heard you work for the Empire. If that's true, you should reconsider your allegiances. You may be good but the higher up you go, the darker the world becomes.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll consider your words.
|
|
if (response == "s_bd5e746e")
|
|
{
|
|
lifeday04c_action_setTalkedToYou (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: (Translated from Shyriiwook) I hope you will. Regardless, remember to be thankful for life and all that comes with it. Happy Life Day to you.
|
|
string_id message = new string_id (c_stringFile, "s_4f6d5fb7");
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int lifeday04c_handleBranch20 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: (Translated from Shyriiwook) Take our tale and share it with others so that others may learn how to live each day to the fullest.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will do that.
|
|
if (response == "s_9103b44a")
|
|
{
|
|
lifeday04c_action_setTalkedToYou (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "curtsey1");
|
|
|
|
//-- NPC: (Translated from Shyriiwook) Thank you. Remember to celebrate your life and the lives of those around you. Happy Life Day.
|
|
string_id message = new string_id (c_stringFile, "s_d7baeead");
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.lifeday04c");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo)
|
|
{
|
|
int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null);
|
|
menu_info_data menuInfoData = menuInfo.getMenuItemById (menu);
|
|
menuInfoData.setServerNotify (false);
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnIncapacitated (obj_id killer)
|
|
{
|
|
clearCondition (self, CONDITION_CONVERSABLE);
|
|
detachScript (self, "conversation.lifeday04c");
|
|
|
|
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 (lifeday04c_condition_hasBeenReward (player, npc))
|
|
{
|
|
doAnimationAction (npc, "applause_excited");
|
|
|
|
//-- NPC: (Translated from Shyriiwook) I enjoyed our conversation earlier! Would you like to hear about the Renewal of Life again?
|
|
string_id message = new string_id (c_stringFile, "s_a60b4b13");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes, please tell me again.
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thank you.
|
|
boolean hasResponse1 = false;
|
|
if (lifeday04c_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_7a600ade");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_554c5307");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "lifeday04c", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition_notSpokeWithElder (player, npc))
|
|
{
|
|
doAnimationAction (npc, "laugh_titter");
|
|
|
|
//-- NPC: (Translated from Shyriiwook) You should speak to our Elder first. Happy Life Day to you.
|
|
string_id message = new string_id (c_stringFile, "s_98c49a08");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (lifeday04c_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "explain");
|
|
|
|
//-- NPC: (Translated from Shyriiwook) Renewal of Life. This is one of the goals of Life Day. Because of how the Empire has treated so many of our kind, this aspect of Life Day has taken on even greater meaning.
|
|
string_id message = new string_id (c_stringFile, "s_f25a4a72");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What has the Empire done to Wookiees?
|
|
boolean hasResponse0 = false;
|
|
if (lifeday04c_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_8e0ee46c");
|
|
|
|
utils.setScriptVar (player, "conversation.lifeday04c.branchId", 13);
|
|
|
|
npcStartConversation (player, npc, "lifeday04c", 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 != "lifeday04c")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
if (branchId == 1 && lifeday04c_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && lifeday04c_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && lifeday04c_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && lifeday04c_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && lifeday04c_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && lifeday04c_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && lifeday04c_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 13 && lifeday04c_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 14 && lifeday04c_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 15 && lifeday04c_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 16 && lifeday04c_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 18 && lifeday04c_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 20 && lifeday04c_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.lifeday04c.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|