PoA_PRC8/_module/nss/gen_spec_unique.nss
Jaysyn904 8d97886c3f Changed folder name.
Changed folder name.
2022-10-07 21:08:37 -04:00

103 lines
2.3 KiB
Plaintext

#include "X_O2_CONINCLUDE"
#include "GSLOOT_LIB"
// Modified by AW Olorin 1-12-2004
// Anti-GS Looting
void RespawnObject(string sTag, int iType, location lLoc) {
// ResRef must be derivable from Tag
string sResRef = GetStringLowerCase(GetStringLeft(sTag, 16));
CreateObject(iType, sResRef, lLoc);
}
void main()
{
SetLocalInt(OBJECT_SELF, "GT_MAX_LEVEL", 15);
object oLastOpener = GetLastOpener();
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0) {
string sReport;
sReport = ">>> ID: " + GetPCPlayerName( oLastOpener )
+ "; Name: "+ GetName( oLastOpener )
+ "; CD Key:" + GetPCPublicCDKey( oLastOpener )
+ "; IP:" + GetPCIPAddress( oLastOpener );
SendMessageToAllDMs(sReport + " Attempted Spam Looting!! " );
return; }
// For creatures, save the location at spawn-time as a local location and
// use it instead. Otherwise, the creature will respawn where it died.
location lLoc = GetLocation(OBJECT_SELF);
if (GetIsObjectValid(oLastOpener) == TRUE)
{
if(!GS_Check(oLastOpener,1))
{
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
//This is my Legendary / Artifact Items, which only spawn
//in certain chest within the module it's still a % chance
//and artifacts are real rare indeed!
int dInt = d100(1);
if(dInt>30)
{
ExecuteScript("spawnlegend", OBJECT_SELF);
DelayCommand(0.1, ExecuteScript("spawnlegend", OBJECT_SELF));
}
else if(dInt<10)
{
ExecuteScript("spawnartifact", OBJECT_SELF);
ExecuteScript("spawnlegend", OBJECT_SELF);
DelayCommand(0.1, ExecuteScript("spawnlegend", OBJECT_SELF));
}
else
{
ExecuteScript("spawnlegend", OBJECT_SELF);
}
}
else
{
RogueSpectreSpawn(oLastOpener);
DropNote(lLoc);
}
}
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
ShoutDisturbed();
string sTag = GetTag(OBJECT_SELF);
int iType = GetObjectType(OBJECT_SELF);
float fDelay = 1000.0; // 1000 second delay
DestroyObject(OBJECT_SELF, 0.0);
AssignCommand(GetArea(OBJECT_SELF), DelayCommand(fDelay, RespawnObject(sTag, iType, lLoc)));
}