-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path001_secret_door.NSS
46 lines (36 loc) · 1.34 KB
/
001_secret_door.NSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Written by Saaz of ALFA
// Put this script OnEnter.
// ***000_secret_door***
// Spot = 17 find skill #s on Skills.2da
// Search = 14
// Survival = 29
// Knowledge Dungeon = 33
#include "acr_trigger_i"
#include "acr_skills_i"
#include "acr_spawn_i"
const string SKILL_VAR = "nSkill"; // integer nSkill
const string SKILL_DC_VAR = "nDC"; // integer nDC
const string RESREF_VAR = "sResRef"; //string sResRef
const string WP_TAG_VAR = "sWayPointTag"; //string sWayPointTag
const string PLC_DESTROY_TAG = "sPlcDestroyMe"; //string placeable tag
void main()
{
ACR_TriggerOnEnter();
object oTarget;
object oSpawn;
object oPlaceable;
// Get the creature who triggered this event.
object oPC = GetEnteringObject();
// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
return;
// Abort if a skill check is failed.
if ( d20() + GetSkillRank(GetLocalInt(OBJECT_SELF,SKILL_VAR), oPC) < GetLocalInt(OBJECT_SELF,SKILL_DC_VAR) )
return;
// Spawn "secret door".
oTarget = GetWaypointByTag(GetLocalString(OBJECT_SELF,WP_TAG_VAR));
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE,GetLocalString(OBJECT_SELF,RESREF_VAR), GetLocation(oTarget));
//destroy placeable
oPlaceable = GetObjectByTag(GetLocalString(oPlaceable,PLC_DESTROY_TAG));
DestroyObject(oPlaceable,0.0);
}