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

553 lines
18 KiB
Plaintext

// ======================================================================
//
// seans_historian.script
// Copyright 2003, Sony Online Entertainment
// All Rights Reserved.
//
// DO NOT EDIT THIS AUTO-GENERATED FILE. PLEASE USE THE CONVERATION EDITOR!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/seans_historian";
// ======================================================================
// Script Conditions
// ======================================================================
boolean seans_historian_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean seans_historian_condition_historyQuest (obj_id player, obj_id npc)
{
if ( hasObjVar( player, "bestine.hquest") )
{
if (hasObjVar(npc, "bestine.electionWinner"))
{
string winner = getStringObjVar(npc, "bestine.electionWinner");
if ( (winner == "sean") || (winner == "Sean") )
{
return true;
}
}
}
return false;
}
// ----------------------------------------------------------------------
boolean seans_historian_condition_hasFind (obj_id player, obj_id npc)
{
if ( hasObjVar( player, "bestine.find") )
{
if (hasObjVar(npc, "bestine.electionWinner"))
{
string winner = getStringObjVar(npc, "bestine.electionWinner");
if ( (winner == "sean") || (winner == "Sean") )
{
return true;
}
}
}
return false;
}
// ----------------------------------------------------------------------
boolean seans_historian_condition_hasItem (obj_id player, obj_id npc)
{
if (utils.playerHasItemByTemplate(player, "object/tangible/loot/quest/sean_history_disk.iff") )
return true;
return false;
}
// ----------------------------------------------------------------------
boolean seans_historian_condition_inoffice (obj_id player, obj_id npc)
{
if (hasObjVar(npc, "bestine.electionWinner"))
{
string winner = getStringObjVar(npc, "bestine.electionWinner");
if ( (winner == "sean") || (winner == "Sean") )
{
return true;
}
}
return false;
}
// ======================================================================
// Script Actions
// ======================================================================
void seans_historian_action__defaultAction (obj_id player, obj_id npc)
{
}
// ----------------------------------------------------------------------
void seans_historian_action_setFind (obj_id player, obj_id npc)
{
setObjVar( player, "bestine.find", true );
removeObjVar( player, "bestine.hquest");
if ( hasObjVar(player, "bestine.searched") )
removeObjVar(player, "bestine.searched");
if ( hasObjVar(player, "bestine.already_searched") )
removeObjVar(player, "bestine.already_searched");
}
// ----------------------------------------------------------------------
void seans_historian_action_ItemfoundObj (obj_id player, obj_id npc)
{
setObjVar( player, "bestine.itemfound", true);
removeObjVar( player, "bestine.find" );
if ( hasObjVar( player, "bestine.hquest" ) )
removeObjVar( player, "bestine.hquest" );
obj_id waypoint = getObjIdObjVar(player, "bestine.historianWaypoint");
if ( isIdValid(waypoint) )
destroyWaypointInDatapad(waypoint, player);
removeObjVar(player, "bestine.historianWaypoint");
}
// ----------------------------------------------------------------------
void seans_historian_action_cleanUpOldVars (obj_id player, obj_id npc)
{
if ( !utils.playerHasItemByTemplate(player, "object/tangible/loot/quest/sean_history_disk.iff") )
{
if ( hasObjVar(player, "bestine.mess") )
removeObjVar(player, "bestine.mess");
if ( hasObjVar(player, "bestine.itemfound") )
removeObjVar(player, "bestine.itemfound");
}
}
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "npc.conversation.seans_historian");
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, "npc.conversation.seans_historian");
return SCRIPT_CONTINUE;
}
// ======================================================================
// Script Triggers
// ======================================================================
trigger OnStartNpcConversation (obj_id player)
{
if (ai_lib.isInCombat (self) || ai_lib.isInCombat (player))
return SCRIPT_OVERRIDE;
//-- [NOTE]
if (seans_historian_condition_historyQuest (player, self))
{
seans_historian_action_cleanUpOldVars (player, self);
//-- NPC: Ah! You must be the new assistant. Welcome to the crash site of the Red-Sin Valon. Before you start poking around, maybe you'll want to hear a little history about the site first. It will give you a little sensitivity about an already-delicate situation.
string_id message = new string_id (c_stringFile, "s_65275fb4");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Sure. Tell me the history.
boolean hasResponse0 = false;
if (seans_historian_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_647601e7");
setObjVar (player, "conversation.seans_historian.branchId", 1);
npcStartConversation (player, self, "seans_historian", message, responses);
}
else
{
chat.chat (self, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (seans_historian_condition_hasFind (player, self))
{
//-- NPC: Did you find anything?
string_id message = new string_id (c_stringFile, "s_8d32acbf");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes, I did.
boolean hasResponse0 = false;
if (seans_historian_condition_hasItem (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No, let me keep looking.
boolean hasResponse1 = false;
if (seans_historian_condition__defaultCondition (player, self))
{
++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_b30bd73c");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_9c1a8dd7");
setObjVar (player, "conversation.seans_historian.branchId", 6);
npcStartConversation (player, self, "seans_historian", message, responses);
}
else
{
chat.chat (self, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (seans_historian_condition_inoffice (player, self))
{
seans_historian_action_cleanUpOldVars (player, self);
//-- NPC: We recently found this wreckage. It is rumored to be the Red-Sin Valon. How exciting! Sean Trenwell funds us out of his own pocket. We hope to find interesting things here. You should talk to Sean to see if he needs any help.
string_id message = new string_id (c_stringFile, "s_79636e28");
chat.chat (self, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (seans_historian_condition__defaultCondition (player, self))
{
seans_historian_action_cleanUpOldVars (player, self);
//-- NPC: We recently found this wreckage. It is rumored to be the Red-Sin Valon. How exciting! Sean Trenwell funds us out of his own pocket. We hope to find interesting things here. You should talk to Sean when he's in office.
string_id message = new string_id (c_stringFile, "s_3d3d4bab");
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 != "seans_historian")
return SCRIPT_CONTINUE;
int branchId = getIntObjVar (player, "conversation.seans_historian.branchId");
//-- [BRANCH NOTE]
//-- NPC: Ah! You must be the new assistant. Welcome to the crash site of the Red-Sin Valon. Before you start poking around, maybe you'll want to hear a little history about the site first. It will give you a little sensitivity about an already-delicate situation.
//-- [RESPONSE NOTE]
//-- PLAYER: Sure. Tell me the history.
if (branchId == 1 && response == "s_647601e7")
{
//-- [NOTE]
if (seans_historian_condition__defaultCondition (player, self))
{
//-- NPC: The Red-Sin Valon carried the first of the new settlers to Tatooine. The captain of the ship and her crew members helped found Bestine. Despite the early difficulties--a severe economic depression, lack of water and so forth--Bestine survived and became the thriving city we see today. There's so much more depth to it...
string_id message = new string_id (c_stringFile, "s_1f6355d4");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yeah?
boolean hasResponse0 = false;
if (seans_historian_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_e547fd1e");
setObjVar (player, "conversation.seans_historian.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.seans_historian.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Ah! You must be the new assistant. Welcome to the crash site of the Red-Sin Valon. Before you start poking around, maybe you'll want to hear a little history about the site first. It will give you a little sensitivity about an already-delicate situation.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: The Red-Sin Valon carried the first of the new settlers to Tatooine. The captain of the ship and her crew members helped found Bestine. Despite the early difficulties--a severe economic depression, lack of water and so forth--Bestine survived and became the thriving city we see today. There's so much more depth to it...
//-- [RESPONSE NOTE]
//-- PLAYER: Yeah?
if (branchId == 2 && response == "s_e547fd1e")
{
//-- [NOTE]
if (seans_historian_condition__defaultCondition (player, self))
{
//-- NPC: Anyway, you should check the wreckage to see what you find. If you do find anything, you can bring it to me. I'm required to screen whatever is found. We don't need to excite Sean Trenwell over nothing, you know what I mean? Go ahead and look around.
string_id message = new string_id (c_stringFile, "s_4d42d7da");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Okay.
boolean hasResponse0 = false;
if (seans_historian_condition__defaultCondition (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I've decided not to. Good bye.
boolean hasResponse1 = false;
if (seans_historian_condition__defaultCondition (player, self))
{
++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_67e6df55");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_5ec0adb6");
setObjVar (player, "conversation.seans_historian.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
removeObjVar (player, "conversation.seans_historian.branchId");
npcSpeak (player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'The Red-Sin Valon carried the first of the new settlers to Tatooine. The captain of the ship and her crew members helped found Bestine. Despite the early difficulties--a severe economic depression, lack of water and so forth--Bestine survived and became the thriving city we see today. There's so much more depth to it...' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Anyway, you should check the wreckage to see what you find. If you do find anything, you can bring it to me. I'm required to screen whatever is found. We don't need to excite Sean Trenwell over nothing, you know what I mean? Go ahead and look around.
//-- [RESPONSE NOTE]
//-- PLAYER: Okay.
if (branchId == 3 && response == "s_67e6df55")
{
//-- [NOTE]
if (seans_historian_condition__defaultCondition (player, self))
{
seans_historian_action_setFind (player, self);
//-- NPC: And be careful!
string_id message = new string_id (c_stringFile, "s_2fceb7e3");
removeObjVar (player, "conversation.seans_historian.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Anyway, you should check the wreckage to see what you find. If you do find anything, you can bring it to me. I'm required to screen whatever is found. We don't need to excite Sean Trenwell over nothing, you know what I mean? Go ahead and look around.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Anyway, you should check the wreckage to see what you find. If you do find anything, you can bring it to me. I'm required to screen whatever is found. We don't need to excite Sean Trenwell over nothing, you know what I mean? Go ahead and look around.
//-- [RESPONSE NOTE]
//-- PLAYER: I've decided not to. Good bye.
if (branchId == 3 && response == "s_5ec0adb6")
{
//-- [NOTE]
if (seans_historian_condition__defaultCondition (player, self))
{
//-- NPC: That's a shame. I'll inform Sean about it, then.
string_id message = new string_id (c_stringFile, "s_fcdb7174");
removeObjVar (player, "conversation.seans_historian.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Anyway, you should check the wreckage to see what you find. If you do find anything, you can bring it to me. I'm required to screen whatever is found. We don't need to excite Sean Trenwell over nothing, you know what I mean? Go ahead and look around.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Did you find anything?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, I did.
if (branchId == 6 && response == "s_b30bd73c")
{
//-- [NOTE]
if (seans_historian_condition__defaultCondition (player, self))
{
seans_historian_action_ItemfoundObj (player, self);
//-- NPC: Well done! What an interesting piece of history. You'd think it would have been destroyed in these dreadful sand storms. Guess not! Take it to Sean. He'll be excited.
string_id message = new string_id (c_stringFile, "s_27540308");
removeObjVar (player, "conversation.seans_historian.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Did you find anything?' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Did you find anything?
//-- [RESPONSE NOTE]
//-- PLAYER: No, let me keep looking.
if (branchId == 6 && response == "s_9c1a8dd7")
{
//-- [NOTE]
if (seans_historian_condition__defaultCondition (player, self))
{
//-- NPC: Okay. Be sure to show it to me if you do.
string_id message = new string_id (c_stringFile, "s_ed53cd9c");
removeObjVar (player, "conversation.seans_historian.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Did you find anything?' were false.");
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
removeObjVar (player, "conversation.seans_historian.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================