//Created by Alupinu
//Altered by Morbane
// OnInventoryDisturbed
void main()
{
int iType = GetInventoryDisturbType();
object oItem = GetInventoryDisturbItem();
object oPC = GetLastUsedBy();
string sTemplate = GetLocalString(OBJECT_SELF, "sItem");
int nQuantity = GetLocalInt(OBJECT_SELF, "nQuantity");
if(GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF)) == TRUE) return;
switch(iType)
{
case INVENTORY_DISTURB_TYPE_REMOVED:
{
if(oItem == GetObjectByTag("f_container_secret_comp")) // sItemTag is simply the tag of your junk item in quotes " "
{
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
CreateItemOnObject(sTemplate, OBJECT_SELF, nQuantity);
ActionSpeakString("*SUCCESS* You found a secret compartment in the chest.");
}
else return;
}
}
}
Only fires in TS?
#1
Posté 01 juin 2012 - 07:25
#2
Posté 01 juin 2012 - 10:07
:happy://Created by Alupinu
//Altered by Morbane
// OnInventoryDisturbed
void main()
{
int iType = GetInventoryDisturbType();
object oItem = GetInventoryDisturbItem();
object oPC = GetLastDisturbed(); // changed this **
string sTemplate = GetLocalString(OBJECT_SELF, "sItem");
int nQuantity = GetLocalInt(OBJECT_SELF, "nQuantity");
if(GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF)) == TRUE) return;
switch(iType)
{
case INVENTORY_DISTURB_TYPE_REMOVED:// either 0 or 1 or 2 - REMOVED = 1
{
if(oItem == GetObjectByTag("f_container_secret_comp")) // sItemTag is simply the tag of your junk item in quotes " "
{
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
CreateItemOnObject(sTemplate, OBJECT_SELF, nQuantity);
ActionSpeakString("*SUCCESS* You found a secret compartment in the chest.");
}
}
}
}
Modifié par Morbane, 01 juin 2012 - 10:09 .
#3
Posté 01 juin 2012 - 08:35
The script seems to be working fine now, thank you again.
#4
Posté 01 juin 2012 - 09:29
For those of us further down the brain chain
What did you do?
PJ
#5
Posté 01 juin 2012 - 10:12
#6
Posté 02 juin 2012 - 12:06





Retour en haut







