RATDOG/_module/nss/ra_hidden_loot.nss

37 lines
840 B
Plaintext
Raw Normal View History

//:: ra_hidden_loot
//Put this script OnEnter
void main()
{
object oPC = GetEnteringObject();
object oTarget = GetObjectByTag("RA_PLC_RUBBLE01");
object oSpawn;
location lTarget;
if (!GetIsPC(oPC)) return;
int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);
if (GetIsSkillSuccessful(oPC, SKILL_SEARCH, 15))
{
if (!GetIsObjectValid(oTarget)) return;
DelayCommand(0.1f, DestroyObject(oTarget, 0.0));
oTarget = GetWaypointByTag("RA_PLC_RUBBLE01");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "VILLIX_STOR_NOOK", lTarget);
SendMessageToPC(oPC, "You have discovered a hidden cache.");
DestroyObject(oSpawn, 180.0f);
}
SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);
}