36 lines
774 B
Plaintext
36 lines
774 B
Plaintext
|
|
|
|
//Created by Genisys / Guile on 4/25/09
|
|
|
|
//this script goes in the OnOpen event of a chest you want to secure
|
|
//It prevents the second person to open the chest from using it!
|
|
//this script works in conjunction with divide_loot!
|
|
void main()
|
|
{
|
|
object o = GetLastOpenedBy();
|
|
string sName = GetName(o);
|
|
int nSecure = GetLocalInt(OBJECT_SELF, "SECURED");
|
|
int nSEC = GetLocalInt(o, "SECURED");
|
|
|
|
|
|
if(nSecure==1)
|
|
{
|
|
if(GetIsDM(o))
|
|
{ return; }
|
|
|
|
if(nSEC==1)
|
|
{ return; }
|
|
|
|
AssignCommand(o, ClearAllActions());
|
|
AssignCommand(o, ActionMoveAwayFromObject(OBJECT_SELF, TRUE, 5.0f));
|
|
|
|
SendMessageToAllDMs(sName + " May have stole items in the Treasury! Please Investigate!");
|
|
}
|
|
else
|
|
{
|
|
SetLocalInt(OBJECT_SELF, "SECURED", 1);
|
|
SetLocalInt(o, "SECURED", 1);
|
|
}
|
|
|
|
}
|