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

232 lines
6.9 KiB
Plaintext

// ======================================================================
//
// fs_woman.script
//
//
//
// DO NOT EDIT THIS AUTO-GENERATED FILE. PLEASE USE THE CONVERATION EDITOR!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.fs_quests;
include library.quests;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/fs_woman";
// ======================================================================
// Script Conditions
// ======================================================================
boolean fs_woman_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean fs_woman_condition_questOwner (obj_id player, obj_id npc)
{
obj_id owner = null;
owner = getObjIdObjVar(npc, "fs_dath_woman.holder");
if (player == owner)
{
return true;
}
return false;
}
// ======================================================================
// Script Actions
// ======================================================================
void fs_woman_action_completeQuest (obj_id player, obj_id npc)
{
if (!quests.isActive("fs_village_elder", player))
{
fs_quests.setStage(player, 10);
quests.activate("fs_village_elder", player, null);
messageTo( npc, "cleanUp", null, 180, false );
}
return;
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "npc.conversation.fs_woman");
setCondition (self, CONDITION_CONVERSABLE);
obj_id owner = getObjIdObjVar(self, "quest.owner");
setObjVar(self, "quest.fs_dath_woman_talk.target", owner);
quests.activate("fs_dath_woman_talk", owner, null);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
return SCRIPT_CONTINUE;
}
trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo)
{
int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null);
menu_info_data menuInfoData = menuInfo.getMenuItemById (menu);
menuInfoData.setServerNotify (false);
setCondition (self, CONDITION_CONVERSABLE);
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "npc.conversation.fs_woman");
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)
{
if (ai_lib.isInCombat (self) || ai_lib.isInCombat (player))
return SCRIPT_OVERRIDE;
//-- [NOTE]
if (fs_woman_condition_questOwner (player, self))
{
fs_woman_action_completeQuest (player, self);
//-- NPC: Hello, welcome to Dathomir. I was told you would be looking for me. Have you spoken to the village elder yet?
string_id message = new string_id (c_stringFile, "s_b46f1e5e");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Village elder? Please tell me more.
boolean hasResponse0 = false;
if (fs_woman_condition__defaultCondition (player, self))
{
++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_827a56fe");
setObjVar (player, "conversation.fs_woman.branchId", 1);
npcStartConversation (player, self, "fs_woman", message, responses);
}
else
{
chat.chat (self, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (!fs_woman_condition_questOwner (player, self))
{
//-- NPC: We have nothing to discuss.
string_id message = new string_id (c_stringFile, "s_e87eb378");
chat.chat (self, message);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnStartNpcConversation were false.");
return SCRIPT_CONTINUE;
}
// ----------------------------------------------------------------------
trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response)
{
if (conversationId != "fs_woman")
return SCRIPT_CONTINUE;
int branchId = getIntObjVar (player, "conversation.fs_woman.branchId");
//-- [BRANCH NOTE]
//-- NPC: Hello, welcome to Dathomir. I was told you would be looking for me. Have you spoken to the village elder yet?
//-- [RESPONSE NOTE]
//-- PLAYER: Village elder? Please tell me more.
if (branchId == 1 && response == "s_827a56fe")
{
//-- [NOTE]
if (fs_woman_condition__defaultCondition (player, self))
{
//-- NPC: There is a village to the southeast that needs some help. I do not have all the details. I am sure if you talk to the village elder, all of your questions will be answered. I must go. Good luck to you.
string_id message = new string_id (c_stringFile, "s_c76aeb53");
removeObjVar (player, "conversation.fs_woman.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Hello, welcome to Dathomir. I was told you would be looking for me. Have you spoken to the village elder yet?' were false.");
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
removeObjVar (player, "conversation.fs_woman.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================