Battledale_PRC8/_module/nss/jw_trap_plate_di.nss
Jaysyn904 7b9e44ebbb Initial upload
Initial upload.  PRC8 has been added.  Module compiles, PRC's default AI & treasure scripts have been integrated.  Started work on top hak for SLA / Ability / Scripting modifications.
2024-03-11 23:44:08 -04:00

41 lines
715 B
Plaintext

#include "jw_include_funct"
void main()
{
string sMyTag = GetTag(OBJECT_SELF);
//string sTag=GetStringLeft(sMyTag,8);
string sDiff=GetLocalString(OBJECT_SELF,"diff");
string sType=GetLocalString(OBJECT_SELF,"type");
object oCreator=GetLocalObject(OBJECT_SELF,"creator");
// the DC is the saving throw for half damage
int nDC=getdifficulty(sDiff);
nDC=nDC/2;
object oPC=GetLastDisarmed();
GiveXPToCreature(oPC,nDC);
// say we are no longer trapped
SetLocalInt(oCreator,"triggered",TRUE);
// destroy self
object oidDoor= OBJECT_SELF;
if (oidDoor != OBJECT_INVALID)
{
SetPlotFlag(oidDoor,0);
DestroyObject(oidDoor);
}
}