WoR_PRC8/_module/nss/etum_home_loot.nss
Jaysyn904 b5e28e52f4 Initial commit
Initial commit [1.18]
2025-04-03 11:49:34 -04:00

68 lines
3.3 KiB
Plaintext

#include "NW_O2_CONINCLUDE"
void main()
{
object oItem = OBJECT_INVALID;
// Clear all contents of the <span class="highlight">chest</span>
oItem = GetFirstItemInInventory();
while ( oItem != OBJECT_INVALID )
{
//Make sure people don't stuff <span class="highlight">chest</span> with plot items and break it
SetPlotFlag(oItem, FALSE);
DestroyObject( oItem, 0.0 );
oItem = GetNextItemInInventory();
}
// Set respawntime float to the number of seconds.
float respawntime = 600.00;
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
{
return;
}
object oLastOpener = GetLastOpener();
object oArea = GetArea (GetNearestObjectByTag("robber"));
vector vPosition = GetPosition (GetNearestObjectByTag("robber"));
float fOrientation = GetFacing (GetNearestObjectByTag("robber"));
location lSpawn = Location ( oArea, vPosition, fOrientation);
GenerateLowTreasure(oLastOpener, OBJECT_SELF);
GenerateLowTreasure(oLastOpener, OBJECT_SELF);
GenerateLowTreasure(oLastOpener, OBJECT_SELF);
GenerateLowTreasure(oLastOpener, OBJECT_SELF);
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
ShoutDisturbed();
// Command added to delay the <span class="highlight">respawn</span>
AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) );
int nRandom = d20(1);
if (nRandom == 1){
AdjustReputation(GetLastOpener(), GetObjectByTag("faction_etum"), -50);
CreateObject (OBJECT_TYPE_CREATURE, "etumcitizen", lSpawn, TRUE);}
else if (nRandom == 2){
AdjustReputation(GetLastOpener(), GetObjectByTag("faction_etum"), -50);
CreateObject (OBJECT_TYPE_CREATURE, "etumcitizen001", lSpawn, TRUE);}
else if (nRandom == 3){
AdjustReputation(GetLastOpener(), GetObjectByTag("faction_etum"), -50);
CreateObject (OBJECT_TYPE_CREATURE, "etumcitizen002", lSpawn, TRUE);}
else if (nRandom == 4){
AdjustReputation(GetLastOpener(), GetObjectByTag("faction_etum"), -50);
CreateObject (OBJECT_TYPE_CREATURE, "etumcitizen003", lSpawn, TRUE);}
else if (nRandom == 5){
AdjustReputation(GetLastOpener(), GetObjectByTag("faction_etum"), -50);
CreateObject (OBJECT_TYPE_CREATURE, "etumcitizen004", lSpawn, TRUE);}
else if (nRandom == 6){
AdjustReputation(GetLastOpener(), GetObjectByTag("faction_etum"), -50);
CreateObject (OBJECT_TYPE_CREATURE, "etumcitizen005", lSpawn, TRUE);}
else if (nRandom == 7){
AdjustReputation(GetLastOpener(), GetObjectByTag("faction_etum"), -50);
CreateObject (OBJECT_TYPE_CREATURE, "etumcitizen006", lSpawn, TRUE);}
else if (nRandom == 8){
AdjustReputation(GetLastOpener(), GetObjectByTag("faction_etum"), -50);
CreateObject (OBJECT_TYPE_CREATURE, "etumcitizen007", lSpawn, TRUE);}
else if (nRandom == 9){
AdjustReputation(GetLastOpener(), GetObjectByTag("faction_etum"), -50);
CreateObject (OBJECT_TYPE_CREATURE, "etumcitizen008", lSpawn, TRUE);}
else if (nRandom == 10){
AdjustReputation(GetLastOpener(), GetObjectByTag("faction_etum"), -50);
CreateObject (OBJECT_TYPE_CREATURE, "etumcitizen009", lSpawn, TRUE);}
else if (nRandom == 11){
AdjustReputation(GetLastOpener(), GetObjectByTag("faction_etum"), -50);
CreateObject (OBJECT_TYPE_CREATURE, "etumwatch003", lSpawn, TRUE);}
}