PWE_PRC8/_module/nss/ats_tinktool_use.nss

45 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2025-04-03 10:29:41 -04:00
/****************************************************
On Tinkering Toolset's Use Script
ats_anvil_use
Last Updated: August 17, 2002
***Ambrosia Tradeskill System***
Created by Mojo(Allen Sun)
This script should be placed on the custom tinkering toolset's
OnUsed trigger. This script checks to make sure
the player has the tinkering skill and has the
proper fletching tool. If so, it starts the
tinkering conversation menu.
***********************************************/
#include "ats_inc_common"
#include "ats_inc_constant"
#include "ats_config"
#include "ats_inc_skill"
#include "ats_inc_material"
#include "ats_inc_tool"
#include "ats_inc_menu"
void main()
{
object oPlayer = GetLastUsedBy();
// Check to make sure the player doesn't have zero skill in fletching
if(ATS_GetTradeskill(oPlayer, CSTR_SKILLNAME_TINKER) <= 0)
FloatingTextStringOnCreature("You do not know how to use this.", oPlayer, FALSE);
// Check to make sure the proper tool is equipped
else if(ATS_GetToolForCraft(oPlayer, CSTR_SKILLNAME_TINKER) == OBJECT_INVALID)
FloatingTextStringOnCreature("You do not have the proper tool equipped to use this.",
oPlayer, FALSE);
else if(IsInConversation(OBJECT_SELF) == TRUE
&& IsInConversation(GetLocalObject(OBJECT_SELF, "ats_converser")) == TRUE)
FloatingTextStringOnCreature(CSTR_ERROR1_INUSE, oPlayer, FALSE);
else
{
SetLocalObject(OBJECT_SELF, "ats_converser", oPlayer);
ClearAllActions();
ATS_SetCurrentCraftType(oPlayer, ATS_CRAFT_TYPE_TINKER);
ActionStartConversation( GetLastUsedBy(), "", TRUE);
}
}