Webheaderb
Neverwinter Nights at BioWare Broodslayers Guild Main Page
Neverwinter Nights at BioWare
sidebar

These resources are available to all Broodslayers for use in modules to be submitted for the Broodslayers Official PW server. If you use them in other projects, please give the guild and scripters credit, thank you.

BROODSLAYERS PW SCRIPTS
onDeath
script for RESPAWNABLE PLACEABLES


Note: This is the generic version, called "01placeondeath"

#include "NW_O2_CONINCLUDE"
void ClearInventory()
{
object oItem = OBJECT_INVALID;
oItem = GetFirstItemInInventory ();
while (oItem != OBJECT_INVALID)

{
DestroyObject (oItem, 0.0);
oItem = GetNextItemInInventory ();

}
}
void FillInventory()
{
object oLastOpener = GetLastOpener();
ClearInventory();// Clear the inventory out first

}
void RespawnChest (location lLoc, string sResRef)
{
object oTarget = OBJECT_SELF;
// SendMessageToAllDMs ("SPAWNING ALTAR in " + GetTag(GetArea (oTarget)) + ".");
CreateObject (OBJECT_TYPE_PLACEABLE, sResRef, lLoc);
}
void main()
{
//Get resref of container
string sResRef = GetResRef (OBJECT_SELF);
// Get location of chest that was destroyed
location lSpawnPoint = GetLocation (OBJECT_SELF);
// Assign command to respawn placeable in same location, with delay 1800.0 (30 mins)
float fX = IntToFloat (Random (1800) + 1801);
AssignCommand (GetArea (OBJECT_SELF), DelayCommand(fX,RespawnChest (lSpawnPoint, sResRef)));
if (GetLocalInt (OBJECT_SELF, "NW_DO_ONCE") != 0)

{
return;
}
object oLastOpener = GetLastOpener();
ClearInventory();
FillInventory();
SetLocalInt (OBJECT_SELF, "NW_DO_ONCE",1);
ShoutDisturbed();

}

If you have further questions, contact Chokra at chokra@broodslayers.com.

footer

 

Google
Web t-rob.com
broodslayers.com midwestgamingnews.com

Blood, Violence   Dungeons & Dragons Wizards of the Coast Forgotten Realms