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

468 lines
14 KiB
Plaintext

// ======================================================================
//
// bestine_artist04.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;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/bestine_artist04";
// ======================================================================
// Script Conditions
// ======================================================================
boolean bestine_artist04_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean bestine_artist04_condition_hasFeaturedArt (obj_id player, obj_id npc)
{
if ( hasObjVar(npc, "bestine.museumEventWinner") )
{
string winner = getStringObjVar(npc, "bestine.museumEventWinner");
if ( winner.equals("bestine_artist04") )
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean bestine_artist04_condition_isActiveInEvent (obj_id player, obj_id npc)
{
if (hasObjVar(npc, "bestine.museumEventStarted"))
{
int eventNum = getIntObjVar(npc, "bestine.museumEventStarted");
if ( hasObjVar(player, "bestine.museumEventPlayer") )
{
int playerEventNum = getIntObjVar(player, "bestine.museumEventPlayer");
if ( playerEventNum >= eventNum )
{
string entry01 = "";
string entry02 = "";
string entry03 = "";
if( hasObjVar(npc, "bestine.museumEventEntry01") )
entry01 = getStringObjVar(npc, "bestine.museumEventEntry01");
if( hasObjVar(npc, "bestine.museumEventEntry02") )
entry02 = getStringObjVar(npc, "bestine.museumEventEntry02");
if( hasObjVar(npc, "bestine.museumEventEntry03") )
entry03 = getStringObjVar(npc, "bestine.museumEventEntry03");
if ( entry01.equals("bestine_artist04") )
return true;
if ( entry02.equals("bestine_artist04") )
return true;
if ( entry03.equals("bestine_artist04") )
return true;
}
}
}
return false;
}
// ----------------------------------------------------------------------
boolean bestine_artist04_condition_hasFeaturedArt_EventActive (obj_id player, obj_id npc)
{
return ( (bestine_artist04_condition_isActiveInEvent(player, npc)) && (bestine_artist04_condition_hasFeaturedArt(player, npc)) );
}
// ----------------------------------------------------------------------
boolean bestine_artist04_condition_hasSpokenTo (obj_id player, obj_id npc)
{
if ( hasObjVar(npc, "bestine.museumEventStarted") )
{
if ( hasObjVar(player, "bestine.spokeToArtist04") )
{
int eventNum = getIntObjVar(npc, "bestine.museumEventStarted");
int playerEventNum = getIntObjVar(player, "bestine.spokeToArtist04");
if ( playerEventNum >= eventNum )
return true;
}
}
return false;
}
// ----------------------------------------------------------------------
boolean bestine_artist04_condition_hasAlreadyVoted (obj_id player, obj_id npc)
{
if ( hasObjVar(npc, "bestine.museumEventStarted") )
{
if ( hasObjVar(player, "bestine.museumEventPlayerVoted") )
{
int eventNum = getIntObjVar(npc, "bestine.museumEventStarted");
int playerEventNum = getIntObjVar(player, "bestine.museumEventPlayerVoted");
if ( playerEventNum >= eventNum )
return true;
}
}
return false;
}
// ======================================================================
// Script Actions
// ======================================================================
void bestine_artist04_action__defaultAction (obj_id player, obj_id npc)
{
}
// ----------------------------------------------------------------------
void bestine_artist04_action_setHasSpokenTo (obj_id player, obj_id npc)
{
if ( hasObjVar(npc, "bestine.museumEventStarted") )
{
int currentEventNum = getIntObjVar(npc, "bestine.museumEventStarted");
setObjVar(player, "bestine.spokeToArtist04", currentEventNum);
if ( hasObjVar(player, "museumEventPlayer") )
removeObjVar(player, "museumEventPlayer");
}
return;
}
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "npc.conversation.bestine_artist04");
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.bestine_artist04");
return SCRIPT_CONTINUE;
}
// ======================================================================
// Script Triggers
// ======================================================================
trigger OnStartNpcConversation (obj_id player)
{
if (ai_lib.isInCombat (self) || ai_lib.isInCombat (player))
return SCRIPT_OVERRIDE;
//-- [NOTE]
if (bestine_artist04_condition_hasFeaturedArt_EventActive (player, self))
{
//-- NPC: Kahfr is a great artist! Kahfr's artwork graces the walls of the Museum in Bestine. You must experience Kahfr's painting.
string_id message = new string_id (c_stringFile, "s_8d0668a2");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: The Bestine Museum is looking for another work of art to feature. Perhaps yours again?
boolean hasResponse0 = false;
if (!bestine_artist04_condition_hasAlreadyVoted (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: You speak really well too.
boolean hasResponse1 = false;
if (bestine_artist04_condition_hasAlreadyVoted (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_8bc4905a");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_6589745");
setObjVar (player, "conversation.bestine_artist04.branchId", 1);
npcStartConversation (player, self, "bestine_artist04", message, responses);
}
else
{
chat.chat (self, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (bestine_artist04_condition_isActiveInEvent (player, self))
{
//-- NPC: Why do you bother Kahfr? Kahfr is a great artist and is very busy.
string_id message = new string_id (c_stringFile, "s_71aaaca6");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Then listen to what I have to say. The Bestine Museum is looking for art to exhibit.
boolean hasResponse0 = false;
if (!bestine_artist04_condition_hasAlreadyVoted (player, self))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Oh, well... if you're busy, I'll leave you alone.
boolean hasResponse1 = false;
if (bestine_artist04_condition_hasAlreadyVoted (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_28823813");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_3b52499e");
setObjVar (player, "conversation.bestine_artist04.branchId", 5);
npcStartConversation (player, self, "bestine_artist04", message, responses);
}
else
{
chat.chat (self, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (bestine_artist04_condition_hasFeaturedArt (player, self))
{
//-- NPC: You must experience Kahfr's painting. Kahfr's artwork graces the walls of the Museum in Bestine. Kahfr is a great artist!
string_id message = new string_id (c_stringFile, "s_17cd5bb6");
chat.chat (self, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (bestine_artist04_condition__defaultCondition (player, self))
{
//-- NPC: Do not bother Kahfr? Kahfr is a great artist and is very busy. You must go now.
string_id message = new string_id (c_stringFile, "s_d4ede5f2");
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 != "bestine_artist04")
return SCRIPT_CONTINUE;
int branchId = getIntObjVar (player, "conversation.bestine_artist04.branchId");
//-- [BRANCH NOTE]
//-- NPC: Kahfr is a great artist! Kahfr's artwork graces the walls of the Museum in Bestine. You must experience Kahfr's painting.
//-- [RESPONSE NOTE]
//-- PLAYER: The Bestine Museum is looking for another work of art to feature. Perhaps yours again?
if (branchId == 1 && response == "s_8bc4905a")
{
//-- [NOTE]
if (!bestine_artist04_condition_hasSpokenTo (player, self))
{
bestine_artist04_action_setHasSpokenTo (player, self);
//-- NPC: Kahfr is again interested. Kahfr would rather such an honor not pass her by.
string_id message = new string_id (c_stringFile, "s_df8872ca");
removeObjVar (player, "conversation.bestine_artist04.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (bestine_artist04_condition_hasSpokenTo (player, self))
{
//-- NPC: Kahfr thinks you've asked that before. But Kahfr does not mind.
string_id message = new string_id (c_stringFile, "s_bf1648b1");
removeObjVar (player, "conversation.bestine_artist04.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Kahfr is a great artist! Kahfr's artwork graces the walls of the Museum in Bestine. You must experience Kahfr's painting.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Kahfr is a great artist! Kahfr's artwork graces the walls of the Museum in Bestine. You must experience Kahfr's painting.
//-- [RESPONSE NOTE]
//-- PLAYER: You speak really well too.
if (branchId == 1 && response == "s_6589745")
{
//-- [NOTE]
if (bestine_artist04_condition__defaultCondition (player, self))
{
//-- NPC: Kahfr does not understand why you are saying that. Kahfr thinks perhaps you've been wandering the Dune Sea for too long.
string_id message = new string_id (c_stringFile, "s_179635e7");
removeObjVar (player, "conversation.bestine_artist04.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Kahfr is a great artist! Kahfr's artwork graces the walls of the Museum in Bestine. You must experience Kahfr's painting.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Why do you bother Kahfr? Kahfr is a great artist and is very busy.
//-- [RESPONSE NOTE]
//-- PLAYER: Then listen to what I have to say. The Bestine Museum is looking for art to exhibit.
if (branchId == 5 && response == "s_28823813")
{
//-- [NOTE]
if (!bestine_artist04_condition_hasSpokenTo (player, self))
{
bestine_artist04_action_setHasSpokenTo (player, self);
//-- NPC: Kahfr is interested. Kahfr has long expected such an honor as is her due.
string_id message = new string_id (c_stringFile, "s_cf179f96");
removeObjVar (player, "conversation.bestine_artist04.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (bestine_artist04_condition_hasSpokenTo (player, self))
{
//-- NPC: You ask Kahfr again? Always Kahfr must repeat herself.
string_id message = new string_id (c_stringFile, "s_40f271aa");
removeObjVar (player, "conversation.bestine_artist04.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Why do you bother Kahfr? Kahfr is a great artist and is very busy.' were false.");
return SCRIPT_CONTINUE;
}
//-- [BRANCH NOTE]
//-- NPC: Why do you bother Kahfr? Kahfr is a great artist and is very busy.
//-- [RESPONSE NOTE]
//-- PLAYER: Oh, well... if you're busy, I'll leave you alone.
if (branchId == 5 && response == "s_3b52499e")
{
//-- [NOTE]
if (bestine_artist04_condition__defaultCondition (player, self))
{
//-- NPC: Kahfr is impressed by your understanding. Kahfr thanks you and bids you farewell. Though Kahfr wonders if this is sarcasm...
string_id message = new string_id (c_stringFile, "s_7766385");
removeObjVar (player, "conversation.bestine_artist04.branchId");
npcSpeak (player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Why do you bother Kahfr? Kahfr is a great artist and is very busy.' were false.");
return SCRIPT_CONTINUE;
}
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
removeObjVar (player, "conversation.bestine_artist04.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================