35 lines
1.3 KiB
Plaintext
35 lines
1.3 KiB
Plaintext
void main()
|
|
{
|
|
object oCloser = GetLastClosedBy();
|
|
object oItem = GetFirstItemInInventory(OBJECT_SELF);
|
|
object oListener = GetLocalObject(OBJECT_SELF,"vulc_listener");
|
|
if (!GetIsPC(oCloser))//||!GetIsObjectValid(oItem))
|
|
{
|
|
return;
|
|
}
|
|
//do not allow combat or existing conversation to prevent unwanted
|
|
//firing
|
|
if(!GetIsInCombat(oCloser)&&!IsInConversation(oCloser))
|
|
{
|
|
//create the listener here in none exists
|
|
if(!GetIsObjectValid(oListener))
|
|
{
|
|
oListener= CreateObject(OBJECT_TYPE_CREATURE,"vulc_renamer",GetLocation(OBJECT_SELF));
|
|
SetLocalObject(oListener,"vulc_namespawner",OBJECT_SELF);
|
|
SetLocalObject(OBJECT_SELF,"vulc_listener",oListener);
|
|
}
|
|
//we lock here so that on PWs, jerks can't run in and steal items,
|
|
//and to make sure only one PC at a time can use it to prevent
|
|
//incorrect name assignments. The script vulc_unlock will unlock
|
|
//the container if convo is cancelled or user disconnects (or otherwise
|
|
//ends the conversation
|
|
// SetLocked(OBJECT_SELF, TRUE);
|
|
//Set the PC as the local object for permissions on listening patterns
|
|
SetLocalObject(OBJECT_SELF,"vulc_crafter",oCloser);
|
|
//Start up the convo UI
|
|
|
|
ActionStartConversation(oCloser, "jh_crafttlk", TRUE);
|
|
|
|
}
|
|
}
|