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

1106 lines
32 KiB
Plaintext

// ======================================================================
//
// ep3_myyydril_weaponsmith.script
//
//
//
// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.conversation;
include library.groundquests;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/ep3_myyydril_weaponsmith";
// ======================================================================
// Script Conditions
// ======================================================================
boolean ep3_myyydril_weaponsmith_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean ep3_myyydril_weaponsmith_condition_hasSkillWeapon (obj_id player, obj_id npc)
{
return hasSkill(player, "class_munitions_phase1_novice");
}
// ----------------------------------------------------------------------
boolean ep3_myyydril_weaponsmith_condition_isTaskOneActive (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive(player, "ep3_myyydril_treesh_craft_1", 1) ||
groundquests.hasCompletedTask(player, "ep3_myyydril_treesh_craft_1", 1))
return true;
else
return false;
}
// ----------------------------------------------------------------------
boolean ep3_myyydril_weaponsmith_condition_isTaskCompleted (obj_id player, obj_id npc)
{
return (groundquests.hasCompletedTask(player, "ep3_myyydril_treesh_craft_1", 1) &&
!groundquests.hasCompletedQuest(player, "ep3_myyydril_treesh_craft_1"));
}
// ----------------------------------------------------------------------
boolean ep3_myyydril_weaponsmith_condition_hasCompletedQuestOne (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "ep3_myyydril_treesh_craft_1");
}
// ----------------------------------------------------------------------
boolean ep3_myyydril_weaponsmith_condition_isTaskActiveTwo (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive(player, "ep3_myyydril_treesh_gather_2", 0) ||
groundquests.hasCompletedTask(player, "ep3_myyydril_treesh_gather_2", 0))
return true;
else
return false;
}
// ----------------------------------------------------------------------
boolean ep3_myyydril_weaponsmith_condition_hasCompletedQuestTwo (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "ep3_myyydril_treesh_gather_2");
}
// ----------------------------------------------------------------------
boolean ep3_myyydril_weaponsmith_condition_questCompleteNoSchem (obj_id player, obj_id npc)
{
return (groundquests.hasCompletedQuest(player, "ep3_myyydril_treesh_craft_1") && !hasSchematic(player, "object/draft_schematic/weapon/appearance/weapon_appearance_knife_naktra_crystal.iff"));
}
// ======================================================================
// Script Actions
// ======================================================================
void ep3_myyydril_weaponsmith_action_giveQuestOne (obj_id player, obj_id npc)
{
// Apply the first quest to the player here
groundquests.grantQuest(player, "ep3_myyydril_treesh_craft_1");
// Grant leet schematic
grantSchematic(player, "object/draft_schematic/weapon/knife_naktra_crystal_false.iff");
sendSystemMessage(player, new string_id( "dungeon/myyydril", "knife"));
}
// ----------------------------------------------------------------------
void ep3_myyydril_weaponsmith_action_grantSchemetic (obj_id player, obj_id npc)
{
revokeSchematic(player, "object/draft_schematic/weapon/knife_naktra_crystal_false.iff");
grantSchematic(player, "object/draft_schematic/weapon/appearance/weapon_appearance_knife_naktra_crystal.iff");
groundquests.sendSignal(player, "giveSwords");
}
// ----------------------------------------------------------------------
void ep3_myyydril_weaponsmith_action_giveSignal1 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "giveSwords");
}
// ----------------------------------------------------------------------
void ep3_myyydril_weaponsmith_action_giveQuestTwo (obj_id player, obj_id npc)
{
// Apply the first quest to the player here
groundquests.grantQuest(player, "ep3_myyydril_treesh_gather_2");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int ep3_myyydril_weaponsmith_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: [Treesh snores.] Zzzz.
//-- [RESPONSE NOTE]
//-- PLAYER: Hello?
if (response == "s_762")
{
doAnimationAction (player, "poke");
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: Uh--huh? What? It's you, again? Why always when I'm sleeping?
string_id message = new string_id (c_stringFile, "s_766");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You're always sleeping!
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I need the schematics again.
boolean hasResponse1 = false;
if (ep3_myyydril_weaponsmith_condition_questCompleteNoSchem (player, npc))
{
++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_770");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_35");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_weaponsmith_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Uh--huh? What? It's you, again? Why always when I'm sleeping?
//-- [RESPONSE NOTE]
//-- PLAYER: You're always sleeping!
if (response == "s_770")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: Yeah, yeah. Just don't tell the furry people.
string_id message = new string_id (c_stringFile, "s_774");
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I need the schematics again.
if (response == "s_35")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
ep3_myyydril_weaponsmith_action_grantSchemetic (player, npc);
//-- NPC: What!? Here, now, go away!
string_id message = new string_id (c_stringFile, "s_36");
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_weaponsmith_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Who's--
//-- [RESPONSE NOTE]
//-- PLAYER: Yeah. Yeah. It's me, the weaponsmith.
if (response == "s_782")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: Oh. You. Do you have the weapons I need?
string_id message = new string_id (c_stringFile, "s_786");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes, but you better give me something in return.
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++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_790");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_weaponsmith_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Oh. You. Do you have the weapons I need?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, but you better give me something in return.
if (response == "s_790")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
ep3_myyydril_weaponsmith_action_grantSchemetic (player, npc);
//-- NPC: Wow. Aren't you direct. [Treesh grunts.] Okay, kid. Fine. You win. Here ya go. Oh and... thanks. Now, go away!
string_id message = new string_id (c_stringFile, "s_794");
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_weaponsmith_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: [Treesh stares blankly.] Who's there?
//-- [RESPONSE NOTE]
//-- PLAYER: It's me. I--
if (response == "s_802")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: Do I have Nak'tra Crystal Swords in my hand?
string_id message = new string_id (c_stringFile, "s_806");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: No.. I--
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++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_810");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_weaponsmith_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Do I have Nak'tra Crystal Swords in my hand?
//-- [RESPONSE NOTE]
//-- PLAYER: No.. I--
if (response == "s_810")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: Then, go away. I'm trying to sleep around here. Come back when you have them.
string_id message = new string_id (c_stringFile, "s_814");
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_weaponsmith_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: [Treesh peers blankly.] Who's there? I sense a familiar aura about you. Wait a second. No, that was definitely my lunch.
//-- [RESPONSE NOTE]
//-- PLAYER: Ew! Keep that to yourself!
if (response == "s_822")
{
doAnimationAction (player, "cover_mouth");
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: [Treesh grunts.] What do you want? Are you a weaponsmith? I only talk to those who can appreciate my profession!
string_id message = new string_id (c_stringFile, "s_826");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes, I'm a weaponsmith. Why do you care?
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++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_830");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_weaponsmith_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: [Treesh grunts.] What do you want? Are you a weaponsmith? I only talk to those who can appreciate my profession!
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, I'm a weaponsmith. Why do you care?
if (response == "s_830")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: I've got a job I need you to do. These darned Urnies keep attacking and the furry people need more weapons to defeat them.
string_id message = new string_id (c_stringFile, "s_834");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Why can't you do it?
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++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_838");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 13);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_weaponsmith_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I've got a job I need you to do. These darned Urnies keep attacking and the furry people need more weapons to defeat them.
//-- [RESPONSE NOTE]
//-- PLAYER: Why can't you do it?
if (response == "s_838")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: [Treesh narrows his eyes.] What--?! I can't believe you'd ask me such a thing! You insensitive kreetle lover! I'm blind! Can't you see that?! You can! You have eyes!
string_id message = new string_id (c_stringFile, "s_842");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Whoa. I.. I didn't mean to offend you.
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++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_846");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 14);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_weaponsmith_handleBranch14 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: [Treesh narrows his eyes.] What--?! I can't believe you'd ask me such a thing! You insensitive kreetle lover! I'm blind! Can't you see that?! You can! You have eyes!
//-- [RESPONSE NOTE]
//-- PLAYER: Whoa. I.. I didn't mean to offend you.
if (response == "s_846")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: [Treesh laughs.] You didn't. I was just pulling your leg. You want the job or not? You owe me, kid.
string_id message = new string_id (c_stringFile, "s_850");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Owe you? Why--oh, nevermind. Yeah, what's the job.
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I don't need a job from you.
boolean hasResponse1 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++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_854");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_878");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 15);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_weaponsmith_handleBranch15 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: [Treesh laughs.] You didn't. I was just pulling your leg. You want the job or not? You owe me, kid.
//-- [RESPONSE NOTE]
//-- PLAYER: Owe you? Why--oh, nevermind. Yeah, what's the job.
if (response == "s_854")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: Make me some Nak'tra Crystal Swords. You need to collect Nak'tra crystals around here and fashion them into a pointed stick. Is that easy enough for you?
string_id message = new string_id (c_stringFile, "s_858");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yeah. I'll do it.
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Yeah. But I don't want to do it.
boolean hasResponse1 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++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_862");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_872");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 16);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I don't need a job from you.
if (response == "s_878")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: Tpphht! Then, go away... kreetle lover!
string_id message = new string_id (c_stringFile, "s_882");
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int ep3_myyydril_weaponsmith_handleBranch16 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Make me some Nak'tra Crystal Swords. You need to collect Nak'tra crystals around here and fashion them into a pointed stick. Is that easy enough for you?
//-- [RESPONSE NOTE]
//-- PLAYER: Yeah. I'll do it.
if (response == "s_862")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
ep3_myyydril_weaponsmith_action_giveQuestOne (player, npc);
//-- NPC: ... Well?! Why are you still here? Get a move on! If I get fired, it's your head, you know. Oh and--supposedly, Urnies eat the Crystals too. You might find some on them.
string_id message = new string_id (c_stringFile, "s_866");
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Yeah. But I don't want to do it.
if (response == "s_872")
{
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: [Treesh snorts.]
string_id message = new string_id (c_stringFile, "s_953");
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.ep3_myyydril_weaponsmith");
setCondition (self, CONDITION_CONVERSABLE);
setName (self, new string_id( "ep3/npc_names", "treesh" ));
setInvulnerable(self, true);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setName (self, new string_id( "ep3/npc_names", "treesh" ));
setInvulnerable(self, true);
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);
faceTo(self, player);
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.ep3_myyydril_weaponsmith");
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)
{
obj_id npc = self;
if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player))
return SCRIPT_OVERRIDE;
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition_hasCompletedQuestOne (player, npc))
{
//-- NPC: [Treesh snores.] Zzzz.
string_id message = new string_id (c_stringFile, "s_758");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Hello?
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++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_762");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 1);
npcStartConversation (player, npc, "ep3_myyydril_weaponsmith", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition_isTaskCompleted (player, npc))
{
//-- NPC: Who's--
string_id message = new string_id (c_stringFile, "s_778");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yeah. Yeah. It's me, the weaponsmith.
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++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_782");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 5);
npcStartConversation (player, npc, "ep3_myyydril_weaponsmith", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition_isTaskOneActive (player, npc))
{
//-- NPC: [Treesh stares blankly.] Who's there?
string_id message = new string_id (c_stringFile, "s_798");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: It's me. I--
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++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_802");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 8);
npcStartConversation (player, npc, "ep3_myyydril_weaponsmith", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition_hasSkillWeapon (player, npc))
{
//-- NPC: [Treesh peers blankly.] Who's there? I sense a familiar aura about you. Wait a second. No, that was definitely my lunch.
string_id message = new string_id (c_stringFile, "s_818");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Ew! Keep that to yourself!
boolean hasResponse0 = false;
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
++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_822");
utils.setScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId", 11);
npcStartConversation (player, npc, "ep3_myyydril_weaponsmith", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (ep3_myyydril_weaponsmith_condition__defaultCondition (player, npc))
{
//-- NPC: [Treesh grunts.] Who are you? What do you want? You got any skill in those hands? No? Go away. You're not a weaponsmith. You can't understand the beauty of crafting a weapon, simpleton.
string_id message = new string_id (c_stringFile, "s_886");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false.");
return SCRIPT_CONTINUE;
}
// ----------------------------------------------------------------------
trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response)
{
if (conversationId != "ep3_myyydril_weaponsmith")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
if (branchId == 1 && ep3_myyydril_weaponsmith_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && ep3_myyydril_weaponsmith_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && ep3_myyydril_weaponsmith_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && ep3_myyydril_weaponsmith_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && ep3_myyydril_weaponsmith_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && ep3_myyydril_weaponsmith_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && ep3_myyydril_weaponsmith_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && ep3_myyydril_weaponsmith_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && ep3_myyydril_weaponsmith_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 14 && ep3_myyydril_weaponsmith_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 15 && ep3_myyydril_weaponsmith_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 16 && ep3_myyydril_weaponsmith_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.ep3_myyydril_weaponsmith.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================