mirror of
https://bitbucket.org/seefoe/dsrc.git
synced 2026-09-12 22:45:32 -04:00
468 lines
15 KiB
Plaintext
468 lines
15 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// bestine_artist03.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_artist03";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean bestine_artist03_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean bestine_artist03_condition_hasFeaturedArt (obj_id player, obj_id npc)
|
|
{
|
|
if ( hasObjVar(npc, "bestine.museumEventWinner") )
|
|
{
|
|
string winner = getStringObjVar(npc, "bestine.museumEventWinner");
|
|
if ( winner.equals("bestine_artist03") )
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean bestine_artist03_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_artist03") )
|
|
return true;
|
|
|
|
if ( entry02.equals("bestine_artist03") )
|
|
return true;
|
|
|
|
if ( entry03.equals("bestine_artist03") )
|
|
return true;
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean bestine_artist03_condition_hasFeaturedArt_EventActive (obj_id player, obj_id npc)
|
|
{
|
|
return ( (bestine_artist03_condition_isActiveInEvent(player, npc)) && (bestine_artist03_condition_hasFeaturedArt(player, npc)) );
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean bestine_artist03_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;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean bestine_artist03_condition_hasSpokenTo (obj_id player, obj_id npc)
|
|
{
|
|
if ( hasObjVar(npc, "bestine.museumEventStarted") )
|
|
{
|
|
if ( hasObjVar(player, "bestine.spokeToArtist03") )
|
|
{
|
|
int eventNum = getIntObjVar(npc, "bestine.museumEventStarted");
|
|
int playerEventNum = getIntObjVar(player, "bestine.spokeToArtist03");
|
|
if ( playerEventNum >= eventNum )
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void bestine_artist03_action__defaultAction (obj_id player, obj_id npc)
|
|
{
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void bestine_artist03_action_setHasSpokenTo (obj_id player, obj_id npc)
|
|
{
|
|
if ( hasObjVar(npc, "bestine.museumEventStarted") )
|
|
{
|
|
int currentEventNum = getIntObjVar(npc, "bestine.museumEventStarted");
|
|
setObjVar(player, "bestine.spokeToArtist03", currentEventNum);
|
|
|
|
if ( hasObjVar(player, "museumEventPlayer") )
|
|
removeObjVar(player, "museumEventPlayer");
|
|
}
|
|
return;
|
|
}
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "npc.conversation.bestine_artist03");
|
|
|
|
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_artist03");
|
|
|
|
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_artist03_condition_hasFeaturedArt_EventActive (player, self))
|
|
{
|
|
//-- NPC: Hello. Have you heard about the time one of my paintings was featured in the Bestine Museum? That time is now! I encourage you to rush to Bestine and see for yourself.
|
|
string_id message = new string_id (c_stringFile, "s_a9fe5eb6");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: The Bestine Museum is looking for more art to feature.
|
|
boolean hasResponse0 = false;
|
|
if (!bestine_artist03_condition_hasAlreadyVoted (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: All the way over in Bestine?
|
|
boolean hasResponse1 = false;
|
|
if (bestine_artist03_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_ead5e0b4");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_c53bdfa0");
|
|
|
|
setObjVar (player, "conversation.bestine_artist03.branchId", 1);
|
|
|
|
npcStartConversation (player, self, "bestine_artist03", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (self, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (bestine_artist03_condition_isActiveInEvent (player, self))
|
|
{
|
|
//-- NPC: Greetings friends. Have you heard about the time I crossed the Dune Sea without drinking even a single drop of water? Ha...who needs water when you've got a good Corellian ale!
|
|
string_id message = new string_id (c_stringFile, "s_1054ba24");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Er yeah. Anyway the Bestine Museum is looking for their next work of art to feature.
|
|
boolean hasResponse0 = false;
|
|
if (!bestine_artist03_condition_hasAlreadyVoted (player, self))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Yeah, you've mentioned it before.
|
|
boolean hasResponse1 = false;
|
|
if (bestine_artist03_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_9700d1c6");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_3e426694");
|
|
|
|
setObjVar (player, "conversation.bestine_artist03.branchId", 5);
|
|
|
|
npcStartConversation (player, self, "bestine_artist03", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (self, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (bestine_artist03_condition_hasFeaturedArt (player, self))
|
|
{
|
|
//-- NPC: Hello. Have you heard about the time one of my paintings was featured in the Bestine Museum? That time is now! I encourage you to rush to Bestine and see for yourself.
|
|
string_id message = new string_id (c_stringFile, "s_a9fe5eb6");
|
|
chat.chat (self, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (bestine_artist03_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Greetings friends. Have you heard about the time I tricked an underling of Jabba into giving me his money? Who needs a bank account with all the gullible thugs Jabba employs.
|
|
string_id message = new string_id (c_stringFile, "s_77b94789");
|
|
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_artist03")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
int branchId = getIntObjVar (player, "conversation.bestine_artist03.branchId");
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Hello. Have you heard about the time one of my paintings was featured in the Bestine Museum? That time is now! I encourage you to rush to Bestine and see for yourself.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: The Bestine Museum is looking for more art to feature.
|
|
if (branchId == 1 && response == "s_ead5e0b4")
|
|
{
|
|
//-- [NOTE]
|
|
if (!bestine_artist03_condition_hasSpokenTo (player, self))
|
|
{
|
|
bestine_artist03_action_setHasSpokenTo (player, self);
|
|
|
|
//-- NPC: How could I not leap at the chance yet again!
|
|
string_id message = new string_id (c_stringFile, "s_b53cc4bf");
|
|
removeObjVar (player, "conversation.bestine_artist03.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (bestine_artist03_condition_hasSpokenTo (player, self))
|
|
{
|
|
//-- NPC: Do you get the feeling we've done this before?
|
|
string_id message = new string_id (c_stringFile, "s_1eebe4c5");
|
|
removeObjVar (player, "conversation.bestine_artist03.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Hello. Have you heard about the time one of my paintings was featured in the Bestine Museum? That time is now! I encourage you to rush to Bestine and see for yourself.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Hello. Have you heard about the time one of my paintings was featured in the Bestine Museum? That time is now! I encourage you to rush to Bestine and see for yourself.
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: All the way over in Bestine?
|
|
if (branchId == 1 && response == "s_c53bdfa0")
|
|
{
|
|
//-- [NOTE]
|
|
if (bestine_artist03_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Oh sure. Closest thing this planet has to an art museum. Though, have you heard about the time I tried to open an art gallery for Tusken Raiders? Ends up they really don't like art. Or maybe it was just me... I'm not sure.
|
|
string_id message = new string_id (c_stringFile, "s_ae2d8845");
|
|
removeObjVar (player, "conversation.bestine_artist03.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Hello. Have you heard about the time one of my paintings was featured in the Bestine Museum? That time is now! I encourage you to rush to Bestine and see for yourself.' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Greetings friends. Have you heard about the time I crossed the Dune Sea without drinking even a single drop of water? Ha...who needs water when you've got a good Corellian ale!
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Er yeah. Anyway the Bestine Museum is looking for their next work of art to feature.
|
|
if (branchId == 5 && response == "s_9700d1c6")
|
|
{
|
|
//-- [NOTE]
|
|
if (!bestine_artist03_condition_hasSpokenTo (player, self))
|
|
{
|
|
bestine_artist03_action_setHasSpokenTo (player, self);
|
|
|
|
//-- NPC: Say no more.
|
|
string_id message = new string_id (c_stringFile, "s_46c7e15a");
|
|
removeObjVar (player, "conversation.bestine_artist03.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (bestine_artist03_condition_hasSpokenTo (player, self))
|
|
{
|
|
//-- NPC: Have we talked about this already? You want to hear it again? Okay.
|
|
string_id message = new string_id (c_stringFile, "s_77eb5b90");
|
|
removeObjVar (player, "conversation.bestine_artist03.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Greetings friends. Have you heard about the time I crossed the Dune Sea without drinking even a single drop of water? Ha...who needs water when you've got a good Corellian ale!' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Greetings friends. Have you heard about the time I crossed the Dune Sea without drinking even a single drop of water? Ha...who needs water when you've got a good Corellian ale!
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yeah, you've mentioned it before.
|
|
if (branchId == 5 && response == "s_3e426694")
|
|
{
|
|
//-- [NOTE]
|
|
if (bestine_artist03_condition__defaultCondition (player, self))
|
|
{
|
|
//-- NPC: Oh, well then have you heard about the time I single-handedly defeated an entire unit of stormtroopers? It's true... they're really terrible at sabacc.
|
|
string_id message = new string_id (c_stringFile, "s_14cd5816");
|
|
removeObjVar (player, "conversation.bestine_artist03.branchId");
|
|
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Greetings friends. Have you heard about the time I crossed the Dune Sea without drinking even a single drop of water? Ha...who needs water when you've got a good Corellian ale!' were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
removeObjVar (player, "conversation.bestine_artist03.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|