Initial Upload
Initial Upload
This commit is contained in:
105
_module/nss/killerplate.nss
Normal file
105
_module/nss/killerplate.nss
Normal file
@@ -0,0 +1,105 @@
|
||||
string sDeny;
|
||||
/* Script generated by
|
||||
Lilac Soul's NWN Script Generator, v. 1.3
|
||||
|
||||
For download info, please visit:
|
||||
http://www.lilacsoul.revility.com */
|
||||
|
||||
//Put this OnUsed
|
||||
void main()
|
||||
{
|
||||
|
||||
object oPC = GetLastUsedBy();
|
||||
|
||||
if (!GetIsPC(oPC)) return;
|
||||
|
||||
if (GetItemPossessedBy(oPC, "EarthGem")== OBJECT_INVALID)
|
||||
{
|
||||
sDeny="You are not carrying the correct gems required to use this lever";
|
||||
|
||||
SendMessageToPC(oPC, sDeny);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetItemPossessedBy(oPC, "FireGem")== OBJECT_INVALID)
|
||||
{
|
||||
sDeny="You are not carrying the correct gems required to use this lever";
|
||||
|
||||
SendMessageToPC(oPC, sDeny);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetItemPossessedBy(oPC, "AirGem")== OBJECT_INVALID)
|
||||
{
|
||||
sDeny="You are not carrying the correct gems required to use this lever";
|
||||
|
||||
SendMessageToPC(oPC, sDeny);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetItemPossessedBy(oPC, "WaterGem")== OBJECT_INVALID)
|
||||
{
|
||||
sDeny="You are not carrying the correct gems required to use this lever";
|
||||
|
||||
SendMessageToPC(oPC, sDeny);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetTag(GetItemInSlot(INVENTORY_SLOT_NECK, oPC)) != "DemorasBain")
|
||||
{
|
||||
sDeny="You are not wearing the correct item of clothing to operate this lever";
|
||||
|
||||
SendMessageToPC(oPC, sDeny);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
object oTarget;
|
||||
object oSpawn;
|
||||
location lTarget;
|
||||
oTarget = GetWaypointByTag("killerplate");
|
||||
|
||||
lTarget = GetLocation(oTarget);
|
||||
|
||||
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "killerplatepressureplate", lTarget);
|
||||
oSpawn = CreateObject(OBJECT_TYPE_TRIGGER, "killerplatetrigger", lTarget);
|
||||
oTarget = oSpawn;
|
||||
|
||||
//Visual effects can't be applied to waypoints, so if it is a WP
|
||||
//apply to the WP's location instead
|
||||
|
||||
int nInt;
|
||||
nInt = GetObjectType(oTarget);
|
||||
|
||||
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_BREACH), oTarget);
|
||||
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_BREACH), GetLocation(oTarget));
|
||||
|
||||
object oItem;
|
||||
oItem = GetItemPossessedBy(oPC, "DemorasBain");
|
||||
|
||||
if (GetIsObjectValid(oItem)) DestroyObject(oItem);
|
||||
|
||||
oItem = GetItemPossessedBy(oPC, "WaterGem");
|
||||
|
||||
if (GetIsObjectValid(oItem)) DestroyObject(oItem);
|
||||
|
||||
oItem = GetItemPossessedBy(oPC, "EarthGem");
|
||||
|
||||
if (GetIsObjectValid(oItem)) DestroyObject(oItem);
|
||||
|
||||
oItem = GetItemPossessedBy(oPC, "FireGem");
|
||||
|
||||
if (GetIsObjectValid(oItem)) DestroyObject(oItem);
|
||||
|
||||
oItem = GetItemPossessedBy(oPC, "AirGem");
|
||||
|
||||
if (GetIsObjectValid(oItem)) DestroyObject(oItem);
|
||||
|
||||
ActionSpeakString("The lever clicks into place");
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user