mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-18 09:02:56 -04:00
468 lines
15 KiB
Plaintext
468 lines
15 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// bestine_artist06.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_artist06";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean bestine_artist06_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean bestine_artist06_condition_hasFeaturedArt (obj_id player, obj_id npc)
|
|
{
|
|
if ( hasObjVar(npc, "bestine.museumEventWinner") )
|
|
{
|
|
string winner = getStringObjVar(npc, "bestine.museumEventWinner");
|
|
if ( winner.equals("bestine_artist06") )
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean bestine_artist06_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_artist06") )
|
|
return true;
|
|
|
|
if ( entry02.equals("bestine_artist06") )
|
|
return true;
|
|
|
|
if ( entry03.equals("bestine_artist06") )
|
|
return true;
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean bestine_artist06_condition_hasFeaturedArt_EventActive (obj_id player, obj_id npc)
|
|
{
|
|
return ( (bestine_artist06_condition_isActiveInEvent(player, npc)) && (bestine_artist06_condition_hasFeaturedArt(player, npc)) );
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean bestine_artist06_condition_hasSpokenTo (obj_id player, obj_id npc)
|
|
{
|
|
if (hasObjVar(npc, "bestine.museumEventStarted"))
|
|
{
|
|
if ( hasObjVar(player, "bestine.spokeToArtist06") )
|
|
{
|
|
int eventNum = getIntObjVar(npc, "bestine.museumEventStarted");
|
|
int playerEventNum = getIntObjVar(player, "bestine.spokeToArtist06");
|
|
if ( playerEventNum >= eventNum )
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean bestine_artist06_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_artist06_action__defaultAction (obj_id player, obj_id npc)
|
|
{
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void bestine_artist06_action_setHasSpokenTo (obj_id player, obj_id npc)
|
|
{
|
|
if (hasObjVar(npc, "bestine.museumEventStarted"))
|
|
{
|
|
int currentEventNum = getIntObjVar(npc, "bestine.museumEventStarted");
|
|
setObjVar(player, "bestine.spokeToArtist06", currentEventNum);
|
|
|
|
if ( hasObjVar(player, "museumEventPlayer") )
|
|
removeObjVar(player, "museumEventPlayer");
|
|
}
|
|
return;
|
|
}
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "npc.conversation.bestine_artist06");
|
|
|
|
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_artist06");
|
|
|
|
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_artist06_condition_hasFeaturedArt_EventActive (player, self))
|
|
{
|
|
//-- NPC: If you wish to have your eyes opened with new visions of the world around you, then your first step should be to go to the Bestine Museum and see my painting on display there.
|
|
string_id message = new string_id (c_stringFile, "s_21352168");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes, and the Bestine Museum is also looking for another work of art to feature.
|
|
boolean hasResponse0 = false;
|
|
if (!bestine_artist06_condition_hasAlreadyVoted (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: My eyes are open. I see you for what you are.
|
|
boolean hasResponse1 = false;
|
|
if (bestine_artist06_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_a13d05db");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_1433b9d4");
|
|
|
|
setObjVar (player, "conversation.bestine_artist06.branchId", 1);
|
|
|
|
npcStartConversation (player, self, "bestine_artist06", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (self, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (bestine_artist06_condition_isActiveInEvent (player, self))
|
|
{
|
|
//-- NPC: Expand you mind, my friend. There's more to see than what your eyes tell you.
|
|
string_id message = new string_id (c_stringFile, "s_8a659170");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Er... okay. Anyway, the Bestine Museum is looking for a work of art to exhibit.
|
|
boolean hasResponse0 = false;
|
|
if (!bestine_artist06_condition_hasAlreadyVoted (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I expanded my mind once... was really hung over the next day.
|
|
boolean hasResponse1 = false;
|
|
if (bestine_artist06_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_32722caf");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_3a301702");
|
|
|
|
setObjVar (player, "conversation.bestine_artist06.branchId", 5);
|
|
|
|
npcStartConversation (player, self, "bestine_artist06", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (self, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (bestine_artist06_condition_hasFeaturedArt (player, self))
|
|
{
|
|
//-- NPC: Open your eyes! New visions of the world are all around you. If nothing else, you should be to go to the Bestine Museum and see my painting on display there.
|
|
string_id message = new string_id (c_stringFile, "s_bf3a373");
|
|
chat.chat (self, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (bestine_artist06_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Don't close yourself off... there's more to see than what your eyes tell you.
|
|
string_id message = new string_id (c_stringFile, "s_54e93392");
|
|
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_artist06")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
int branchId = getIntObjVar (player, "conversation.bestine_artist06.branchId");
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: If you wish to have your eyes opened with new visions of the world around you, then your first step should be to go to the Bestine Museum and see my painting on display there.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes, and the Bestine Museum is also looking for another work of art to feature.
|
|
if (branchId == 1 && response == "s_a13d05db")
|
|
{
|
|
//-- [NOTE]
|
|
if (!bestine_artist06_condition_hasSpokenTo (player, self))
|
|
{
|
|
bestine_artist06_action_setHasSpokenTo (player, self);
|
|
|
|
//-- NPC: And naturally they desire another of mine.
|
|
string_id message = new string_id (c_stringFile, "s_23697fe2");
|
|
removeObjVar (player, "conversation.bestine_artist06.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (bestine_artist06_condition_hasSpokenTo (player, self))
|
|
{
|
|
//-- NPC: Forgotten me already? You were just here. Truly, you move through the world with your mind closed.
|
|
string_id message = new string_id (c_stringFile, "s_66605741");
|
|
removeObjVar (player, "conversation.bestine_artist06.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'If you wish to have your eyes opened with new visions of the world around you, then your first step should be to go to the Bestine Museum and see my painting on display there.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: If you wish to have your eyes opened with new visions of the world around you, then your first step should be to go to the Bestine Museum and see my painting on display there.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: My eyes are open. I see you for what you are.
|
|
if (branchId == 1 && response == "s_1433b9d4")
|
|
{
|
|
//-- [NOTE]
|
|
if (bestine_artist06_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: And that's as a painter, I surely hope. But it's a good start... that is, if you're truly looking and not just humoring me.
|
|
string_id message = new string_id (c_stringFile, "s_30df2fe8");
|
|
removeObjVar (player, "conversation.bestine_artist06.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'If you wish to have your eyes opened with new visions of the world around you, then your first step should be to go to the Bestine Museum and see my painting on display there.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Expand you mind, my friend. There's more to see than what your eyes tell you.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Er... okay. Anyway, the Bestine Museum is looking for a work of art to exhibit.
|
|
if (branchId == 5 && response == "s_32722caf")
|
|
{
|
|
//-- [NOTE]
|
|
if (!bestine_artist06_condition_hasSpokenTo (player, self))
|
|
{
|
|
bestine_artist06_action_setHasSpokenTo (player, self);
|
|
|
|
//-- NPC: And they are considering mine? Glorious!
|
|
string_id message = new string_id (c_stringFile, "s_29026317");
|
|
removeObjVar (player, "conversation.bestine_artist06.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (bestine_artist06_condition_hasSpokenTo (player, self))
|
|
{
|
|
//-- NPC: Right... we've already gone over this as you would know if you weren't so closed off.
|
|
string_id message = new string_id (c_stringFile, "s_582eefe3");
|
|
removeObjVar (player, "conversation.bestine_artist06.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Expand you mind, my friend. There's more to see than what your eyes tell you.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Expand you mind, my friend. There's more to see than what your eyes tell you.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I expanded my mind once... was really hung over the next day.
|
|
if (branchId == 5 && response == "s_3a301702")
|
|
{
|
|
//-- [NOTE]
|
|
if (bestine_artist06_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Arrgh... not with Corellian ale or spice! Open yourself to news ways of experiencing the galaxy. Don't just blindly follow your feet. Truly see to truly know.
|
|
string_id message = new string_id (c_stringFile, "s_7154d52c");
|
|
removeObjVar (player, "conversation.bestine_artist06.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Expand you mind, my friend. There's more to see than what your eyes tell you.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
removeObjVar (player, "conversation.bestine_artist06.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|