UW2_PRC8/_module/nss/create_gems.nss
Jaysyn904 5197ad9a4d Initial upload
Initial upload
2023-09-25 20:24:01 -04:00

50 lines
1.1 KiB
Plaintext

/*--------------------------------------------------------
Script Name: securedoorscript
----------------------------------------------------------
Created By: Genisys(Guile)
Created On: 2/09/09
----------------------------------------------------------
This goes in the OnEnter Event for a tracks trigger or Area
Basically it creates ALL of the gems on the player, one time.
This should be used by DMs for testing only...
----------------------------------------------------------*/
void main()
{
//Declare major variables..
int i;
object oPC = GetEnteringObject();
string sPCName = GetName(oPC);
if(!GetIsPC(oPC))
{
//DMs get the gems too!
if(GetIsDM(oPC))
{} //continue the script...
else
{return;}
}
int n = GetLocalInt(OBJECT_SELF, "ONCE_DONE" + sPCName);
if(n==1)
{ return; }
string sName = "gen_gem_";
string sItem;
//Set this to only happen one time for each player!
SetLocalInt(OBJECT_SELF, "ONCE_DONE" + sPCName , 1);
//Create ALL of the gems on the player
for(i=0; i<216; i++)
{
//The resref name of the gem..
sItem = sName + IntToString(i);
CreateItemOnObject(sItem, oPC, 1);
}
}