Installed NESS 4.1.9
Installed NESS 4.1.9. Tweaked main city. Full compile.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include "prc_inc_racial"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetEnteringObject();
|
||||
@@ -29,20 +31,21 @@ ExploreAreaForPlayer(oArea, oPC);
|
||||
int iClass = GetClassByPosition (1, oPC);
|
||||
|
||||
|
||||
if(iClass == CLASS_TYPE_BARBARIAN)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_waxgr001", oPC);
|
||||
CreateItemOnObject("nw_waxhn001", oPC);
|
||||
CreateItemOnObject("nw_aarcl008", oPC);
|
||||
CreateItemOnObject("nw_it_medkit002", oPC);
|
||||
CreateItemOnObject("nw_wthax001", oPC,9);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
SendMessageToPC(oPC, "Barbarian EQ");
|
||||
}
|
||||
if(iClass == CLASS_TYPE_BARD)
|
||||
if(iClass == CLASS_TYPE_BARBARIAN)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_waxgr001", oPC);
|
||||
CreateItemOnObject("nw_waxhn001", oPC);
|
||||
CreateItemOnObject("nw_aarcl008", oPC);
|
||||
CreateItemOnObject("nw_it_medkit002", oPC);
|
||||
CreateItemOnObject("nw_wthax001", oPC,9);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
SendMessageToPC(oPC, "Barbarian EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_BARD)
|
||||
{
|
||||
CreateItemOnObject("nw_aarcl009", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr312", oPC);
|
||||
@@ -57,7 +60,7 @@ ExploreAreaForPlayer(oArea, oPC);
|
||||
SendMessageToPC(oPC, "Bard EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_CLERIC)
|
||||
if(iClass == CLASS_TYPE_CLERIC || iClass == CLASS_TYPE_ARCHIVIST || iClass == CLASS_TYPE_FAVOURED_SOUL)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
@@ -85,7 +88,50 @@ ExploreAreaForPlayer(oArea, oPC);
|
||||
SendMessageToPC(oPC, "Druid EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_FIGHTER)
|
||||
if(iClass == CLASS_TYPE_SOHEI)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
CreateItemOnObject("nw_wswss001", oPC);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_it_medkit002", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 2);
|
||||
SendMessageToPC(oPC, "Sohei EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SHAMAN)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
CreateItemOnObject("nw_wdbqs001", oPC);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_it_medkit002", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 2);
|
||||
SendMessageToPC(oPC, "Shaman EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SAMURAI || iClass == CLASS_TYPE_CW_SAMURAI)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
if (iClass != CLASS_TYPE_SAMURAI) {CreateItemOnObject("nw_wswka001", oPC);} // Katana
|
||||
CreateItemOnObject("nw_aarcl003", oPC); // Scale armor
|
||||
CreateItemOnObject("nw_wswgs001", oPC); // Shortsword
|
||||
SendMessageToPC(oPC, "Samurai EQ");
|
||||
}
|
||||
if(iClass == CLASS_TYPE_FIGHTER || iClass == CLASS_TYPE_WARBLADE
|
||||
|| iClass == CLASS_TYPE_CRUSADER
|
||||
|| iClass == CLASS_TYPE_DUSKBLADE
|
||||
|| iClass == CLASS_TYPE_SOULBORN
|
||||
|| iClass == CLASS_TYPE_MARSHAL)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
@@ -96,9 +142,21 @@ ExploreAreaForPlayer(oArea, oPC);
|
||||
CreateItemOnObject("nw_ashlw001", oPC);
|
||||
CreateItemOnObject("nw_wswgs001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Fighter EQ");
|
||||
SendMessageToPC(oPC, "Warrior EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_KNIGHT)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wswls001", oPC);
|
||||
CreateItemOnObject("nw_aarcl011", oPC);
|
||||
CreateItemOnObject("nw_ashlw001", oPC);
|
||||
SendMessageToPC(oPC, "Knight EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_MONK)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
@@ -125,6 +183,20 @@ ExploreAreaForPlayer(oArea, oPC);
|
||||
SendMessageToPC(oPC, "Paladin EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SCOUT)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wbwsh001", oPC);
|
||||
CreateItemOnObject("nw_wamar001", oPC,25);
|
||||
CreateItemOnObject("nw_wamar001", oPC,25);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Scout EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_RANGER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
@@ -139,21 +211,173 @@ ExploreAreaForPlayer(oArea, oPC);
|
||||
SendMessageToPC(oPC, "Ranger EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_ROGUE)
|
||||
if(iClass == CLASS_TYPE_HEALER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("nw_it_medkit001", oPC,2);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Healer EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_HEXBLADE)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade002", oPC,4);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswsc001", oPC);
|
||||
SendMessageToPC(oPC, "Hexblade EQ");
|
||||
}
|
||||
if(iClass == CLASS_TYPE_BINDER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade003", oPC,9);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_it_picks002", oPC);
|
||||
CreateItemOnObject("nw_it_trap001", oPC);
|
||||
CreateItemOnObject("nw_wswss001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Rogue EQ");
|
||||
SendMessageToPC(oPC, "Binder EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_WARLOCK || iClass == CLASS_TYPE_DRAGONFIRE_ADEPT)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 3);
|
||||
CreateItemOnObject("nw_aarcl001", oPC); // Leather Mail
|
||||
CreateItemOnObject("nw_wblms001", oPC); // Morning Star
|
||||
SendMessageToPC(oPC, "Warlock EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SORCERER)
|
||||
if(iClass == CLASS_TYPE_DRAGON_SHAMAN)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 3);
|
||||
CreateItemOnObject("nw_ashsw001", oPC); // Small Shield
|
||||
CreateItemOnObject("nw_aarcl006", oPC); // Chain mail
|
||||
CreateItemOnObject("nw_wblms001", oPC); // Morning Star
|
||||
SendMessageToPC(oPC, "Dragonfire Shaman EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_WILDER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 3);
|
||||
CreateItemOnObject("nw_ashsw001", oPC); // Small Shield
|
||||
CreateItemOnObject("nw_aarcl001", oPC); // Leather Mail
|
||||
CreateItemOnObject("nw_wblms001", oPC); // Morning Star
|
||||
SendMessageToPC(oPC, "Wilder EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_WARMAGE)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade005", oPC, 3);
|
||||
CreateItemOnObject("nw_it_contain002", oPC);
|
||||
CreateItemOnObject("x1_it_sparscr103", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr202", oPC);
|
||||
CreateItemOnObject("nw_ashsw001", oPC); // Small Shield
|
||||
CreateItemOnObject("nw_aarcl001", oPC); // Leather Mail
|
||||
CreateItemOnObject("nw_wblms001", oPC); // Morning Star
|
||||
SendMessageToPC(oPC, "Warmage EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_INCARNATE)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 3);
|
||||
CreateItemOnObject("nw_aarcl004", oPC); // Chain Mail
|
||||
CreateItemOnObject("nw_wblms001", oPC); // Morning Star
|
||||
SendMessageToPC(oPC, "Incarnate EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SOULKNIFE)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade003", oPC,3);
|
||||
CreateItemOnObject("nw_ashlw001", oPC);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
SendMessageToPC(oPC, "Soulknife EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_TRUENAMER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,3);
|
||||
CreateItemOnObject("x1_wmgrenade002", oPC,3);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Truenamer EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_TOTEMIST)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade001", oPC,3);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
CreateItemOnObject("nw_ashsw001", oPC);
|
||||
SendMessageToPC(oPC, "Totemist EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SWASHBUCKLER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade003", oPC,3);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
CreateItemOnObject("nw_wswrp001", oPC);
|
||||
SendMessageToPC(oPC, "Swashbuckler EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SWORDSAGE)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade004", oPC,3);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswls001", oPC);
|
||||
SendMessageToPC(oPC, "Swordsage EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_ROGUE || iClass == CLASS_TYPE_BEGUILER
|
||||
|| iClass == CLASS_TYPE_PSYCHIC_ROGUE
|
||||
|| iClass == CLASS_TYPE_FACTOTUM)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade003", oPC,9);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_it_picks002", oPC);
|
||||
CreateItemOnObject("nw_it_trap001", oPC);
|
||||
CreateItemOnObject("nw_wswss001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Rogue EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SORCERER || iClass == CLASS_TYPE_DREAD_NECROMANCER || iClass == CLASS_TYPE_SHADOWCASTER )
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
@@ -162,12 +386,24 @@ ExploreAreaForPlayer(oArea, oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
CreateItemOnObject("nw_wthdt001", oPC,9);
|
||||
CreateItemOnObject("nw_cloth008", oPC);//robe
|
||||
CreateItemOnObject("nw_it_contain006", oPC);
|
||||
CreateItemOnObject("nw_it_contain002", oPC);
|
||||
CreateItemOnObject("x1_it_sparscr103", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr202", oPC);
|
||||
SendMessageToPC(oPC, "Sorcerer EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_PSION)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wdbqs001", oPC);
|
||||
CreateItemOnObject("nw_cloth005", oPC);//robe
|
||||
CreateItemOnObject("nw_it_contain002", oPC);
|
||||
SendMessageToPC(oPC, "Psion EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_WIZARD)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
@@ -176,7 +412,7 @@ ExploreAreaForPlayer(oArea, oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wdbqs001", oPC);
|
||||
CreateItemOnObject("nw_cloth005", oPC);//robe
|
||||
CreateItemOnObject("nw_it_contain006", oPC);
|
||||
CreateItemOnObject("nw_it_contain002", oPC);
|
||||
CreateItemOnObject("x1_it_sparscr103", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr202", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr107", oPC);
|
||||
|
6
_module/nss/_ness_spawn_hb.nss
Normal file
6
_module/nss/_ness_spawn_hb.nss
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "spawn_main"
|
||||
void main()
|
||||
{
|
||||
Spawn();
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@
|
||||
//:: Modified On: 22 Jan 03
|
||||
//:://////////////////////////////////////////////
|
||||
//Version Numbers. Do NOT change these
|
||||
|
||||
void sp_VersionInfo();
|
||||
void sp_VersionInfo()
|
||||
{
|
||||
@@ -32,6 +33,7 @@ void sp_DestroyObject(object oNearest, string sTagType);
|
||||
void sp_CheckVars(object oNearest, string sCurrentName);
|
||||
void sp_Spawn(object oNearest, string sTemplate, int iSpawnX);
|
||||
void sp_TagObject(object oNearest, string sTagType, object oNewObject);
|
||||
void sp_TagItem(object oNearest, string sTagType, object oNewItem);
|
||||
void sp_SpawnCamp(object oNearest, location lCurrentWP);
|
||||
void sp_CheckTrap(object oNearest, object oPC);
|
||||
void sp_AreaEffect(object oNearest);
|
||||
@@ -511,6 +513,7 @@ void sp_Spawn(object oNearest, string sTemplate, int iSpawnX)
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eSpawn, lCurrentWP);
|
||||
}
|
||||
oNewObject = CreateObject(OBJECT_TYPE_CREATURE, sTemplate, lCurrentWP, FALSE);
|
||||
CreateObject(OBJECT_TYPE_ITEM, sTemplate, lCurrentWP, FALSE);
|
||||
SetLocalInt(oNearest, "Spawning", GetLocalInt(oNearest, "Spawning") - 1);
|
||||
sp_TagObject(oNearest, "Creature", oNewObject);
|
||||
}
|
||||
|
7
_module/nss/barkskinvfx.nss
Normal file
7
_module/nss/barkskinvfx.nss
Normal file
@@ -0,0 +1,7 @@
|
||||
void main()
|
||||
{
|
||||
object oTarget = OBJECT_SELF;
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_PROT_BARKSKIN);
|
||||
DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMind, oTarget));
|
||||
SetLocalInt(OBJECT_SELF, "X1_L_IMMUNE_TO_DISPEL", 10);
|
||||
}
|
426
_module/nss/innerkeep_enter.nss
Normal file
426
_module/nss/innerkeep_enter.nss
Normal file
@@ -0,0 +1,426 @@
|
||||
#include "prc_inc_racial"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetEnteringObject();
|
||||
|
||||
if(!GetIsPC(oPC)) return; // pc or dm check
|
||||
if(GetIsDM(oPC)==TRUE) return;
|
||||
|
||||
int iXP = GetXP(oPC);
|
||||
if (iXP <1)
|
||||
{
|
||||
SetXP(oPC, 2);// set xp so script doesnt fire again on enter
|
||||
///enter
|
||||
object oArea = OBJECT_SELF;
|
||||
AssignCommand(oPC, ClearAllActions());
|
||||
ExploreAreaForPlayer(oArea, oPC);
|
||||
|
||||
|
||||
|
||||
//start
|
||||
object oItem = GetFirstItemInInventory(oPC);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
// SetPlotFlag(oItem,FALSE);
|
||||
DestroyObject(oItem);
|
||||
oItem = GetNextItemInInventory(oPC);
|
||||
}
|
||||
|
||||
///////////// equip players according to class
|
||||
int iClass = GetClassByPosition (1, oPC);
|
||||
|
||||
|
||||
if(iClass == CLASS_TYPE_BARBARIAN)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_waxgr001", oPC);
|
||||
CreateItemOnObject("nw_waxhn001", oPC);
|
||||
CreateItemOnObject("nw_aarcl008", oPC);
|
||||
CreateItemOnObject("nw_it_medkit002", oPC);
|
||||
CreateItemOnObject("nw_wthax001", oPC,9);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
SendMessageToPC(oPC, "Barbarian EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_BARD)
|
||||
{
|
||||
CreateItemOnObject("nw_aarcl009", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr312", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr202 ", oPC);
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wbwxl001", oPC);
|
||||
CreateItemOnObject("nw_wambo001", oPC,25);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Bard EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_CLERIC || iClass == CLASS_TYPE_ARCHIVIST || iClass == CLASS_TYPE_FAVOURED_SOUL)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wblml001", oPC);
|
||||
CreateItemOnObject("nw_ashsw001", oPC);
|
||||
CreateItemOnObject("nw_aarcl004", oPC);
|
||||
CreateItemOnObject("x1_wmgrenade005", oPC,9);
|
||||
SendMessageToPC(oPC, "Cleric EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_DRUID)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wspmsc002", oPC);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_it_medkit002", oPC);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC,9);
|
||||
SendMessageToPC(oPC, "Druid EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SOHEI)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
CreateItemOnObject("nw_wswss001", oPC);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_it_medkit002", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 2);
|
||||
SendMessageToPC(oPC, "Sohei EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SHAMAN)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
CreateItemOnObject("nw_wdbqs001", oPC);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_it_medkit002", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 2);
|
||||
SendMessageToPC(oPC, "Shaman EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SAMURAI || iClass == CLASS_TYPE_CW_SAMURAI)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
if (iClass != CLASS_TYPE_SAMURAI) {CreateItemOnObject("nw_wswka001", oPC);} // Katana
|
||||
CreateItemOnObject("nw_aarcl003", oPC); // Scale armor
|
||||
CreateItemOnObject("nw_wswgs001", oPC); // Shortsword
|
||||
SendMessageToPC(oPC, "Samurai EQ");
|
||||
}
|
||||
if(iClass == CLASS_TYPE_FIGHTER || iClass == CLASS_TYPE_WARBLADE
|
||||
|| iClass == CLASS_TYPE_CRUSADER
|
||||
|| iClass == CLASS_TYPE_DUSKBLADE
|
||||
|| iClass == CLASS_TYPE_SOULBORN
|
||||
|| iClass == CLASS_TYPE_MARSHAL)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wswls001", oPC);
|
||||
CreateItemOnObject("nw_aarcl011", oPC);
|
||||
CreateItemOnObject("nw_ashlw001", oPC);
|
||||
CreateItemOnObject("nw_wswgs001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Warrior EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_KNIGHT)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wswls001", oPC);
|
||||
CreateItemOnObject("nw_aarcl011", oPC);
|
||||
CreateItemOnObject("nw_ashlw001", oPC);
|
||||
SendMessageToPC(oPC, "Knight EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_MONK)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wspka001", oPC);
|
||||
CreateItemOnObject("nw_wthsh001", oPC,25);
|
||||
CreateItemOnObject("nw_mcloth018", oPC);
|
||||
CreateItemOnObject("nw_it_medkit002", oPC);
|
||||
SendMessageToPC(oPC, "Monk EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_PALADIN)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wswls001", oPC);
|
||||
CreateItemOnObject("nw_aarcl006", oPC);
|
||||
CreateItemOnObject("nw_ashlw001", oPC);
|
||||
CreateItemOnObject("nw_it_medkit002", oPC);
|
||||
SendMessageToPC(oPC, "Paladin EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SCOUT)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wbwsh001", oPC);
|
||||
CreateItemOnObject("nw_wamar001", oPC,25);
|
||||
CreateItemOnObject("nw_wamar001", oPC,25);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Scout EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_RANGER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wbwsh001", oPC);
|
||||
CreateItemOnObject("nw_wamar001", oPC,25);
|
||||
CreateItemOnObject("nw_wswss001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Ranger EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_HEALER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("nw_it_medkit001", oPC,2);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Healer EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_HEXBLADE)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade002", oPC,4);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswsc001", oPC);
|
||||
SendMessageToPC(oPC, "Hexblade EQ");
|
||||
}
|
||||
if(iClass == CLASS_TYPE_BINDER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade003", oPC,9);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Binder EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_WARLOCK || iClass == CLASS_TYPE_DRAGONFIRE_ADEPT)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 3);
|
||||
CreateItemOnObject("nw_aarcl001", oPC); // Leather Mail
|
||||
CreateItemOnObject("nw_wblms001", oPC); // Morning Star
|
||||
SendMessageToPC(oPC, "Warlock EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_DRAGON_SHAMAN)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 3);
|
||||
CreateItemOnObject("nw_ashsw001", oPC); // Small Shield
|
||||
CreateItemOnObject("nw_aarcl006", oPC); // Chain mail
|
||||
CreateItemOnObject("nw_wblms001", oPC); // Morning Star
|
||||
SendMessageToPC(oPC, "Dragonfire Shaman EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_WILDER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 3);
|
||||
CreateItemOnObject("nw_ashsw001", oPC); // Small Shield
|
||||
CreateItemOnObject("nw_aarcl001", oPC); // Leather Mail
|
||||
CreateItemOnObject("nw_wblms001", oPC); // Morning Star
|
||||
SendMessageToPC(oPC, "Wilder EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_WARMAGE)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade005", oPC, 3);
|
||||
CreateItemOnObject("nw_it_contain002", oPC);
|
||||
CreateItemOnObject("x1_it_sparscr103", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr202", oPC);
|
||||
CreateItemOnObject("nw_ashsw001", oPC); // Small Shield
|
||||
CreateItemOnObject("nw_aarcl001", oPC); // Leather Mail
|
||||
CreateItemOnObject("nw_wblms001", oPC); // Morning Star
|
||||
SendMessageToPC(oPC, "Warmage EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_INCARNATE)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC, 2);
|
||||
CreateItemOnObject("x1_wmgrenade006", oPC, 3);
|
||||
CreateItemOnObject("nw_aarcl004", oPC); // Chain Mail
|
||||
CreateItemOnObject("nw_wblms001", oPC); // Morning Star
|
||||
SendMessageToPC(oPC, "Incarnate EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SOULKNIFE)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade003", oPC,3);
|
||||
CreateItemOnObject("nw_ashlw001", oPC);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
SendMessageToPC(oPC, "Soulknife EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_TRUENAMER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,3);
|
||||
CreateItemOnObject("x1_wmgrenade002", oPC,3);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Truenamer EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_TOTEMIST)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade001", oPC,3);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
CreateItemOnObject("nw_ashsw001", oPC);
|
||||
SendMessageToPC(oPC, "Totemist EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SWASHBUCKLER)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade003", oPC,3);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
CreateItemOnObject("nw_wswrp001", oPC);
|
||||
SendMessageToPC(oPC, "Swashbuckler EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SWORDSAGE)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade004", oPC,3);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_wswls001", oPC);
|
||||
SendMessageToPC(oPC, "Swordsage EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_ROGUE || iClass == CLASS_TYPE_BEGUILER
|
||||
|| iClass == CLASS_TYPE_PSYCHIC_ROGUE
|
||||
|| iClass == CLASS_TYPE_FACTOTUM)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC,2);
|
||||
CreateItemOnObject("x1_wmgrenade003", oPC,9);
|
||||
CreateItemOnObject("nw_aarcl001", oPC);
|
||||
CreateItemOnObject("nw_it_picks002", oPC);
|
||||
CreateItemOnObject("nw_it_trap001", oPC);
|
||||
CreateItemOnObject("nw_wswss001", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
SendMessageToPC(oPC, "Rogue EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_SORCERER || iClass == CLASS_TYPE_DREAD_NECROMANCER || iClass == CLASS_TYPE_SHADOWCASTER )
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wswdg001", oPC);
|
||||
CreateItemOnObject("nw_wthdt001", oPC,9);
|
||||
CreateItemOnObject("nw_cloth008", oPC);//robe
|
||||
CreateItemOnObject("nw_it_contain002", oPC);
|
||||
CreateItemOnObject("x1_it_sparscr103", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr202", oPC);
|
||||
SendMessageToPC(oPC, "Sorcerer EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_PSION)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wdbqs001", oPC);
|
||||
CreateItemOnObject("nw_cloth005", oPC);//robe
|
||||
CreateItemOnObject("nw_it_contain002", oPC);
|
||||
SendMessageToPC(oPC, "Psion EQ");
|
||||
}
|
||||
|
||||
if(iClass == CLASS_TYPE_WIZARD)
|
||||
{
|
||||
CreateItemOnObject("nw_it_torch001", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_it_mpotion020", oPC);
|
||||
CreateItemOnObject("nw_wdbqs001", oPC);
|
||||
CreateItemOnObject("nw_cloth005", oPC);//robe
|
||||
CreateItemOnObject("nw_it_contain002", oPC);
|
||||
CreateItemOnObject("x1_it_sparscr103", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr202", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr107", oPC);
|
||||
CreateItemOnObject("nw_it_sparscr106", oPC);
|
||||
SendMessageToPC(oPC, "Wizard EQ");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//end of script
|
||||
}
|
20
_module/nss/patchnoattack.nss
Normal file
20
_module/nss/patchnoattack.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: patchnoattack
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Derrick's script to make combat dummies not attack
|
||||
you.
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By:
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetLastAttacker();
|
||||
SetIsTemporaryFriend(oPC,OBJECT_SELF,FALSE,0.001);
|
||||
DelayCommand(0.001,SetIsTemporaryEnemy(oPC));
|
||||
}
|
544
_module/nss/spawn__history.nss
Normal file
544
_module/nss/spawn__history.nss
Normal file
@@ -0,0 +1,544 @@
|
||||
//
|
||||
//
|
||||
// NESS
|
||||
// Version 8.1.3
|
||||
// Spawn History
|
||||
//
|
||||
//
|
||||
// Neshke Narovken (Original Author)
|
||||
//
|
||||
// Cereborn (Maintainer)
|
||||
//
|
||||
//*******************************************************************
|
||||
//
|
||||
// History:
|
||||
//
|
||||
// +++ Start Version 7.0
|
||||
//
|
||||
// --/--/-- Neshke Created
|
||||
//
|
||||
//
|
||||
// +++ Start Version 7.0.1
|
||||
//
|
||||
// 12/03/02 Cereborn Added DanielleB's merchant-based loot tables
|
||||
// 12/12/02 Cereborn Added area-wide count of currently spawned
|
||||
// creatures
|
||||
// 12/31/02 Cereborn Added LT subflags A, B, and C for specifying
|
||||
// percentage chances of receiving 1, 2, or 3
|
||||
// loot items.
|
||||
// 01/01/03 Cereborn Added SX flag for dim returns suppression.
|
||||
//
|
||||
// +++ Start Version 7.0.2
|
||||
//
|
||||
// 01/07/03 Cereborn Added NESS_ActivateSpawn(),
|
||||
// NESS_DeactivateSpawn, NESS_GetSpawnByID(),
|
||||
// NESS_ActivateSpawnByID(), NESS_ForceProcess()
|
||||
// NESS_DeactivateSpawnByID() and
|
||||
// NESS_TrackModuleSpawns().
|
||||
// Modified so that an activated spawn is processed
|
||||
// immediately instead of waiting for the next
|
||||
// process tick when using SPxx
|
||||
// Moved ReportSpawns and TrackModuleSpawns
|
||||
// to spawn_functions from spawn_main; modified
|
||||
// spawn_main to call TrackModuleSpawns() if
|
||||
// enabled, removing the need for placing
|
||||
// in each area heartbeat script
|
||||
//
|
||||
// 01/08/03 Cereborn Fixed bug preventing initial flag processing
|
||||
// when using SPxx.
|
||||
// Added new deactivate spawn (DS) condition
|
||||
// (6) which deactivates a spawn whenever spawn
|
||||
// count reaches spawn number. This is similar
|
||||
// to DS1, except that DS1 is based on number
|
||||
// of children *ever* spawned, so once
|
||||
// deactivated can never be reactivated, while
|
||||
// DS6 is based on current child count, allowing
|
||||
// the spawn to be re-activated if 1 or more of
|
||||
// it's children have been killed or despawned
|
||||
// 01/10/03 Cereborn Prevent despawning creatures when possessed
|
||||
// by a DM. (the code was attempting to do so
|
||||
// already but due to a Bioware bug it wasn't
|
||||
// working)
|
||||
// 01/11/03 Cereborn Added I subflag to SU to check each child's
|
||||
// location individually instead of the spawn's
|
||||
// location
|
||||
// 01/17/03 Cereborn Added force process of spawns when PCs
|
||||
// re-arrive id deactivated by PC flag
|
||||
// 01/18/03 Cereborn Added new type (3) to PL and subflag P
|
||||
// Added P subflag to SD.
|
||||
// 01/20/03 Cereborn Force process on deactivate
|
||||
// Added NESS_IsModuleSpawnTracking()
|
||||
//
|
||||
// +++ Start Version 7.0.3
|
||||
//
|
||||
// 01/22/03 Cereborn Bug fix: Initialize module spawn count to
|
||||
// 0 to fix bug with loading from saved games
|
||||
// 01/24/03 Cereborn Added NESS_DumpModuleSpawns() and
|
||||
// NESS_IsModuleSpawnDumping(). When spawn
|
||||
// dumping is enabled, each area with active
|
||||
// spawns reports its spawn count each HB
|
||||
//
|
||||
//
|
||||
// +++ Start Version ALFA 1.0
|
||||
//
|
||||
//
|
||||
// 02/05/03 - 03/21/03
|
||||
//
|
||||
// Added NESS_ProcessDeadCreature(). This can be used to notify NESS that
|
||||
// a spawned creature has died (typically from an onDeath event script).
|
||||
// This is particularly useful when using larger SPxx values and the CD
|
||||
// flag, since without notification it can take a long time for NESS to
|
||||
// discover that the spawned creature has died and set up the lootable
|
||||
// corpse.
|
||||
//
|
||||
// Added O(ffset) subflag to the SP flag. NESS now processes all spawns on
|
||||
// the first heartbeat, and then spawns are be processed on heartbeat
|
||||
// 1 + offset + (processRate * N). For example, SP3 gets processed on
|
||||
// heartbeats 1, 4, 7, 10, etc.... while SP3O1 gets processed on heartbeats
|
||||
// 1, 5, 8, 11..., and so on. This should be used to spread out heartbeats
|
||||
// within an area.
|
||||
//
|
||||
// NESS no longer does any timing based on counted heartbeats. All timings
|
||||
// are now based on the clock. A new file, spawn_timefuncs, contains
|
||||
// functions for converting the game clock to real seconds for use in NESS
|
||||
// timings.
|
||||
//
|
||||
// When spawns despawn due to using the PC flag (and if the R subflag is
|
||||
// not specified) the despawning creature resrefs and their locations are
|
||||
// recorded, and the spawn is restored to it previous state when PCs
|
||||
// re-enter the area. This prevents exploits where players intentionally
|
||||
// 'pop' a zone, then leave for the PC flag's duration, to effectively
|
||||
// clear an area of all obstacles until the spawn delay timer (if any)
|
||||
// expires.
|
||||
//
|
||||
// Fixed the bug causing corpses that had been fully looted to not decay.
|
||||
//
|
||||
// Fixed the bug that caused corpses to *never* decay if the decay timer
|
||||
// went off when the inventory was open (now a new decay timer is set).
|
||||
//
|
||||
// Flag parsing code cleaned up; fixed a bug that caused the default value
|
||||
// for a flag to always be 1 (ignoring what was set up in spawn_cfg_global)
|
||||
//
|
||||
// Items marked no-drop are no longer copied onto the lootable corpses
|
||||
//
|
||||
// All no-drop items are explicitly destroyed (whether the CD flag is used
|
||||
// or not) to working around a current Bioware memory leak.
|
||||
//
|
||||
// Added NESS_ReturnHome(). Call to force a NESS spawn to it's home point.
|
||||
//
|
||||
// Added support for RH flag on spawn camps.
|
||||
//
|
||||
// +++ Start Version ALFA 1.0 Patch 1 (v1.0.1)
|
||||
//
|
||||
// 03/29/03
|
||||
//
|
||||
// A bug where spawn delays were being applied to first time spawns that
|
||||
// didn't happen right away (such as triggered spawns, day/night only,
|
||||
// etc.) was fixed.
|
||||
//
|
||||
// If a spawn has the RH flag and is respawned after being despawned due
|
||||
// to the PC flag, creatures will respawn at their home point instead of
|
||||
// where they were when they despawned.
|
||||
//
|
||||
// An errant debug statement was removed.
|
||||
//
|
||||
// +++ Start Version ALFA 1.0 Patch 2 (v1.0.2)
|
||||
//
|
||||
// 03/30/03
|
||||
//
|
||||
// Fixed a bug where the number of creatures in a spawn was getting
|
||||
// confused due to spawns that use the M subflag of the SN flag
|
||||
// recalculating their spawn numbers when spawns deactivated due to the
|
||||
// PC flag. This bug fix should eliminate the overpopulating spawns
|
||||
// problem.
|
||||
//
|
||||
// +++ Start Version ALFA 1.0 Patch 3 (v1.0.3)
|
||||
//
|
||||
// 03/31/03
|
||||
//
|
||||
// Fixed a bug where spawn delays could be skipped.
|
||||
//
|
||||
// +++ Start Version ALFA 1.0 Patch 4 (v1.0.4)
|
||||
//
|
||||
// 04/04/03
|
||||
//
|
||||
// Fixed a bug where spawn delays were ignored on placeables.
|
||||
// Fixed P subflag of SD being ignored.
|
||||
// Reset spawn delay after RS-failed spawn attempt
|
||||
// Set up a new spawn delay when creature killed
|
||||
//
|
||||
// +++ Start Version ALFA 1.0 Patch 5 (v1.0.5)
|
||||
//
|
||||
// 04/07/03
|
||||
//
|
||||
// Fixed bug in spawn_timefuncs that resulting in incorrect conversions
|
||||
// in years other than the Epoch year.
|
||||
// Changed the Epoch year to 1340 to conform to the lowest date in
|
||||
// the NWN engine.
|
||||
//
|
||||
// +++ Start Version ALFA 1.0 Patch 6 (v1.0.6)
|
||||
//
|
||||
// 04/08/03
|
||||
//
|
||||
// Fixed bug with corpse decay and death script flags not being available
|
||||
// for camp spawns when onDeath notification occurs.
|
||||
//
|
||||
// +++ Start Version ALFA 1.0 Patch 7 (v1.0.7)
|
||||
//
|
||||
// 04/27/03
|
||||
//
|
||||
// Added debugging for spawn delays and spawn counts that can be
|
||||
// independently enabled/disabled for each area from the spawn banner
|
||||
// rod.
|
||||
//
|
||||
// +++ Start Version ALFA 1.1 (v1.1)
|
||||
//
|
||||
// 04/28/03
|
||||
//
|
||||
// Fixed bug in Loot Merchant code. The original code used
|
||||
// GetNearestObjectByTag() to look up loot merchants, which according to
|
||||
// the documentation should never have worked for merchants not in the same
|
||||
// area as the creature spawned. In reality, it stopped working (at least
|
||||
// in some cases) after Bioware released version 1.29 of the game.
|
||||
//
|
||||
// 05/03/03
|
||||
//
|
||||
// Changed distribution method used for SR flag to evenly distribute
|
||||
// spawns in the spawn circle instead. The old method made the spawns
|
||||
// denser near the center and rarer near the circle's edge
|
||||
//
|
||||
// Made SF work (again?) for placeables
|
||||
//
|
||||
// When the SF flag is not specified for a multi-child spawn, a random
|
||||
// SF is now calcualated independently for each child
|
||||
//
|
||||
// 05/08/03
|
||||
//
|
||||
// Added NL (No Loot) flag. This suppresses looting of player corpses.
|
||||
// Only applies when using ACR 1.14 and higher
|
||||
//
|
||||
// 05/25/03
|
||||
//
|
||||
// Fixed overspawning bug caused by changing child counts on spawns that
|
||||
// had been 'saved' with potentially different counts
|
||||
//
|
||||
// 05/27/03
|
||||
//
|
||||
// Added C (Closest) subflag to the PR (Patrol Route) flag. If C is
|
||||
// specified, the spawned creature will start at the closest waypoint
|
||||
// rather than the first (does not apply to T2 flagged routes(random
|
||||
// traverse)).
|
||||
//
|
||||
// 05/30/03
|
||||
//
|
||||
// Added SB (Subdual) flag. Causes creatures to be spawned in in subdual
|
||||
// mode. Only applies when using ACR 1.14 and higher.
|
||||
//
|
||||
//
|
||||
// +++ Start Version ALFA 1.2 (v1.2)
|
||||
//
|
||||
// 08/24/03
|
||||
//
|
||||
// Removed LocationToString() function from spawn_functions, as this is
|
||||
// now a Bioware function
|
||||
//
|
||||
// 08/25/03
|
||||
//
|
||||
// Modified the way the SX flag works. First, there is now a global flag,
|
||||
// nGlobalSuppressDR, in spawn_cfg_global that can be set to determine
|
||||
// whether or not creatures spawn in with DR on or off when no SX flag is
|
||||
// specified. The current default is for DR to *not* be suppressed, i.e.,
|
||||
// it will be operational. Also, the SX flag can now take a value of 0 or 1.
|
||||
// If 1, DR is suppressed, if 0 DR is enabled (useful if you've set
|
||||
// nGlobalSuppressDR to 1). The default if no value is specified (just SX)
|
||||
// is 1 (to suppress). You can also change this default in spawn_cfg_global.
|
||||
// If nGlobalSuppressDR is 1 and nSuppressDR is 0, you will get the opposite
|
||||
// of the v1.1 functionality; no DR on creatures, except when the SX flag is
|
||||
// present.
|
||||
//
|
||||
// +++ Start Version ALFA 1.2.1 (v1.2.1)
|
||||
//
|
||||
// 09/01/03
|
||||
//
|
||||
// Fixed bug where spawn number was always being set to the number of saved
|
||||
// camp spawns on PC-flag restore instead of the sum of saved camp and
|
||||
// regular spawn counts.
|
||||
//
|
||||
// +++ Start Version ALFA 1.2.2 (v1.2.2)
|
||||
//
|
||||
// 09/02/03
|
||||
//
|
||||
// Fixed bug introduced by last bug fix that caused overspawning!
|
||||
//
|
||||
// +++ Start Version ALFA 1.2.3 (v1.2.3)
|
||||
//
|
||||
// 09/21/03
|
||||
//
|
||||
// Added EL - E(ncounter) L(evel) flag
|
||||
//
|
||||
// +++ Start Version ALFA 1.2.4 (v1.2.4)
|
||||
//
|
||||
// 10/03/03
|
||||
//
|
||||
// Added I subflag to SL flag.
|
||||
//
|
||||
// Modified ST behavior so that spawned creatures walk to their seats
|
||||
// instead of running
|
||||
//
|
||||
// 10/18/03
|
||||
//
|
||||
// Check night / day only, day, hour, lifespan and SU before restoring
|
||||
// spawns
|
||||
//
|
||||
// Fixed recalculate random spawn number bug where the spawn number could
|
||||
// change before a despawn due to the PC flag was restored, causing the
|
||||
// number of creatures thought to exist to differ from what actually got
|
||||
// restored
|
||||
//
|
||||
// 10/19/03
|
||||
//
|
||||
// Fixed SD bug; under certain cases (such as a despawn due to CL flag)
|
||||
// SD was being ignored.
|
||||
//
|
||||
// Fixed bug where SU|I only worked if RS or SL were in use
|
||||
//
|
||||
// +++ Start Version ALFA 1.2.5 (v1.2.5)
|
||||
//
|
||||
// 10/25/03
|
||||
//
|
||||
// Do a ClearAllActions() before despawning creatures. This helps prevent
|
||||
// 'broken' Bioware chairs caused by despawning creatures using the ST
|
||||
// flag.
|
||||
//
|
||||
// 10/27/03
|
||||
|
||||
// Modified the spawn_cfg_camp example to use standard BW creatures /
|
||||
// placeables for the benefit of non-ALFA users.
|
||||
//
|
||||
//
|
||||
// 11/02/03
|
||||
//
|
||||
// Added a scaled encounter example. This uses the same basic methodology
|
||||
// as Sareena's random wilderness spawns - an SNxx flag is given large
|
||||
// enough for the largest possible spawn and then the actual number (and
|
||||
// types) of creatures is determined when the spawn actually takes place.
|
||||
//
|
||||
//
|
||||
// +++ Start Version 8.0
|
||||
//
|
||||
// Given that NESS is now being supported outside the ALFA umbrella, I've
|
||||
// decided to begin version numbering from 8.0 from here out. Version 8.0
|
||||
// is the immediate successor to ALFA version 1.2.5.
|
||||
//
|
||||
// 01/19/04
|
||||
//
|
||||
// Fixed problems with naked NPC corpses that had droppable armor /
|
||||
// clothing. playable race characters (humans, dwarves, elves, etc.)
|
||||
// now keep a copy of whatever is in the chest slot on the original
|
||||
// corpse.
|
||||
//
|
||||
//
|
||||
// 01/21/04
|
||||
//
|
||||
// Added Rn subflag to CD to specify what type of remains are left after
|
||||
// corpse decay. These correspond 1 to 1 to the treasure type field for
|
||||
// placeables, except for R7, which causes no loot bag to be left (loot
|
||||
// destroyed when corpse decays). See the specific flag documentation
|
||||
// below for the values/types of each R subflag.
|
||||
//
|
||||
// Added D subflag to CD to cause corpse to drop wielded weapons on the
|
||||
// ground. Note that droppable flag on weapon still takes precedence -
|
||||
// non-droppable wielded weapons will not be dropped.
|
||||
//
|
||||
// Delete armor/clothing from corpse if looted.
|
||||
//
|
||||
// Added scripts for lootable corpse onOpen, onClosed, onUsed, and
|
||||
// onDisturbed events (renamed with a spawn_ prefix).
|
||||
//
|
||||
// Added a lootable corpse placeable for each remains type; each has the
|
||||
// correct event scripts attached.
|
||||
//
|
||||
// 01/22/04
|
||||
//
|
||||
// Initialize global defaults and flags on first area heartbeat, not first
|
||||
// heartbeat with PCs present.
|
||||
//
|
||||
// Use DelayCommand(0.0, ...) to give each spawn flag initialization
|
||||
// function its own command queue (allowing many more spawn points before
|
||||
// TMIs at initialization occur).
|
||||
//
|
||||
// 01/23/04
|
||||
//
|
||||
// Fixed bug with EE flag. Spawned creature was not walking to spawn point
|
||||
// after entrance.
|
||||
//
|
||||
// Fixed bug with spawn in effect when using EE. Spawn in effect now happens
|
||||
// at the entrance point.
|
||||
//
|
||||
// Added support for ALFA-specific flags as Custom Flags (following the CF
|
||||
// flag. Parsing and processing of custom flags can now be done by
|
||||
// modifying spawn_cfg_cusflg. This file contains 2 functions:
|
||||
// ParseCustomFlags() and SetupCustomFlags(). ParseCustomFlags is called
|
||||
// with whatever flags follow the CF_ flag (when flags for the spawn are
|
||||
// being initialized. Typically, flags are parsed and there values are
|
||||
// written to the spawn object. SetupCustomFlags() is called when a
|
||||
// creature is actually spawned (typically flags are copied from the spawn
|
||||
// object to the creature (spawned) object. The processing of ALFA-specific
|
||||
// flags are included in this file as an example.
|
||||
//
|
||||
//
|
||||
// +++ Start Version 8.1
|
||||
//
|
||||
// 1/29/04
|
||||
//
|
||||
// Put better sounds for closing / opening corpses. Changed the names of
|
||||
// the onOpen and onClose event scripts for corpses, and updated the corpse
|
||||
// placeables to use those.
|
||||
//
|
||||
// 2/15/04
|
||||
//
|
||||
// Fixed bugs in spawn_cfg_cusflag that caused flag values to be lost if
|
||||
// specified as normal flags rather than custom flags (only affected the
|
||||
// ALFA custom flags).
|
||||
//
|
||||
// 3/8/04
|
||||
//
|
||||
// 'Home' is now either the place a creature spawned in, or the place it
|
||||
// *would have spawned in* if there wasn't an alternate specified by the EE
|
||||
// flag. Hopefully, this restores it to its original, correct behavior.
|
||||
//
|
||||
// The initial delay subflag of IS should now work correctly.
|
||||
//
|
||||
// The corpse remains type default value was using one variable name in
|
||||
// spawn_defaults to set it and a different one in spawn_functions to
|
||||
// retrieve the value, which resulted in the default not working. This has
|
||||
// been fixed.
|
||||
//
|
||||
// Added 2 new Patrol Route flags at Danmar's request. They are RPn (for
|
||||
// random pause and RRn for Random Route. These allow for some
|
||||
// randomization of patrol routes. The RRn flag sets the percentage chance
|
||||
// that the next stop in a route will actually be gone to (otherwise it's
|
||||
// skipped. RPn specifies a range to randomly choose an additional pause
|
||||
// amount which is added to the value specified by PSn.
|
||||
//
|
||||
// At EPOlson's request, NESS will now look for a local string variable on
|
||||
// the spawn waypoint named "NESS" for spawn flags. If no string is found
|
||||
// (or if it does not start with "SP") then the flags specified in the
|
||||
// waypoint name are used (just like it used to).
|
||||
//
|
||||
// NESS now has full support for using pseudo-heartbeats as an alternative
|
||||
// to the standard area heartbeats. For those who wish to use this, remove
|
||||
// Spawn() from your area heartbeat script (or, if spawn_sample_hb is your
|
||||
// area haertbeat script, just remove that script from your areas' On
|
||||
// Heartbeat slots) and call Spawn_OnAreaEnter() and Spawn_OnAreaExit()
|
||||
// from your area On Enter and On Exit scripts respectively. Again, if you
|
||||
// do no currrent have On Enter and or On Exit scripts in use for your areas
|
||||
// you can use spawn_smpl_onent and spawn_smpl_onext which are provided with
|
||||
// this release.
|
||||
//
|
||||
// Spawn_OnAreaEnter() takes up to 3 optional arguments. The first is the
|
||||
// name of the script you want called when the pseudo-heartbeat happens.
|
||||
// By default, spawn_sample_hb is called (which in turn just calls Spawn().
|
||||
// You can put any script you like there, but remember that it will only be
|
||||
// when PCs or NESS creatures are in the area. The second argument is the
|
||||
// time between pseudo-heartbeats. The default is 6.0 seconds, which will
|
||||
// result in Spawn() being called about as often as when you used regular
|
||||
// area heartbeats. If you find you can get away with 10.0 seconds (that's
|
||||
// what I'm currently using) you've reduced your NESS processing by 40%...
|
||||
// The 3rd argument specifies a delay for the first heartbeat after a PC or
|
||||
// PCs enter the area. In areas where there aren't a lot of spawns, and
|
||||
// you are spawning in sight (like NPCs in a store) no delay is ideal. For
|
||||
// outdoor areas with a lot of spawns that spawn away from the player, a
|
||||
// delay helps prevent a spawn lag spike for the entering player. The
|
||||
// default is 0.0 seconds (no delay). I'm currently delaying 3 seconds on
|
||||
// all outdoor and underground areas, but no delay on indoor areas, by
|
||||
// the following in my On Enter script:
|
||||
//
|
||||
// if ( GetIsAreaAboveGround( oCurrArea ) &&
|
||||
// ! GetIsAreaNatural( oCurrArea ) )
|
||||
// {
|
||||
// // Indoors - no delay on the first HB
|
||||
// Spawn_OnAreaEnter( "spawn_sample_hb", 10.0 );
|
||||
// }
|
||||
//
|
||||
// else
|
||||
// {
|
||||
// // Outdoors or underground - do a 3 second delay on the first HB
|
||||
// Spawn_OnAreaEnter( "spawn_sample_hb", 10.0, 3.0 );
|
||||
// }
|
||||
//
|
||||
// Thanks to Mentha Arvensis who provided the starting scripts for pseudo-
|
||||
// heartbeats.
|
||||
//
|
||||
//
|
||||
// +++ Start Version 8.1.1
|
||||
//
|
||||
// 2/1/04 - 5/28/04
|
||||
//
|
||||
//
|
||||
// NESS now allows you to specify the spawn tag by adding a variable, named
|
||||
// "NESS_TAG", on the spawn waypoint. If this variable exists, it will use
|
||||
// it's value as the spawn tag instead of waypoint's tag.
|
||||
//
|
||||
// Always retrieve spawn tag and spawn name from the variables written on
|
||||
// the the spawn instead of using GetTag() an GetName(). This is necessary
|
||||
// to support use of the "NESS" and "NESS_TAG" variables.
|
||||
//
|
||||
// Added a global flag, bLeftoversForceProcessing, to indicate whether or
|
||||
// not spawned creatures in an area should cause NESS processing when no
|
||||
// PCs are in the area. Default is TRUE (they do) which is how things
|
||||
// worked before the flag was added. The flag essentially gives you the
|
||||
// ability to suppress that behavior. To do so, set
|
||||
// bLeftoversForceProcessing to FALSE in your spawn_cfg_global script.
|
||||
//
|
||||
// Added some bullet-proofing to check that spawn waypoints remain valid
|
||||
// objects.
|
||||
//
|
||||
// Turned off ALL NESS processing of creatures that are DM possessed.
|
||||
//
|
||||
// Make sure a patrol waypoint actually exists before attempting to move to
|
||||
// it.
|
||||
//
|
||||
// Normal Camp behavior is to despawn when all creatures in the camp have
|
||||
// been destroyed. However, they were also despawning if there were never
|
||||
// any creatures in the camp to begin with (a placeable-only camp). This
|
||||
// was fixed.
|
||||
//
|
||||
// Loot/corpse decay was not working properly on camps, as the changes to
|
||||
// this system to the regular spawns was never propagated to the camps.
|
||||
// Fixed.
|
||||
//
|
||||
// +++ Start Version 8.1.2
|
||||
//
|
||||
// 5/30/04
|
||||
//
|
||||
// Advance routes to their next stop when patrol waypoints are missing
|
||||
//
|
||||
// +++ Start Version 8.1.3
|
||||
//
|
||||
// 7/04/04
|
||||
//
|
||||
// Write a local var onto entering PCs which can be checked on area exit
|
||||
// to maintain a proper PC count. This is necessary because GetIsPC() does
|
||||
// not work when a PC logs out.
|
||||
//
|
||||
// Don't call NESS_CleanInventory on camp placeables when a camp is
|
||||
// destroyed, as the placeables may remain for a while.
|
||||
//
|
||||
// 7/05/04
|
||||
//
|
||||
// Added code to detect stalled patrol routes and jump the creature to it's
|
||||
// intended destination. This can be turned off by setting
|
||||
// CheckForStuckPatrols global variable to FALSE.
|
||||
//
|
||||
// Write oSpawn onto the camp object "before" the call to SetCampSpawn() so
|
||||
// it is available to that function.
|
||||
//
|
||||
// Added flag to turn off corpse destruction when CD is not specified.
|
||||
//
|
||||
// Added additional on area enter script with indoor/outdoor checking to
|
||||
// determine if an initial delay should be used.
|
||||
//
|
||||
// 7/06/04
|
||||
//
|
||||
// Added check to randomWalk for ACTION_CASTSPELL to avoid interruptions
|
694
_module/nss/spawn__readme.nss
Normal file
694
_module/nss/spawn__readme.nss
Normal file
@@ -0,0 +1,694 @@
|
||||
//
|
||||
//
|
||||
// NESS
|
||||
// Version 8.1.2
|
||||
// Spawn Readme
|
||||
//
|
||||
//
|
||||
// Neshke Narovken (Original Author)
|
||||
//
|
||||
// Cereborn (Maintainer)
|
||||
//
|
||||
//*******************************************************************
|
||||
//
|
||||
//
|
||||
// INCLUDES:
|
||||
//
|
||||
// Do NOT Modify Main Script:
|
||||
//
|
||||
// Spawn: 'spawn_main'
|
||||
//
|
||||
// Do NOT Modify Helper Scripts:
|
||||
//
|
||||
// Information: 'spawn__readme'
|
||||
// Functions: 'spawn_functions'
|
||||
// Corpse Death: 'spawn_corpse_dth'
|
||||
// Corpse Decay: 'spawn_corpse_dcy'
|
||||
// Global Defaults: 'spawn_defaults'
|
||||
// Flag Parsing: 'spawn_flags'
|
||||
// Pseudo-heartbeat 'spawn_pseudohb"
|
||||
//
|
||||
// Lootable corpse event scripts:
|
||||
|
||||
// Corpse On Open: 'spawn_onopencrp'
|
||||
// Corpse On Closed: 'spawn_oncloscrp'
|
||||
// Corpse disturbed: 'spawn_dist_corps'
|
||||
// Corpse used: 'spawn_used_corps'
|
||||
//
|
||||
//
|
||||
// CONFIGURATION:
|
||||
//
|
||||
// Modify Configuration Includes if Needed
|
||||
// Only where Specified in Each File:
|
||||
//
|
||||
// Spawn Flags: 'spawn_cfg_flag'
|
||||
// Spawn Groups: 'spawn_cfg_group'
|
||||
// Loot Tables: 'spawn_cfg_loot'
|
||||
// Spawn Camps: 'spawn_cfg_camp'
|
||||
// Spawn Effects: 'spawn_cfg_fxsp'
|
||||
// Area Effects: 'spawn_cfg_fxae'
|
||||
// Object Effects: 'spawn_cfg_fxobj'
|
||||
// User Defaults: 'spawn_cfg_global'
|
||||
// Custom Flags: 'spawn_cfg_cusflg'
|
||||
//
|
||||
// Modify Check Includes if Needed
|
||||
// Only where Specified in each File:
|
||||
//
|
||||
// Check PCs: 'spawn_chk_pcs'
|
||||
// Custom Check: 'spawn_chk_custom'
|
||||
//
|
||||
// Modify Scripting Includes if Needed
|
||||
// Only where Specified in Each File:
|
||||
//
|
||||
// Spawn/Despawn: 'spawn_sc_spawn'
|
||||
// Heartbeat: 'spawn_sc_hbeat'
|
||||
// Death: 'spawn_sc_death'
|
||||
// Deactivation: 'spawn_sc_deactiv'
|
||||
// Camp Trigger: 'spawn_sc_cmptrig'
|
||||
// Patrol Stops: 'spawn_sc_patrol'
|
||||
//
|
||||
//
|
||||
// USAGE:
|
||||
//
|
||||
// Add Following to Area Heartbeat:
|
||||
//
|
||||
// Sample Script: 'spawn_sample_hb'
|
||||
//
|
||||
// #include "spawn_main"
|
||||
// Spawn();
|
||||
//
|
||||
// Add Spawn Waypoints
|
||||
// All Switches Optional
|
||||
//
|
||||
// Waypoint Name:
|
||||
// SP_<Spawn Flags>
|
||||
//
|
||||
// Waypoint Tag:
|
||||
// Child Object Tag/ResRef
|
||||
// Group Designation
|
||||
// Camp Designation
|
||||
//
|
||||
// Note:
|
||||
// For Custom Creatures
|
||||
// You must use the ResRef
|
||||
//
|
||||
// Available Flags:
|
||||
// SPnOn_ISnDn_IDn_FTn_SNnMn_SAnMn_SRnMnP_SDnMn_CLnMn
|
||||
// _RGnMnCn_RWRn_DYnTn_HRnTn_DOD_NOD_PCnR_SF_SUnIn_FXnDn
|
||||
// _PRnTn_PLnTn_EEnRn_EXnRn_SG_CDnTnRnD_LTnAnBnCn_DSnSn_DIn_CMDn
|
||||
// _SSnDn_CCn_CPnRn_TRnDn_AEnDn_OEnDn_RSn_FCn
|
||||
// _ALnSn_HBn_SLnRnI_RHDn_DTn_HLnE_IT_ST_PT_SM_CF
|
||||
// _SXn_NL_SB_ELn
|
||||
//
|
||||
//
|
||||
// Format:
|
||||
// Flag|OptionalFlag
|
||||
//
|
||||
//
|
||||
// SPn|On
|
||||
// : Designates Spawn Waypoint
|
||||
// : SP is Required on all Spawn Waypoints
|
||||
// : Performs Spawn processing every SP1 to SP99 heartbeats
|
||||
// : Default is SP1 Heartbeat : ~6 Seconds
|
||||
// : SP00 Defaults to SP01
|
||||
// : Optional Flag: On
|
||||
// : Offset processing spawn from first process by n heartbeats.
|
||||
// : Used to stagger spawn processing within an area
|
||||
//
|
||||
// ISn|Dn
|
||||
// : Initial State
|
||||
// : Type 0 : Inactive
|
||||
// : Type 1 : Default : Active
|
||||
// : Optional Flag: D000
|
||||
// : Delay Initial Spawn D000 Minutes
|
||||
//
|
||||
// IDn
|
||||
// : SpawnID
|
||||
// : Sets LocalInt "SpawnID" to SpawnID
|
||||
// : On Spawn Waypoint Object
|
||||
//
|
||||
// FTn
|
||||
// : Flag Table
|
||||
// : Use Flags from Table FT00
|
||||
// : Flags are Defined in 'spawn_cfg_flag'
|
||||
//
|
||||
//
|
||||
// SNn|Mn
|
||||
// : Spawn Number
|
||||
// : Maintains a Spawn of SN00 to SN99 Children
|
||||
// : Despawns Extra Children
|
||||
// : Optional Flag: M00
|
||||
// : Minimum Children
|
||||
// : Will Randomly Spawn between M00 and SN00 Children
|
||||
//
|
||||
// SA|n|Mn
|
||||
// : Spawn All at Once
|
||||
// : Default is Spawn One Child per Cycle
|
||||
// : Optional Flag: 00
|
||||
// : Spawn 00 Children per Cycle
|
||||
// : Optional Flag: M00
|
||||
// : Spawn Minimum M00 per Cycle
|
||||
//
|
||||
// SRn|Mn|P
|
||||
// : Spawn Radius
|
||||
// : Randomly Spawns Children in a
|
||||
// : Location SR00 to SR99 Meters from Waypoint
|
||||
// : Optional Flag: M00
|
||||
// : Minimum Radius, M00 to SR99 Meters
|
||||
// : Optional Flag: P
|
||||
// : Spawn Center is Near a Random PC in Area
|
||||
//
|
||||
// SDn|Mn|P
|
||||
// : Spawn Delay
|
||||
// : Delay SD00 to SD99 Minutes between Spawns
|
||||
// : Optional Flag: M00
|
||||
// : Minimum Delay, M00 to SD99 Minutes
|
||||
// : Optional Flag: P
|
||||
// : This flag sets up a spawn period, whereas the default spawn delay
|
||||
// : specifies a spacing between spawns.
|
||||
// : This is particularly useful with PL3 (keep the times the same on
|
||||
// : each) it will cause the placeable to refresh if alive or respawn
|
||||
// : if not on a regular schedule. Note that if the P subflag is used,
|
||||
// : the M subflag is ignored.
|
||||
//
|
||||
//
|
||||
// CLn|Mn
|
||||
// : Child Lifespan
|
||||
// : Child will Despawn after CL00 Minutes
|
||||
// : Optional Flag: M00
|
||||
// : Child will Despawn after M00 to CL00 Minutes
|
||||
//
|
||||
// DYn|Tn
|
||||
// : Spawn Day
|
||||
// : Spawn Only on Day DY00 to DY28
|
||||
// : Children are Despawned during Invalid Days
|
||||
// : Optional Flag: T00
|
||||
// : Spawn from Day DY00 to Day T00
|
||||
//
|
||||
// HRn|Tn
|
||||
// : Spawn Hour
|
||||
// : Spawn Only during Hour HR00 to HR24
|
||||
// : Children are Despawned during Invalid Hours
|
||||
// : Optional Flag: T00
|
||||
// : Spawn from Hour HR00 to Hour T00
|
||||
//
|
||||
// DO|D
|
||||
// : Day Only
|
||||
// : Only Spawns at Day
|
||||
// : Optional Flag: D
|
||||
// : Despawn Children at Nightfall
|
||||
//
|
||||
// NO|D
|
||||
// : Night Only
|
||||
// : Only Spawns at Night
|
||||
// : Optional Flag: D
|
||||
// : Despawn Children at Daybreak
|
||||
//
|
||||
// RW|Rn
|
||||
// : Random Walk
|
||||
// : Children Wander Randomly
|
||||
// : Optional Flag: R00
|
||||
// : WARNING: This is Resource Intensive!!
|
||||
// : Wander Range, R00 to R99 Meters
|
||||
//
|
||||
// PC|n|R
|
||||
// : PC Check
|
||||
// : Only Spawn Children if PCs are in Area
|
||||
// : Children are Despawned if no PCs in Area
|
||||
// : Optional Flag: PC00
|
||||
// : Depawn if no PCs in Area for PC00 Minutes
|
||||
// : Optional Flag: R
|
||||
// : Reset Spawn Point if no PCs are Present
|
||||
//
|
||||
// RGn|Mn|Cn
|
||||
// : Random Gold
|
||||
// : Generates Random Amount of Gold on Children
|
||||
// : From RG000 to RG999 Gold
|
||||
// : Optional Flag: M00
|
||||
// : Minimum Gold Amount
|
||||
// : Optional Flag: C00
|
||||
// : Gold Chance C00% to C99%
|
||||
// : Default 100% chance
|
||||
//
|
||||
// SF
|
||||
// : Spawn Facing
|
||||
// : Set Facing of Children to Match Waypoint
|
||||
// : Default Random Facing
|
||||
//
|
||||
// SUn|In
|
||||
// : Spawn Unseen
|
||||
// : Only Spawn if PCs are not within SU00 to SU99 Meters
|
||||
// : Optional flag: I00
|
||||
// : Use the location of each individual child to determine if that
|
||||
// : child can spawn, instead of using to location of the spawn itself.
|
||||
// : If using SR or SL|R, I00 to I99 additional random locations will be
|
||||
// : attempted
|
||||
//
|
||||
// FXn|Dn
|
||||
// : Spawn Effect
|
||||
// : Spawn in with Effect FX001 to FX999
|
||||
// : Effects are Defined in 'spawn_cfg_fxsp'
|
||||
// : Optional Flag: D000
|
||||
// : Despawn with Effect D001 to D999
|
||||
//
|
||||
// PRn|Tn|C
|
||||
// : Patrol Route
|
||||
// : Assign Waypoints Route PR00 to PR99
|
||||
// : Optional Flag: T0
|
||||
// : Route Type
|
||||
// : 0 - Sequential
|
||||
// : 1 - Circular
|
||||
// : 2 - Random
|
||||
// : 3 - Walk Once/Despawn
|
||||
// : Optional Flag C
|
||||
// : Start at closest waypoint. Does not apply to T2 (random)
|
||||
// :
|
||||
// : Route Name: Variable
|
||||
// : Route Tag: PR00_SN00_PS000_RN_FC_DO_NO_SC000
|
||||
// :
|
||||
// : PR - Route Number 00 to 99
|
||||
// : SN - Stop Number 00 to 99
|
||||
// : PS - Pause 000 to maxint seconds at Stop
|
||||
// : RP - Random additional amount (0 - maxint) added to PS
|
||||
// : RN - Run to Stop
|
||||
// : RR - Percentage chance a Stop will be visited (skipped otherwise)
|
||||
// : SF - Face the Waypoint Direction
|
||||
// : DO - Only Stop here during the Day
|
||||
// : NO - Only Stop here during the Night
|
||||
// : SC - Run script 000 to 999
|
||||
// : Scripts are Defined in 'spawn_sc_patrol'
|
||||
//
|
||||
// EEn|Rn
|
||||
// : Entrance/Exit
|
||||
// : Enter and Exit at Waypoint EE00
|
||||
// : Optional Flag: R
|
||||
// : Choose Random Entrance Exit
|
||||
// : from R00 to EE00
|
||||
// :
|
||||
// : Entrance/Exit Name: Variable
|
||||
// : Entrance/Exit Tag: EE00
|
||||
//
|
||||
// EXn|Rn
|
||||
// : Exit
|
||||
// : Exit at Waypoint EX00
|
||||
// : Optional Flag: R
|
||||
// : Choose Random Exit
|
||||
// : from R00 to EX00
|
||||
// :
|
||||
// : Exit Name: Variable
|
||||
// : Exit Tag: EX00
|
||||
//
|
||||
// PLn|Tn|Pn
|
||||
// : Placeable Object
|
||||
// : Spawns a Placeable Object with Behavior
|
||||
// : Behavior 0: Default Behavior
|
||||
// : Behavior 1: Despawn if Empty
|
||||
// : Behavior 2: Refill if Empty (after spawn delay minutes!)
|
||||
// : Behavior 3: Refresh (despawn/respawn) every P000 minutes; default
|
||||
// : (if no Pn specified) is 60 minutes
|
||||
// : Optional Flag: T00
|
||||
// : Trap Disabled Chance
|
||||
// : 00% to 99% chance of Trap Disabled
|
||||
// : Trap must already be part of Placeable's Template
|
||||
// : Default 100% Chance Trap is Disabled
|
||||
// : Optional Flag: P00
|
||||
// : Refresh period (in minutes)
|
||||
//
|
||||
// SG
|
||||
// : Spawn Group
|
||||
// : Spawn Children from Group
|
||||
// : Waypoint Tag is Defined Group
|
||||
// : Groups are Defined in 'spawn_cfg_group'
|
||||
//
|
||||
// CDn|Tn|Rn|D
|
||||
// : Corpse Decay
|
||||
// : Decay Corpse after CD000 to CD999 Seconds
|
||||
// : Default No Corpse, Standard Loot Bag
|
||||
// : Optional Flag: T
|
||||
// : Corpse Inventory Type
|
||||
// : Type 0: Inventory Items
|
||||
// : Type 1: Inventory & Equipped Items
|
||||
// : Type 2: Inventory Items, if PC Killed
|
||||
// : Type 3: Inventory & Equipped Items, if PC Killed
|
||||
// : Optional Flag: R
|
||||
// : Remains Type
|
||||
// : Type 0: Loot bag
|
||||
// : Type 1: Body
|
||||
// : Type 2: Bones
|
||||
// : Type 3: Potion
|
||||
// : Type 4: Pouch
|
||||
// : Type 5: Scroll
|
||||
// : Type 6: Treasure
|
||||
// : Type 7: None (destroy loot on decay)
|
||||
// : Optional Flag: D
|
||||
// : Drop wielded weapons
|
||||
//
|
||||
// LTn|An|Bn|Cn
|
||||
// : Loot Table
|
||||
// : Spawn Loot on Children from Table LT000 to LT999
|
||||
// : Loot Tables are Defined in 'spawn_cfg_loot'
|
||||
// : LT500 to LT999 currently reserved for merchant-based
|
||||
// : loot tables
|
||||
// : Optional Flag: A000
|
||||
// : When using merchant-based loot tables, the percentage chance that
|
||||
// : only 1 item will spawn. Default is 50%. Values over 100% are truncated
|
||||
// : to 100%
|
||||
// : Optional Flag: B000
|
||||
// : When using merchant-based loot tables, the percentage chance that
|
||||
// : 2 items will spawn. Default is 15%. Values over 100% are truncated
|
||||
// : to 100%
|
||||
// : Optional Flag: C000
|
||||
// : When using merchant-based loot tables, the percentage chance that
|
||||
// : 3 items will spawn. Default is 05%. Values over 100% are truncated
|
||||
// : to 100%
|
||||
//
|
||||
// DSn|Sn
|
||||
// : Deactivate Spawn
|
||||
// : Deactivate Spawn based on Condition
|
||||
// : Type 0: Deactivate if all Children are Dead
|
||||
// : Type 1: Deactivate if Spawn Number has been Spawned
|
||||
// : Type 2: Deactive Spawn until all Children are Dead
|
||||
// : Type 3: Deactivate Spawn after DI00 Children
|
||||
// : Type 4: Deactivate Spawn after DI00 Minutes
|
||||
// : Type 5: Deactivate Spawn after DI00 Cycles
|
||||
// : Type 6: Deactivate when Spawn Count == Spawn Number
|
||||
// : Optional Flag: S000
|
||||
// : Run Script 000 to 999 when Spawn Deactivated
|
||||
// : Scripts are Defined in 'spawn_sc_deactiv'
|
||||
// :
|
||||
// : Can Reactivate by Manually Calling:
|
||||
// : SetLocalInt(oSpawn, "SpawnDeactivated", FALSE);
|
||||
//
|
||||
// DIn
|
||||
// : Deactivation Information
|
||||
//
|
||||
// CM|Dn
|
||||
// : Spawn Camp
|
||||
// : Spawns Camp of Creatures and Placeables
|
||||
// : Waypoint Tag is Defined Camp
|
||||
// : Despawns Camp when all Children Dead
|
||||
// : Camps are Defined in 'spawn_cfg_camp'
|
||||
// : Optional Flag: D000
|
||||
// : Placeables Decay 000 Seconds after Camp Despawn
|
||||
// :
|
||||
// : Camp Children Flags:
|
||||
// :
|
||||
// : RW : Random Walk
|
||||
// : SF : Spawn Facing Camp
|
||||
// : SG : Spawn Group
|
||||
// : LT00 : Loot Table
|
||||
// : CD000|T0 : Corpse Decay
|
||||
// : PL0|T00 : Placeable Type
|
||||
// : Placeable Trap Disabled
|
||||
//
|
||||
// SSn|Dn
|
||||
// : Spawn Script
|
||||
// : Run Script 001 to 999 on Spawn
|
||||
// : Scripts are Defined in 'spawn_sc_spawn'
|
||||
// : Optional Flag: D000
|
||||
// : Run Script 001 to 999 on Despawn
|
||||
//
|
||||
// DTn
|
||||
// : Death Script
|
||||
// : Run Script 001 to 999 on Death
|
||||
// : Scripts are Defined in 'spawn_sc_death'
|
||||
//
|
||||
// CPn|Rn
|
||||
// : Spawn Check PCs
|
||||
// : Check Custom Code to see if Spawn Proceeds
|
||||
// : Custom Code is Defined in 'spawn_chk_pcs'
|
||||
// : Optional Flag: R00
|
||||
// : Check all PCs in Radius R00
|
||||
// : Default Check all PCs in Area
|
||||
//
|
||||
// CCn
|
||||
// : Spawn Check Custom
|
||||
// : Check Custom Code to see if Spawn Proceeds
|
||||
// : Custom Code is Defined in 'spawn_chk_custom'
|
||||
//
|
||||
// TRn|Dn
|
||||
// : Spawn Trigger
|
||||
// : Only Spawns if PC is within 00 Meters
|
||||
// : Optional Flag: D00
|
||||
// : Despawns if PC is not within D00 Meters
|
||||
//
|
||||
// AEn|Dn
|
||||
// : Spawn Area Effect
|
||||
// : Area Effects are Defined in 'spawn_cfg_fxae'
|
||||
// : Waypoint Tag can be "AE" to Spawn only Area Effect
|
||||
// : Optional Flag: D000
|
||||
// : Area Effect Duration of 000 to 999 Seconds
|
||||
// : Duration of 000 means Permanent Area Effect
|
||||
// : Default Duration is 005 Seconds
|
||||
//
|
||||
// OEn|Dn
|
||||
// : Object Effect
|
||||
// : Object Effects are Defined in 'spawn_cfg_fxobj'
|
||||
// : Optional Flag: D000
|
||||
// : Object Effect Duration of 000 to 999 Seconds
|
||||
// : Duration of 000 means Permanent Object Effect
|
||||
// : Default Duration is Permanent
|
||||
//
|
||||
// RSn
|
||||
// : Random Spawn
|
||||
// : Percentage Chance Spawn will Occur
|
||||
// : Default 100% Chance
|
||||
//
|
||||
// FCn
|
||||
// : Spawn Faction
|
||||
// : Change Faction of Children:
|
||||
// : Faction 0: COMMONER
|
||||
// : Faction 1: DEFENDER
|
||||
// : Faction 2: MERCHANT
|
||||
// : Faction 3: HOSTILE
|
||||
// : Faction 4: CUSTOM
|
||||
// : Change Faction to Same as Nearest
|
||||
// : Object with Tag 'SpawnFaction'
|
||||
//
|
||||
// ALn|Sn
|
||||
// : Spawn Alignment
|
||||
// : Shift Alignment of Children
|
||||
// : Alignment 0: Neutral
|
||||
// : Alignment 1: Law
|
||||
// : Alignment 2: Chaos
|
||||
// : Alignment 3: Good
|
||||
// : Alignment 4: Evil
|
||||
// : Alignment 5: All
|
||||
// : Optional Flag: S00
|
||||
// : Shift Alignment by S00
|
||||
// : Default Shift by 10
|
||||
//
|
||||
// HBn
|
||||
// : Heartbeat Script
|
||||
// : Children will Run Script HB000 each Cycle
|
||||
// : Scripts are Defined in 'spawn_sc_hbeat'
|
||||
//
|
||||
// SLn|Rn|I
|
||||
// : Spawn Location
|
||||
// : Spawn Children at Waypoint SL00
|
||||
// : Optional Flag: R
|
||||
// : Choose Random Location
|
||||
// : from R00 to SL00
|
||||
// : Optional Flag: I
|
||||
// : When spawning multiple children, each child takes the next
|
||||
// : waypoint, In order - (first child spawns at SL00, next at SL01, etc.)
|
||||
// :
|
||||
// : Location Name: Variable
|
||||
// : Location Tag: SL00
|
||||
//
|
||||
// RH|Dn
|
||||
// : Return Home
|
||||
// : Child will always Return to Home
|
||||
// : Optional Flag: D00
|
||||
// : Child will Return to Home
|
||||
// : Only if further than D00 Meters
|
||||
//
|
||||
// HL|n|E
|
||||
// : Heal Children if Not in Combat
|
||||
// : Optional Value: 00
|
||||
// : Heal 00% per Cycle
|
||||
//
|
||||
// IT
|
||||
// : Spawn Item
|
||||
// : Spawnpoint Tag is Item Template
|
||||
//
|
||||
// ST
|
||||
// : Spawn Sit
|
||||
// : Children will Sit in Nearest Unoccupied Sittable
|
||||
// : Sittable's Tag must be 'Seat'
|
||||
//
|
||||
// PT
|
||||
// : Spawn Plot
|
||||
// : Sets Children as Plot
|
||||
//
|
||||
// SM
|
||||
// : Spawn Merchant
|
||||
// : Spawnpoint Tag is Merchant Template
|
||||
//
|
||||
// CF
|
||||
// : Custom Flag
|
||||
// : Everything in Spawn Name after CF
|
||||
// : Is Stored in LocalString "CustomFlag"
|
||||
// : On Each Spawned Child
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// Functions for external control. Please use these when possible instead
|
||||
// of modifying variables directly in NESS.
|
||||
//
|
||||
// object NESS_GetSpawnByID(int nSpawnID, object oArea)
|
||||
// : Returns the spawn waypoint in area oArea with ID nSpawnID
|
||||
//
|
||||
// void NESS_ActivateSpawnByID(int nSpawnID, object oArea)
|
||||
// : Activates the spawn in area oArea with ID nSpawnID
|
||||
//
|
||||
// void NESS_DeactivateSpawnByID(int nSpawnID, object oArea)
|
||||
// : Deactivates the spawn in area oArea with ID nSpawnID
|
||||
//
|
||||
// void NESS_ActivateSpawn(object oSpawn)
|
||||
// : Activates spawn oSpawn
|
||||
//
|
||||
// void NESS_DeactivateSpawn(object oSpawn)
|
||||
// : Deactivates spawn oSpawn
|
||||
//
|
||||
// void NESS_ForceProcess(object oSpawn)
|
||||
// : Force spawn oSpawn to be processed next heartbeat (regardless of
|
||||
// : SPxx value)
|
||||
//
|
||||
// void NESS_TrackModuleSpawns(int nFlag=TRUE)
|
||||
// : Enable (nFlag == TRUE) or Disable (nFlag == FALSE) Spawn Tracking
|
||||
//
|
||||
// int NESS_IsModuleSpawnTracking()
|
||||
// : Returns TRUE is spawn tracking is enabled, FALSE otherwise
|
||||
//
|
||||
//
|
||||
// Some Tips and Pointers
|
||||
// - with Thanks to Eliha for Creating this Section
|
||||
//
|
||||
// 1. The .erf script files we import for NWN usually contain .nss and
|
||||
// .utp files.
|
||||
//
|
||||
// 1.1. The .nss files are the Nwn Source Scripts that are in plain text that
|
||||
// we manipulate in the script editor.
|
||||
//
|
||||
// 1.2. The .utp file(s) are objects such as an invisible corpse object that
|
||||
// automatically gets put in the right column of the toolset where you select
|
||||
// the creatures, doors, placeables, etc. under the custom button.
|
||||
//
|
||||
// 2. After importing the .erf and ignoring that it couldn't find the .ncs files
|
||||
// you'll need to save your module then reopen it for the new scripts to appear
|
||||
// in the left column (due to the lack of a refresh button).
|
||||
//
|
||||
// 3. When working in the various configuration scripts you only need to save
|
||||
// them, not compile them. They are just add-ons to the main spawn_sample_hb.nss
|
||||
// script and attempts to compile them will result in errors. The spawn_sc_xxxx
|
||||
// files will compile but even they should just be saved like all the other
|
||||
// spawn_cfg_xxxx scripts.
|
||||
//
|
||||
// 4. When finished editing and saving the various configuration scripts you
|
||||
// will then need to open the spawn_sample_hb script and compile it to integrate
|
||||
// your new changes into the system. If you customized your scripts, saved them,
|
||||
// saved the module, then loaded the game and find nothings working....chances are
|
||||
// you forgot to compile the spawn_sample_hb script after making your changes.
|
||||
//
|
||||
// 5. You can usually tell which script needs to be compiled by noticing which
|
||||
// one needs to be put in an area heartbeat or on an object somewhere, etc.. In
|
||||
// this case, we are adding the spawn_sample_hb to the area heartbeat so it is the
|
||||
// main file and requires compiling.
|
||||
//
|
||||
|
||||
|
||||
//
|
||||
// Package Header
|
||||
//
|
||||
/*
|
||||
NESS Version 8.1.1
|
||||
|
||||
Cereborn
|
||||
|
||||
See 'spawn__readme' for Instructions
|
||||
Ignore all 'Missing Resource' Errors
|
||||
See the NWN Forums for More Info
|
||||
|
||||
Spawn Package:
|
||||
|
||||
NESS Scripts:
|
||||
- spawn__readme
|
||||
- spawn__history
|
||||
- spawn_cfg_camp
|
||||
- spawn_cfg_flag
|
||||
- spawn_cfg_fxae
|
||||
- spawn_cfg_fxobj
|
||||
- spawn_cfg_fxsp
|
||||
- spawn_cfg_global
|
||||
- spawn_cfg_group
|
||||
- spawn_cfg_loot
|
||||
- spawn_cfg_cusflg
|
||||
- spawn_chk_pcs
|
||||
- spawn_chk_custom
|
||||
- spawn_corpse_dcy
|
||||
- spawn_corpse_dth
|
||||
- spawn_defaults
|
||||
- spawn_dist_corps
|
||||
- spawn_flags
|
||||
- spawn_functions
|
||||
- spawn_main
|
||||
- spawn_onopencrp
|
||||
- spawn_oncloscrp
|
||||
- spawn_pseudohb
|
||||
- spawn_sample_hb
|
||||
- spawn_sc_cmptrig
|
||||
- spawn_sc_deactiv
|
||||
- spawn_sc_death
|
||||
- spawn_sc_patrol
|
||||
- spawn_sc_spawn
|
||||
- spawn_smpl_onent
|
||||
- spawn_smpl_onext
|
||||
- spawn_timefuncs
|
||||
- spawn_used_corps
|
||||
|
||||
NESS Resources:
|
||||
- invis_corpse_obj
|
||||
- invis_corpse_bdy
|
||||
- invis_corpse_bon
|
||||
- invis_corpse_pot
|
||||
- invis_corpse_pch
|
||||
- invis_corpse_ser
|
||||
- invis_corpse_tre
|
||||
|
||||
Spawn Banner Scripts:
|
||||
- spawnb_cc_activ
|
||||
- spawnb_cc_dactiv
|
||||
- spawnb_cc_dump
|
||||
- spawnb_cc_nodump
|
||||
- spawnb_cc_notrck
|
||||
- spawnb_cc_nsclog
|
||||
- spawnb_cc_nsdlog
|
||||
- spawnb_cc_sclog
|
||||
- spawnb_cc_sdlog
|
||||
- spawnb_cc_trck
|
||||
- spawnb_main
|
||||
- spawnb_sample_ai
|
||||
- spawnb_sc_activ
|
||||
- spawnb_sc_dactiv
|
||||
- spawnb_sc_disp
|
||||
- spawnb_sc_dump
|
||||
- spawnb_sc_nodump
|
||||
- spawnb_sc_notrck
|
||||
- spawnb_sc_nsdlog
|
||||
- spawnb_sc_sclog
|
||||
- spawnb_sc_sdlog
|
||||
- spawnb_sc_snclog
|
||||
- spawnb_sc_trck
|
||||
|
||||
Spawn Banner Resources:
|
||||
- spawn_ban_rod.uti
|
||||
- spawn_banner.dlg
|
||||
- spawn_ban_a.utp
|
||||
- spawn_ban_d.utp
|
||||
|
||||
|
||||
*/
|
134
_module/nss/spawn_cfg_camp.nss
Normal file
134
_module/nss/spawn_cfg_camp.nss
Normal file
@@ -0,0 +1,134 @@
|
||||
//
|
||||
// Spawn Camp
|
||||
//
|
||||
//
|
||||
// CampNumP
|
||||
// CampNumC
|
||||
// CampRadius
|
||||
// CampTrigger
|
||||
// CampTriggerScript
|
||||
//
|
||||
// RW : Random Walk
|
||||
// SF : Spawn Facing Camp
|
||||
// SG : Spawn Group
|
||||
// LT00 : Loot Table
|
||||
// CD000|T0 : Corpse Decay
|
||||
// PL0|T00 : Placeable Trap Disabled
|
||||
// DT000 : Death Script
|
||||
// RH000 : Return Home
|
||||
//
|
||||
//
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
void SetCampSpawn(object oCamp, string sCamp, location lCamp)
|
||||
{
|
||||
|
||||
//
|
||||
// Place Custom Camps Here
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// Example Camp
|
||||
// One Campfire and 4 Goblins
|
||||
if (sCamp == "goblincamp")
|
||||
{
|
||||
|
||||
// Set Number of Placeables
|
||||
SetLocalInt(oCamp, "CampNumP", 2);
|
||||
// Set Number of Creatures
|
||||
SetLocalInt(oCamp, "CampNumC", 4);
|
||||
// Set Radius of Camp
|
||||
SetLocalFloat(oCamp, "CampRadius", 10.0);
|
||||
|
||||
// Set Creature 0 to be Trigger
|
||||
// Script 00 : Kill him and the Camp Despawns
|
||||
SetLocalString(oCamp, "CampTrigger", "C0");
|
||||
SetLocalInt(oCamp, "CampTriggerScript", 0);
|
||||
|
||||
// Set Placeable 0 to be Camp Center
|
||||
SetLocalString(oCamp, "CampCenter", "P0");
|
||||
|
||||
// Set Placeable 0 and Spawn Flags
|
||||
// First Placeable always Spawns at Center of Camp
|
||||
// If CampCenter Is Not Set
|
||||
SetLocalString(oCamp, "CampP0", "plc_campfrwspit");
|
||||
SetLocalString(oCamp, "CampP0_Flags", "SP_SF");
|
||||
|
||||
// Set Placeable 1 and Spawn Flags
|
||||
SetLocalString(oCamp, "CampP1", "plc_chest1");
|
||||
SetLocalString(oCamp, "CampP1_Flags", "SP_PL3T80P30");
|
||||
|
||||
// Set Creature 0 and Spawn Flags
|
||||
SetLocalString(oCamp, "CampC0", "NW_GOBCHIEFB");
|
||||
SetLocalString(oCamp, "CampC0_Flags", "SP_RW_CD60_RH30");
|
||||
|
||||
// Set Creature 1 and Spawn Flags
|
||||
SetLocalString(oCamp, "CampC1", "goblins_low");
|
||||
SetLocalString(oCamp, "CampC1_Flags", "SP_SF_SG_CD60_RH");
|
||||
|
||||
// Set Creature 2 and Spawn Flags
|
||||
SetLocalString(oCamp, "CampC2", "goblins_low");
|
||||
SetLocalString(oCamp, "CampC2_Flags", "SP_SF_SG_CD60_RH");
|
||||
|
||||
// Set Creature 3 and Spawn Flags
|
||||
SetLocalString(oCamp, "CampC3", "goblins_low");
|
||||
SetLocalString(oCamp, "CampC3_Flags", "SP_SF_SG_CD60_RH");
|
||||
}
|
||||
else if (sCamp == "demoncamp")
|
||||
{
|
||||
|
||||
// Set Number of Placeables
|
||||
SetLocalInt(oCamp, "CampNumP", 2);
|
||||
// Set Number of Creatures
|
||||
SetLocalInt(oCamp, "CampNumC", 4);
|
||||
// Set Radius of Camp
|
||||
SetLocalFloat(oCamp, "CampRadius", 5.0);
|
||||
|
||||
// Set Creature 0 to be Trigger
|
||||
// Script 00 : Kill him and the Camp Despawns
|
||||
SetLocalString(oCamp, "CampTrigger", "C0");
|
||||
SetLocalInt(oCamp, "CampTriggerScript", 0);
|
||||
|
||||
// Set Placeable 0 to be Camp Center
|
||||
SetLocalString(oCamp, "CampCenter", "P0");
|
||||
|
||||
// Set Placeable 0 and Spawn Flags
|
||||
// First Placeable always Spawns at Center of Camp
|
||||
// If CampCenter Is Not Set
|
||||
SetLocalString(oCamp, "CampP0", "plc_campfrwspit");
|
||||
SetLocalString(oCamp, "CampP0_Flags", "SP_SF");
|
||||
|
||||
// Set Placeable 1 and Spawn Flags
|
||||
SetLocalString(oCamp, "CampP1", "plc_chest1");
|
||||
SetLocalString(oCamp, "CampP1_Flags", "SP_PL3T80P30");
|
||||
|
||||
// Set Creature 0 and Spawn Flags
|
||||
SetLocalString(oCamp, "CampC0", "NW_DEMON");
|
||||
SetLocalString(oCamp, "CampC0_Flags", "SP_RW");
|
||||
|
||||
// Set Creature 1 and Spawn Flags
|
||||
SetLocalString(oCamp, "CampC1", "NW_DEMON");
|
||||
SetLocalString(oCamp, "CampC1_Flags", "SP_SF");
|
||||
|
||||
// Set Creature 2 and Spawn Flags
|
||||
SetLocalString(oCamp, "CampC2", "NW_DEMON");
|
||||
SetLocalString(oCamp, "CampC2_Flags", "SP_SF");
|
||||
|
||||
// Set Creature 3 and Spawn Flags
|
||||
SetLocalString(oCamp, "CampC3", "NW_DEMON");
|
||||
SetLocalString(oCamp, "CampC3_Flags", "SP_SF");
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
//
|
||||
}
|
114
_module/nss/spawn_cfg_cusflg.nss
Normal file
114
_module/nss/spawn_cfg_cusflg.nss
Normal file
@@ -0,0 +1,114 @@
|
||||
//
|
||||
// NESS V8.1
|
||||
// Spawn Config Custom Flags
|
||||
//
|
||||
// This file is for the USER to to add support for custom flags. It will
|
||||
// normally not be overwritten by UPDATE releases, so remerging can be avoided.
|
||||
//
|
||||
// ALFA and LoG Custom Flags (included here both as examples and to aid
|
||||
// ALFA builders in switching over to the new methodology)
|
||||
//
|
||||
// SXn
|
||||
// : Suppress XP
|
||||
// : Suppress diminishing returns XP
|
||||
// : SX1 turns suppression on (the default, you may just use SX)
|
||||
// : SX0 turns suppression off for the spawn if it has been put on
|
||||
// : globally (by setting nGlobalSuppressDR to TRUE in spawn_cfg_global)
|
||||
//
|
||||
// NL
|
||||
// : No Loot
|
||||
// : Suppress player corpse looting
|
||||
//
|
||||
// SB
|
||||
// : SuBdual
|
||||
// : Spawn creatures in in subdual mode
|
||||
//
|
||||
// ELn
|
||||
// : Encounter Level
|
||||
// : Set the encounter level for a spawn
|
||||
// : This is used by the ALFA core rules in determining whether or not
|
||||
// : an encounter should result in XP to a given level party. If not
|
||||
// : specified, the CR of the creature killed is used as the EL.
|
||||
//
|
||||
//
|
||||
|
||||
#include "spawn_flags"
|
||||
|
||||
void ParseCustomFlags(object oSpawn, string sFlags)
|
||||
{
|
||||
// Get Defaults. You can set defaults for your custom flags in
|
||||
// spawn_cfg_global
|
||||
object oModule = GetModule();
|
||||
|
||||
int dfSuppressDR = GetLocalInt(oModule, "df_SuppressDR");
|
||||
int dfGlobalSuppressDR = GetLocalInt(oModule, "df_GlobalSuppressDR");
|
||||
int dfEncounterLevel = GetLocalInt(oModule, "df_EncounterLevel");
|
||||
|
||||
|
||||
// NOTE: Because of the unique nature of these flags being present as both
|
||||
// standard flags and custom flags (for back compatibility) only write flags
|
||||
// if they're present!!
|
||||
|
||||
// Initialize Dim Returns Suppression
|
||||
int nSuppressDimReturns = IsFlagPresent(sFlags, "SX");
|
||||
|
||||
if (nSuppressDimReturns)
|
||||
{
|
||||
// If the flag is present, get suppression mode from its value
|
||||
nSuppressDimReturns = GetFlagValue(sFlags, "SX", dfSuppressDR);
|
||||
SetLocalInt(oSpawn, "f_SuppressDimReturns", nSuppressDimReturns);
|
||||
}
|
||||
|
||||
// Initialize Loot Suppression
|
||||
int nSuppressLooting = IsFlagPresent(sFlags, "NL");
|
||||
|
||||
// Record Loot Suppression
|
||||
if (nSuppressLooting)
|
||||
{
|
||||
SetLocalInt(oSpawn, "f_SuppressLooting", nSuppressLooting);
|
||||
}
|
||||
|
||||
// Initialize Subdual Mode
|
||||
int nSubdualMode = IsFlagPresent(sFlags, "SB");
|
||||
|
||||
// Record Subdual Mode
|
||||
if (nSubdualMode)
|
||||
{
|
||||
SetLocalInt(oSpawn, "f_SubdualMode", nSubdualMode);
|
||||
}
|
||||
|
||||
int nEncounterLevel;
|
||||
|
||||
// Initialize Encounter Level
|
||||
if (IsFlagPresent(sFlags, "EL"))
|
||||
{
|
||||
nEncounterLevel = GetFlagValue(sFlags, "EL", dfEncounterLevel);
|
||||
SetLocalInt(oSpawn, "f_EncounterLevel", nEncounterLevel);
|
||||
}
|
||||
}
|
||||
|
||||
void SetupCustomFlags(object oSpawn, object oSpawned)
|
||||
{
|
||||
int nSuppressLooting = GetLocalInt(oSpawn, "f_SuppressLooting");
|
||||
int nSubdualMode = GetLocalInt(oSpawn, "f_SubdualMode");
|
||||
int nEncounterLevel = GetLocalInt(oSpawn, "f_EncounterLevel");
|
||||
|
||||
|
||||
// Set up loot suppression
|
||||
if (nSuppressLooting)
|
||||
{
|
||||
SetLocalInt(oSpawned, "DoNotLoot", TRUE);
|
||||
}
|
||||
|
||||
// Set up subdual mode
|
||||
if (nSubdualMode)
|
||||
{
|
||||
SetLocalInt(oSpawned, "SubdualMode", TRUE);
|
||||
}
|
||||
|
||||
// Set up encounter level
|
||||
if (nEncounterLevel > 0)
|
||||
{
|
||||
SetLocalInt(oSpawned, "AlfaEncounterLevel", nEncounterLevel);
|
||||
}
|
||||
}
|
77
_module/nss/spawn_cfg_flag.nss
Normal file
77
_module/nss/spawn_cfg_flag.nss
Normal file
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// Spawn Flags
|
||||
//
|
||||
void SpawnFlags(object oSpawn, int nFlagTableNumber)
|
||||
{
|
||||
// Initialize Values
|
||||
string sSpawnName = GetLocalString(oSpawn, "f_Flags");
|
||||
string sSpawnTag = GetLocalString(oSpawn, "f_Template");
|
||||
string sFlags, sTemplate;
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// Sample Complex Replacement
|
||||
// Using FT without FT00 will
|
||||
// Default to nFlagTableNumber 0
|
||||
if (nFlagTableNumber == 0)
|
||||
{
|
||||
// Old Method of using SpawnTag
|
||||
if (sSpawnTag == "myspawns")
|
||||
{
|
||||
sFlags = "SP_SN02_SA_RW";
|
||||
sTemplate = "NW_DOG";
|
||||
}
|
||||
|
||||
if (sSpawnTag == "undead")
|
||||
{
|
||||
sFlags = "SP_SNO4";
|
||||
sTemplate = "NW_ZOMBIE01";
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// Sample Simple Replacement Flag
|
||||
// Completely Replaces Flags
|
||||
// On Spawnpoints with FT01
|
||||
if (nFlagTableNumber == 1)
|
||||
{
|
||||
sFlags = "SP_SN04_RW_DOD";
|
||||
sTemplate = "NW_DOG";
|
||||
}
|
||||
//
|
||||
|
||||
// Sample Template Flags
|
||||
// These Flags Get Added
|
||||
// To Spawnpoints with FT02
|
||||
if (nFlagTableNumber == 2)
|
||||
{
|
||||
sFlags = "_RW_PC05R";
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
// Record Values
|
||||
if (sFlags != "")
|
||||
{
|
||||
SetLocalString(oSpawn, "f_Flags", sFlags);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalString(oSpawn, "f_Flags", sSpawnName);
|
||||
}
|
||||
if (sTemplate != "")
|
||||
{
|
||||
SetLocalString(oSpawn, "f_Template", sTemplate);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalString(oSpawn, "f_Template", sSpawnTag);
|
||||
}
|
||||
}
|
75
_module/nss/spawn_cfg_fxae.nss
Normal file
75
_module/nss/spawn_cfg_fxae.nss
Normal file
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// Spawn AreaEffect
|
||||
//
|
||||
int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault);
|
||||
int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault);
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
effect SpawnAreaEffect(object oSpawn)
|
||||
{
|
||||
// Initialize Variables
|
||||
effect eAreaEffect;
|
||||
|
||||
// Initialize Values
|
||||
int nSpawnAreaEffect = GetLocalInt(oSpawn, "f_SpawnAreaEffect");
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
// AreaEffect 00
|
||||
// Dummy AreaEffect - Never Use
|
||||
if (nSpawnAreaEffect == 0)
|
||||
{
|
||||
return eAreaEffect;
|
||||
}
|
||||
//
|
||||
|
||||
// Web, only Visual
|
||||
if (nSpawnAreaEffect == 1)
|
||||
{
|
||||
eAreaEffect = EffectAreaOfEffect(AOE_PER_WEB, "****", "****", "****");
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
// Return the AreaEffect
|
||||
return eAreaEffect;
|
||||
}
|
||||
|
||||
/*
|
||||
0 - AOE_PER_FOGACID
|
||||
1 - AOE_PER_FOGFIRE
|
||||
2 - AOE_PER_FOGSTINK
|
||||
3 - AOE_PER_FOGKILL
|
||||
4 - AOE_PER_FOGMIND
|
||||
18 - AOE_MOB_UNEARTHLY
|
||||
19 - AOE_MOB_MENACE
|
||||
20 - AOE_MOB_UNNATURAL
|
||||
21 - AOE_MOB_STUN
|
||||
22 - AOE_MOB_PROTECTION
|
||||
23 - AOE_MOB_FIRE
|
||||
24 - AOE_MOB_FROST
|
||||
25 - AOE_MOB_ELECTRICAL
|
||||
26 - AOE_PER_FOGGHOUL
|
||||
27 - AOE_MOB_TYRANT_FOG
|
||||
28 - AOE_PER_STORM
|
||||
29 - AOE_PER_INVIS_SPHERE
|
||||
30 - AOE_MOB_SILENCE
|
||||
31 - AOE_PER_DELAY_BLAST_FIREBALL
|
||||
32 - AOE_PER_GREASE
|
||||
33 - AOE_PER_CREEPING_DOOM
|
||||
35 - AOE_MOB_INVISIBILITY_PURGE
|
||||
*/
|
55
_module/nss/spawn_cfg_fxobj.nss
Normal file
55
_module/nss/spawn_cfg_fxobj.nss
Normal file
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// Spawn ObjectEffect
|
||||
//
|
||||
int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault);
|
||||
int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault);
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
effect ObjectEffect(object oSpawn)
|
||||
{
|
||||
// Initialize Variables
|
||||
effect eObjectEffect;
|
||||
|
||||
// Initialize Values
|
||||
int nObjectEffect = GetLocalInt(oSpawn, "f_ObjectEffect");
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// ObjectEffect 00
|
||||
// Dummy ObjectEffect - Never Use
|
||||
if (nObjectEffect == 0)
|
||||
{
|
||||
return eObjectEffect;
|
||||
}
|
||||
//
|
||||
|
||||
// Bard's Song
|
||||
if (nObjectEffect == 1)
|
||||
{
|
||||
eObjectEffect = EffectVisualEffect(VFX_DUR_BARD_SONG);
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
// Return the ObjectEffect
|
||||
return eObjectEffect;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
*/
|
243
_module/nss/spawn_cfg_fxsp.nss
Normal file
243
_module/nss/spawn_cfg_fxsp.nss
Normal file
@@ -0,0 +1,243 @@
|
||||
//
|
||||
// Spawn Effect
|
||||
//
|
||||
int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault);
|
||||
int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault);
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
int SpawnEffect(object oSpawn, int nSpawnEffect, int nDespawnEffect)
|
||||
{
|
||||
// Initialize
|
||||
int nEffect;
|
||||
int nEffectNumber;
|
||||
|
||||
// Initialize Values
|
||||
if (nSpawnEffect == TRUE)
|
||||
{
|
||||
nEffectNumber = GetLocalInt(oSpawn, "f_SpawnEffect");
|
||||
}
|
||||
else if (nDespawnEffect == TRUE)
|
||||
{
|
||||
nEffectNumber = GetLocalInt(oSpawn, "f_DespawnEffect");
|
||||
}
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// Effect 00
|
||||
// Dummy Effect - Never Use
|
||||
if (nEffectNumber == 0)
|
||||
{
|
||||
return nEffect;
|
||||
}
|
||||
//
|
||||
|
||||
// Rotting Corpse Spawn/Despawn
|
||||
if (nEffectNumber == 51)
|
||||
{
|
||||
nEffect = VFX_IMP_DISEASE_S;
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
// Return the Effect
|
||||
return nEffect;
|
||||
}
|
||||
|
||||
/*
|
||||
18 - VFX_FNF_BLINDDEAF
|
||||
19 - VFX_FNF_DISPEL
|
||||
20 - VFX_FNF_DISPEL_DISJUNCTION
|
||||
21 - VFX_FNF_DISPEL_GREATER
|
||||
22 - VFX_FNF_FIREBALL
|
||||
23 - VFX_FNF_FIRESTORM
|
||||
24 - VFX_FNF_IMPLOSION
|
||||
26 - VFX_FNF_MASS_HEAL
|
||||
27 - VFX_FNF_MASS_MIND_AFFECTING
|
||||
28 - VFX_FNF_METEOR_SWARM
|
||||
29 - VFX_FNF_NATURES_BALANCE
|
||||
30 - VFX_FNF_PWKILL
|
||||
31 - VFX_FNF_PWSTUN
|
||||
32 - VFX_FNF_SUMMON_GATE
|
||||
33 - VFX_FNF_SUMMON_MONSTER_1
|
||||
34 - VFX_FNF_SUMMON_MONSTER_2
|
||||
35 - VFX_FNF_SUMMON_MONSTER_3
|
||||
36 - VFX_FNF_SUMMON_UNDEAD
|
||||
37 - VFX_FNF_SUNBEAM
|
||||
38 - VFX_FNF_TIME_STOP
|
||||
39 - VFX_FNF_WAIL_O_BANSHEES
|
||||
40 - VFX_FNF_WEIRD
|
||||
41 - VFX_FNF_WORD
|
||||
42 - VFX_IMP_AC_BONUS
|
||||
43 - VFX_IMP_ACID_L
|
||||
44 - VFX_IMP_ACID_S
|
||||
46 - VFX_IMP_BLIND_DEAF_M
|
||||
47 - VFX_IMP_BREACH
|
||||
48 - VFX_IMP_CONFUSION_S
|
||||
49 - VFX_IMP_DAZED_S
|
||||
50 - VFX_IMP_DEATH
|
||||
51 - VFX_IMP_DISEASE_S
|
||||
52 - VFX_IMP_DISPEL
|
||||
53 - VFX_IMP_DISPEL_DISJUNCTION
|
||||
54 - VFX_IMP_DIVINE_STRIKE_FIRE
|
||||
55 - VFX_IMP_DIVINE_STRIKE_HOLY
|
||||
56 - VFX_IMP_DOMINATE_S
|
||||
57 - VFX_IMP_DOOM
|
||||
58 - VFX_IMP_FEAR_S
|
||||
60 - VFX_IMP_FLAME_M
|
||||
61 - VFX_IMP_FLAME_S
|
||||
62 - VFX_IMP_FROST_L
|
||||
63 - VFX_IMP_FROST_S
|
||||
64 - VFX_IMP_GREASE
|
||||
65 - VFX_IMP_HASTE
|
||||
66 - VFX_IMP_HEALING_G
|
||||
67 - VFX_IMP_HEALING_L
|
||||
68 - VFX_IMP_HEALING_M
|
||||
69 - VFX_IMP_HEALING_S
|
||||
70 - VFX_IMP_HEALING_X
|
||||
71 - VFX_IMP_HOLY_AID
|
||||
72 - VFX_IMP_KNOCK
|
||||
74 - VFX_IMP_LIGHTNING_M
|
||||
75 - VFX_IMP_LIGHTNING_S
|
||||
76 - VFX_IMP_MAGBLUE
|
||||
81 - VFX_IMP_NEGATIVE_ENERGY
|
||||
83 - VFX_IMP_POISON_L
|
||||
84 - VFX_IMP_POISON_S
|
||||
85 - VFX_IMP_POLYMORPH
|
||||
86 - VFX_IMP_PULSE_COLD
|
||||
87 - VFX_IMP_PULSE_FIRE
|
||||
88 - VFX_IMP_PULSE_HOLY
|
||||
89 - VFX_IMP_PULSE_NEGATIVE
|
||||
90 - VFX_IMP_RAISE_DEAD
|
||||
91 - VFX_IMP_REDUCE_ABILITY_SCORE
|
||||
92 - VFX_IMP_REMOVE_CONDITION
|
||||
93 - VFX_IMP_SILENCE
|
||||
94 - VFX_IMP_SLEEP
|
||||
95 - VFX_IMP_SLOW
|
||||
96 - VFX_IMP_SONIC
|
||||
97 - VFX_IMP_STUN
|
||||
98 - VFX_IMP_SUNSTRIKE
|
||||
99 - VFX_IMP_UNSUMMON
|
||||
100 - VFX_COM_SPECIAL_BLUE_RED
|
||||
101 - VFX_COM_SPECIAL_PINK_ORANGE
|
||||
102 - VFX_COM_SPECIAL_RED_WHITE
|
||||
103 - VFX_COM_SPECIAL_RED_ORANGE
|
||||
104 - VFX_COM_SPECIAL_WHITE_BLUE
|
||||
105 - VFX_COM_SPECIAL_WHITE_ORANGE
|
||||
106 - VFX_COM_BLOOD_REG_WIMP
|
||||
107 - VFX_COM_BLOOD_LRG_WIMP
|
||||
108 - VFX_COM_BLOOD_CRT_WIMP
|
||||
109 - VFX_COM_BLOOD_REG_RED
|
||||
110 - VFX_COM_BLOOD_REG_GREEN
|
||||
111 - VFX_COM_BLOOD_REG_YELLOW
|
||||
112 - VFX_COM_BLOOD_LRG_RED
|
||||
113 - VFX_COM_BLOOD_LRG_GREEN
|
||||
114 - VFX_COM_BLOOD_LRG_YELLOW
|
||||
115 - VFX_COM_BLOOD_CRT_RED
|
||||
116 - VFX_COM_BLOOD_CRT_GREEN
|
||||
117 - VFX_COM_BLOOD_CRT_YELLOW
|
||||
118 - FX_COM_SPARKS_PARRY
|
||||
120 - VFX_COM_UNLOAD_MODEL
|
||||
121 - VFX_COM_CHUNK_RED_SMALL
|
||||
122 - VFX_COM_CHUNK_RED_MEDIUM
|
||||
123 - VFX_COM_CHUNK_GREEN_SMALL
|
||||
124 - VFX_COM_CHUNK_GREEN_MEDIUM
|
||||
125 - VFX_COM_CHUNK_YELLOW_SMALL
|
||||
126 - VFX_COM_CHUNK_YELLOW_MEDIUM
|
||||
139 - VFX_IMP_IMPROVE_ABILITY_SCORE
|
||||
140 - VFX_IMP_CHARM
|
||||
141 - VFX_IMP_MAGICAL_VISION
|
||||
144 - VFX_IMP_EVIL_HELP
|
||||
145 - VFX_IMP_GOOD_HELP
|
||||
146 - VFX_IMP_DEATH_WARD
|
||||
149 - VFX_IMP_MAGIC_PROTECTION
|
||||
150 - VFX_IMP_SUPER_HEROISM
|
||||
151 - VFX_FNF_STORM
|
||||
152 - VFX_IMP_ELEMENTAL_PROTECTION
|
||||
181 - VFX_IMP_MIRV
|
||||
183 - VFX_FNF_SOUND_BURST
|
||||
184 - VFX_FNF_STRIKE_HOLY
|
||||
185 - VFX_FNF_LOS_EVIL_10
|
||||
186 - VFX_FNF_LOS_EVIL_20
|
||||
187 - VFX_FNF_LOS_EVIL_30
|
||||
188 - VFX_FNF_LOS_HOLY_10
|
||||
189 - VFX_FNF_LOS_HOLY_20
|
||||
190 - VFX_FNF_LOS_HOLY_30
|
||||
191 - VFX_FNF_LOS_NORMAL_10
|
||||
192 - VFX_FNF_LOS_NORMAL_20
|
||||
193 - VFX_FNF_LOS_NORMAL_30
|
||||
194 - VFX_IMP_HEAD_ACID
|
||||
195 - VFX_IMP_HEAD_FIRE
|
||||
196 - VFX_IMP_HEAD_SONIC
|
||||
197 - VFX_IMP_HEAD_ELECTRICITY
|
||||
198 - VFX_IMP_HEAD_COLD
|
||||
199 - VFX_IMP_HEAD_HOLY
|
||||
200 - VFX_IMP_HEAD_NATURE
|
||||
201 - VFX_IMP_HEAD_HEAL
|
||||
202 - VFX_IMP_HEAD_MIND
|
||||
203 - VFX_IMP_HEAD_EVIL
|
||||
204 - VFX_IMP_HEAD_ODD
|
||||
217 - VFX_IMP_DEATH_L
|
||||
219 - VFX_FNF_SUMMON_CELESTIAL
|
||||
221 - VFX_IMP_RESTORATION_LESSER
|
||||
222 - VFX_IMP_RESTORATION
|
||||
223 - VFX_IMP_RESTORATION_GREATER
|
||||
231 - VFX_FNF_ICESTORM
|
||||
233 - VFX_IMP_MIRV_FLAME
|
||||
234 - VFX_IMP_DESTRUCTION
|
||||
235 - VFX_COM_CHUNK_RED_LARGE
|
||||
236 - VFX_COM_CHUNK_BONE_MEDIUM
|
||||
237 - VFX_COM_BLOOD_SPARK_SMALL
|
||||
238 - VFX_COM_BLOOD_SPARK_MEDIUM
|
||||
239 - VFX_COM_BLOOD_SPARK_LARGE
|
||||
241 - VFX_FNF_HORRID_WILTING
|
||||
246 - VFX_IMP_HARM
|
||||
250 - VFX_IMP_MAGIC_RESISTANCE_USE
|
||||
251 - VFX_IMP_GLOBE_USE
|
||||
252 - VFX_IMP_WILL_SAVING_THROW_USE
|
||||
253 - VFX_IMP_SPIKE_TRAP
|
||||
254 - VFX_IMP_SPELL_MANTLE_USE
|
||||
255 - VFX_IMP_FORTITUDE_SAVING_THROW_USE
|
||||
256 - VFX_IMP_REFLEX_SAVE_THROW_USE
|
||||
257 - VFX_FNF_GAS_EXPLOSION_ACID
|
||||
258 - VFX_FNF_GAS_EXPLOSION_EVIL
|
||||
259 - VFX_FNF_GAS_EXPLOSION_NATURE
|
||||
260 - VFX_FNF_GAS_EXPLOSION_FIRE
|
||||
261 - VFX_FNF_GAS_EXPLOSION_GREASE
|
||||
262 - VFX_FNF_GAS_EXPLOSION_MIND
|
||||
263 - VFX_FNF_SMOKE_PUFF
|
||||
264 - VFX_IMP_PULSE_WATER
|
||||
265 - VFX_IMP_PULSE_WIND
|
||||
266 - VFX_IMP_PULSE_NATURE
|
||||
273 - VFX_IMP_AURA_HOLY
|
||||
274 - VFX_IMP_AURA_UNEARTHLY
|
||||
275 - VFX_IMP_AURA_FEAR
|
||||
276 - VFX_IMP_AURA_NEGATIVE_ENERGY
|
||||
278 - VFX_FNF_HOWL_MIND
|
||||
279 - VFX_FNF_HOWL_ODD
|
||||
280 - VFX_COM_HIT_FIRE
|
||||
281 - VFX_COM_HIT_FROST
|
||||
282 - VFX_COM_HIT_ELECTRICAL
|
||||
283 - VFX_COM_HIT_ACID
|
||||
284 - VFX_COM_HIT_SONIC
|
||||
285 - VFX_FNF_HOWL_WAR_CRY
|
||||
286 - VFX_FNF_SCREEN_SHAKE
|
||||
287 - VFX_FNF_SCREEN_BUMP
|
||||
288 - VFX_COM_HIT_NEGATIVE
|
||||
289 - VFX_COM_HIT_DIVINE
|
||||
290 - VFX_FNF_HOWL_WAR_CRY_FEMALE
|
||||
*/
|
32
_module/nss/spawn_cfg_global.nss
Normal file
32
_module/nss/spawn_cfg_global.nss
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// ALFA NESS V1.2.3
|
||||
// Spawn Global Defaults
|
||||
//
|
||||
// History:
|
||||
// 09/21/03 Cereborn Created
|
||||
//
|
||||
// This file is for the USER to make changes to NESS default values. It will
|
||||
// normally not be overwritten by UPDATE releases, so remerging can be avoided.
|
||||
//
|
||||
|
||||
#include "spawn_defaults"
|
||||
|
||||
void SetUserGlobalDefaults()
|
||||
{
|
||||
// SXn
|
||||
// Set this value to TRUE (or 1) to have dim returns suppression be the default
|
||||
// when no SX flag is present.
|
||||
//
|
||||
// **** uncomment me to make DR off by default
|
||||
// nGlobalSuppressDR = TRUE;
|
||||
|
||||
// This is the default value for the SX flag when no value is specified.
|
||||
// Set to FALSE (or 0) to make SX (without a value) enable dim returns.
|
||||
//
|
||||
// **** uncomment me to make the SX flag (without arguments) turn DR on for
|
||||
// a spawn. Note that this is not strictly necessary, as you can also just use
|
||||
// SX0 on the spawn. This was added for Albereth because he had already created
|
||||
// spawn points using SX without the 0...
|
||||
// nSuppressDR = FALSE;
|
||||
|
||||
}
|
541
_module/nss/spawn_cfg_group.nss
Normal file
541
_module/nss/spawn_cfg_group.nss
Normal file
@@ -0,0 +1,541 @@
|
||||
//
|
||||
// Spawn Groups
|
||||
//
|
||||
//
|
||||
// nChildrenSpawned
|
||||
// : Number of Total Children ever Spawned
|
||||
//
|
||||
// nSpawnCount
|
||||
// : Number of Children currently Alive
|
||||
//
|
||||
// nSpawnNumber
|
||||
// : Number of Children to Maintain at Spawn
|
||||
//
|
||||
// nRandomWalk
|
||||
// : Walking Randomly? TRUE/FALSE
|
||||
//
|
||||
// nPlaceable
|
||||
// : Spawning Placeables? TRUE/FALSE
|
||||
//
|
||||
//
|
||||
int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault);
|
||||
int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault);
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
|
||||
string GetTemplateByCR(int nCR, string sGroupType)
|
||||
{
|
||||
string sRetTemplate;
|
||||
|
||||
if (sGroupType == "outdoor")
|
||||
{
|
||||
switch (nCR)
|
||||
{
|
||||
case 1:
|
||||
switch(d6(1))
|
||||
{
|
||||
case 1: sRetTemplate = "NW_SKELETON"; break;
|
||||
case 2: sRetTemplate = "NW_ZOMBIE01"; break;
|
||||
case 3: sRetTemplate = "NW_NIXIE"; break;
|
||||
case 4: sRetTemplate = "NW_ORCA"; break;
|
||||
case 5: sRetTemplate = "NW_ORCB"; break;
|
||||
case 6: sRetTemplate = "NW_BTLFIRE"; break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch(d4(1))
|
||||
{
|
||||
case 1: sRetTemplate = "NW_KOBOLD004"; break;
|
||||
case 2: sRetTemplate = "NW_KOBOLD005"; break;
|
||||
case 3: sRetTemplate = "NW_KOBOLD003"; break;
|
||||
case 4: sRetTemplate = "NW_PIXIE"; break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch(d4(1))
|
||||
{
|
||||
case 1: sRetTemplate = "NW_BTLBOMB"; break;
|
||||
case 2: sRetTemplate = "NW_BTLFIRE002"; break;
|
||||
case 3: sRetTemplate = "NW_BTLSTINK"; break;
|
||||
case 4: sRetTemplate = "NW_NYMPH"; break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
sRetTemplate = "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else if (sGroupType == "crypt")
|
||||
{
|
||||
switch (nCR)
|
||||
{
|
||||
case 1:
|
||||
switch(d4(1))
|
||||
{
|
||||
case 1:
|
||||
case 2: sRetTemplate = "NW_SKELETON"; break;
|
||||
case 3: sRetTemplate = "NW_ZOMBIE01"; break;
|
||||
case 4: sRetTemplate = "NW_ZOMBIE02"; break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
sRetTemplate = "NW_GHOUL";
|
||||
break;
|
||||
case 3:
|
||||
sRetTemplate = "NW_SHADOW";
|
||||
break;
|
||||
default:
|
||||
sRetTemplate = "";
|
||||
break;
|
||||
} }
|
||||
|
||||
else
|
||||
{
|
||||
// unknown group type
|
||||
sRetTemplate = "";
|
||||
}
|
||||
|
||||
return sRetTemplate;
|
||||
}
|
||||
|
||||
|
||||
// Convert a given EL equivalent and its encounter level,
|
||||
// return the corresponding CR
|
||||
float ConvertELEquivToCR(float fEquiv, float fEncounterLevel)
|
||||
{
|
||||
float fCR, fEquivSq, fTemp;
|
||||
|
||||
if (fEquiv == 0.0)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
fEquivSq = fEquiv * fEquiv;
|
||||
fTemp = log(fEquivSq);
|
||||
fTemp /= log(2.0);
|
||||
fCR = fEncounterLevel + fTemp;
|
||||
|
||||
return fCR;
|
||||
}
|
||||
|
||||
// Convert a given CR to its encounter level equivalent per DMG page 101.
|
||||
float ConvertCRToELEquiv(float fCR, float fEncounterLevel)
|
||||
{
|
||||
if (fCR > fEncounterLevel || fCR < 1.0)
|
||||
{
|
||||
return 1.;
|
||||
}
|
||||
|
||||
float fEquiv, fExponent, fDenom;
|
||||
|
||||
fExponent = fEncounterLevel - fCR;
|
||||
fExponent *= 0.5;
|
||||
fDenom = pow(2.0, fExponent);
|
||||
fEquiv = 1.0 / fDenom;
|
||||
|
||||
return fEquiv;
|
||||
}
|
||||
|
||||
string SpawnGroup(object oSpawn, string sTemplate)
|
||||
{
|
||||
// Initialize
|
||||
string sRetTemplate;
|
||||
|
||||
// Initialize Values
|
||||
int nSpawnNumber = GetLocalInt(oSpawn, "f_SpawnNumber");
|
||||
int nRandomWalk = GetLocalInt(oSpawn, "f_RandomWalk");
|
||||
int nPlaceable = GetLocalInt(oSpawn, "f_Placeable");
|
||||
int nChildrenSpawned = GetLocalInt(oSpawn, "ChildrenSpawned");
|
||||
int nSpawnCount = GetLocalInt(oSpawn, "SpawnCount");
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
if (GetStringLeft(sTemplate, 7) == "scaled_")
|
||||
{
|
||||
float fEncounterLevel;
|
||||
int nScaledInProgress = GetLocalInt(oSpawn, "ScaledInProgress");
|
||||
string sGroupType = GetStringRight(sTemplate,
|
||||
GetStringLength(sTemplate) - 7);
|
||||
|
||||
// First Time in for this encounter?
|
||||
if (! nScaledInProgress)
|
||||
{
|
||||
|
||||
// First time in - find the party level
|
||||
int nTotalPCs = 0;
|
||||
int nTotalPCLevel = 0;
|
||||
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
|
||||
object oPC = GetFirstObjectInArea(oArea);
|
||||
while (oPC != OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsPC(oPC) == TRUE)
|
||||
{
|
||||
nTotalPCs++;
|
||||
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
||||
}
|
||||
oPC = GetNextObjectInArea(oArea);
|
||||
}
|
||||
if (nTotalPCs == 0)
|
||||
{
|
||||
fEncounterLevel = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
fEncounterLevel = IntToFloat(nTotalPCLevel) / IntToFloat(nTotalPCs);
|
||||
}
|
||||
|
||||
// Save this for subsequent calls
|
||||
SetLocalFloat(oSpawn, "ScaledEncounterLevel", fEncounterLevel);
|
||||
|
||||
// We're done when the CRs chosen add up to the
|
||||
// desired encounter level
|
||||
SetLocalInt(oSpawn, "ScaledCallCount", 0);
|
||||
SetLocalInt(oSpawn, "ScaledInProgress", TRUE);
|
||||
}
|
||||
|
||||
|
||||
fEncounterLevel = GetLocalFloat(oSpawn, "ScaledEncounterLevel");
|
||||
int nScaledCallCount = GetLocalInt(oSpawn, "ScaledCallCount");
|
||||
|
||||
// For simplicity, I'm not supporting creatures with CR < 1.0)
|
||||
if (fEncounterLevel < 1.0)
|
||||
{
|
||||
// We're done... No creatures have CR low enough to add to this encounter
|
||||
sRetTemplate = "";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
// randomly choose a CR at or below the remaining (uncovered) encounter
|
||||
// level
|
||||
int nCR = Random(FloatToInt(fEncounterLevel)) + 1;
|
||||
|
||||
// cap to the largest CR we currently support in GetTemplateByCR
|
||||
if (nCR > 3)
|
||||
{
|
||||
nCR = 3;
|
||||
}
|
||||
|
||||
sRetTemplate = GetTemplateByCR(nCR, sGroupType);
|
||||
|
||||
|
||||
// Convert CR to Encounter Level equivalent so it can be correctly
|
||||
// subtracted. This does the real scaling work
|
||||
float fELEquiv = ConvertCRToELEquiv(IntToFloat(nCR), fEncounterLevel);
|
||||
float fElRemaining = 1.0 - fELEquiv;
|
||||
|
||||
fEncounterLevel = ConvertELEquivToCR(fElRemaining, fEncounterLevel);
|
||||
SetLocalFloat(oSpawn, "ScaledEncounterLevel", fEncounterLevel);
|
||||
}
|
||||
|
||||
nScaledCallCount++;
|
||||
SetLocalInt(oSpawn, "ScaledCallCount", nScaledCallCount);
|
||||
|
||||
nSpawnNumber = GetLocalInt(oSpawn, "f_SpawnNumber");
|
||||
|
||||
if (nScaledCallCount >= nSpawnNumber)
|
||||
{
|
||||
// reset...
|
||||
SetLocalInt(oSpawn, "ScaledInProgress", FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
// cr_militia
|
||||
if (sTemplate == "cr_militia")
|
||||
{
|
||||
switch(d2(1))
|
||||
{
|
||||
case 1:
|
||||
sRetTemplate = "cr_militia_m";
|
||||
break;
|
||||
case 2:
|
||||
sRetTemplate = "cr_militia_f";
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// pg_guard
|
||||
if (sTemplate == "pg_guard")
|
||||
{
|
||||
switch(d2(1))
|
||||
{
|
||||
case 1:
|
||||
sRetTemplate = "pg_guard_m";
|
||||
break;
|
||||
case 2:
|
||||
sRetTemplate = "pg_guard_f";
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// Goblins
|
||||
if (sTemplate == "goblins_low")
|
||||
{
|
||||
if (d2(1) == 1)
|
||||
{
|
||||
sRetTemplate = "NW_GOBLINA";
|
||||
}
|
||||
else
|
||||
{
|
||||
sRetTemplate = "NW_GOBLINB";
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// Goblins and Boss
|
||||
if (sTemplate == "gobsnboss")
|
||||
{
|
||||
int nIsBossSpawned = GetLocalInt(oSpawn, "IsBossSpawned");
|
||||
if (nIsBossSpawned == TRUE)
|
||||
{
|
||||
// Find the Boss
|
||||
object oBoss = GetChildByTag(oSpawn, "NW_GOBCHIEFA");
|
||||
|
||||
// Check if Boss is Alive
|
||||
if (oBoss != OBJECT_INVALID && GetIsDead(oBoss) == FALSE)
|
||||
{
|
||||
// He's alive, spawn a Peon to keep him Company
|
||||
sRetTemplate = "NW_GOBLINA";
|
||||
}
|
||||
else
|
||||
{
|
||||
// He's dead, Deactivate Camp!
|
||||
SetLocalInt(oSpawn, "SpawnDeactivated", TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No Boss, so Let's Spawn Him
|
||||
sRetTemplate = "NW_GOBCHIEFA";
|
||||
SetLocalInt(oSpawn, "IsBossSpawned", TRUE);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// Scaled Encounter
|
||||
if (sTemplate == "scaledgobs")
|
||||
{
|
||||
// Initialize Variables
|
||||
int nTotalPCs;
|
||||
int nTotalPCLevel;
|
||||
int nAveragePCLevel;
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
|
||||
// Cycle through PCs in Area
|
||||
object oPC = GetFirstObjectInArea(oArea);
|
||||
while (oPC != OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsPC(oPC) == TRUE)
|
||||
{
|
||||
nTotalPCs++;
|
||||
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
||||
}
|
||||
oPC = GetNextObjectInArea(oArea);
|
||||
}
|
||||
if (nTotalPCs == 0)
|
||||
{
|
||||
nAveragePCLevel = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
||||
}
|
||||
|
||||
// Select a Creature to Spawn
|
||||
switch (nAveragePCLevel)
|
||||
{
|
||||
// Spawn Something with CR 1
|
||||
case 1:
|
||||
sRetTemplate = "cr1creature";
|
||||
break;
|
||||
//
|
||||
|
||||
// Spawn Something with CR 5
|
||||
case 5:
|
||||
sRetTemplate = "cr5creature";
|
||||
break;
|
||||
//
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// Pirates and Boss
|
||||
if (sTemplate == "pirates")
|
||||
{
|
||||
// Delay the Spawn for 45 Minutes
|
||||
if (GetLocalInt(oSpawn, "DelayEnded") == FALSE)
|
||||
{
|
||||
if (GetLocalInt(oSpawn, "DelayStarted") == FALSE)
|
||||
{
|
||||
// Start the Delay
|
||||
SetLocalInt(oSpawn, "DelayStarted", TRUE);
|
||||
DelayCommand(20.0, SetLocalInt(oSpawn, "DelayEnded", TRUE));
|
||||
}
|
||||
sRetTemplate = "";
|
||||
return sRetTemplate;
|
||||
}
|
||||
int nIsBossSpawned = GetLocalInt(oSpawn, "IsBossSpawned");
|
||||
if (nIsBossSpawned == TRUE)
|
||||
{
|
||||
// Find the Boss
|
||||
object oBoss = GetChildByTag(oSpawn, "NW_GOBCHIEFA");
|
||||
|
||||
// Check if Boss is Alive
|
||||
if (oBoss != OBJECT_INVALID && GetIsDead(oBoss) == FALSE)
|
||||
{
|
||||
// He's alive, spawn a Peon to keep him Company
|
||||
sRetTemplate = "NW_GOBLINA";
|
||||
}
|
||||
else
|
||||
{
|
||||
// He's dead, Deactivate Camp!
|
||||
SetLocalInt(oSpawn, "SpawnDeactivated", TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No Boss, so Let's Spawn Him
|
||||
sRetTemplate = "NW_GOBCHIEFA";
|
||||
SetLocalInt(oSpawn, "IsBossSpawned", TRUE);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// Advanced Scaled Encounter
|
||||
if (sTemplate == "advscaled")
|
||||
{
|
||||
//Initalize Variables
|
||||
int nTotalPCs;
|
||||
int nTotalPCLevel;
|
||||
int nAveragePCLevel;
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
|
||||
//Cycle through PCs in area
|
||||
object oPC = GetFirstObjectInArea(oArea);
|
||||
while (oPC != OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsPC(oPC) == TRUE)
|
||||
{
|
||||
nTotalPCs++;
|
||||
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
||||
}
|
||||
oPC = GetNextObjectInArea(oArea);
|
||||
}
|
||||
if (nTotalPCs == 0)
|
||||
{
|
||||
nAveragePCLevel = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
||||
}
|
||||
|
||||
//Select a Creature to Spawn
|
||||
switch (nAveragePCLevel)
|
||||
{
|
||||
//Spawn Something with CR 1
|
||||
case 1:
|
||||
switch (d6())
|
||||
{
|
||||
case 1: sRetTemplate = "cr1example1";
|
||||
case 2: sRetTemplate = "cr1example2";
|
||||
case 3: sRetTemplate = "cr1example3";
|
||||
case 4: sRetTemplate = "cr1example4";
|
||||
case 5: sRetTemplate = "cr1example5";
|
||||
case 6: sRetTemplate = "cr1example6";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// Encounters
|
||||
if (sTemplate == "encounter")
|
||||
{
|
||||
// Declare Variables
|
||||
int nCounter, nCounterMax;
|
||||
string sCurrentTemplate;
|
||||
|
||||
// Retreive and Increment Counter
|
||||
nCounter = GetLocalInt(oSpawn, "GroupCounter");
|
||||
nCounterMax = GetLocalInt(oSpawn, "CounterMax");
|
||||
nCounter++;
|
||||
|
||||
// Retreive CurrentTemplate
|
||||
sCurrentTemplate = GetLocalString(oSpawn, "CurrentTemplate");
|
||||
|
||||
// Check CounterMax
|
||||
if (nCounter > nCounterMax)
|
||||
{
|
||||
sCurrentTemplate = "";
|
||||
nCounter = 1;
|
||||
}
|
||||
|
||||
if (sCurrentTemplate != "")
|
||||
{
|
||||
// Spawn Another CurrentTemplate
|
||||
sRetTemplate = sCurrentTemplate;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Choose New CurrentTemplate and CounterMax
|
||||
switch (Random(2))
|
||||
{
|
||||
// Spawn 1-4 NW_DOGs
|
||||
case 0:
|
||||
sRetTemplate = "NW_DOG";
|
||||
nCounterMax = Random(4) + 1;
|
||||
break;
|
||||
}
|
||||
// Record New CurrentTemplate and CounterMax
|
||||
SetLocalString(oSpawn, "CurrentTemplate", sRetTemplate);
|
||||
SetLocalInt(oSpawn, "CounterMax", nCounterMax);
|
||||
}
|
||||
|
||||
// Record Counter
|
||||
SetLocalInt(oSpawn, "GroupCounter", nCounter);
|
||||
}
|
||||
//
|
||||
|
||||
//
|
||||
if (sTemplate == "kobolds")
|
||||
{
|
||||
int nKobold = Random(6) + 1;
|
||||
sRetTemplate = "NW_KOBOLD00" + IntToString(nKobold);
|
||||
}
|
||||
//
|
||||
//Sily's Groups
|
||||
if (sTemplate == "sily_goblin_scout")
|
||||
{
|
||||
switch(d2(1))
|
||||
{
|
||||
case 1:
|
||||
sRetTemplate = "an_goblin";
|
||||
break;
|
||||
case 2:
|
||||
sRetTemplate = "an_goblin2";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
return sRetTemplate;
|
||||
}
|
162
_module/nss/spawn_cfg_loot.nss
Normal file
162
_module/nss/spawn_cfg_loot.nss
Normal file
@@ -0,0 +1,162 @@
|
||||
//
|
||||
// Spawn Loot
|
||||
//
|
||||
// History:
|
||||
// --/--/-- Neshke Created
|
||||
// 12/03/02 Cereborn Added DanielleB's merchant-based loot tables
|
||||
// 12/31/02 Cereborn Use newly added flags for determining the
|
||||
// probabilities of 1,2, or 3 item drops from
|
||||
// merchant-based (LT500-LT999) loot tables.
|
||||
// Fixed an off-by-one bug in the item choosing
|
||||
// code for for merchant-based loot tables. The
|
||||
// code was trying to take items 2 through n+1.
|
||||
//
|
||||
int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault);
|
||||
int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault);
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
void CleanInventory(object oSpawned);
|
||||
//
|
||||
//
|
||||
void LootTable(object oSpawn, object oSpawned, int nLootTable)
|
||||
{
|
||||
// Initialize
|
||||
object oItem;
|
||||
string sTemplate;
|
||||
int nStack = 1;
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
// Table 00
|
||||
if (nLootTable == 0)
|
||||
{
|
||||
// 50% Chance
|
||||
if (d100(1) > 50)
|
||||
{
|
||||
// Created Custom Item with ResRef of magicsword
|
||||
sTemplate = "magicsword";
|
||||
nStack = 1;
|
||||
}
|
||||
oItem = CreateItemOnObject(sTemplate, oSpawned, nStack);
|
||||
}
|
||||
//
|
||||
|
||||
// Random Gold and *Nothing* Else
|
||||
else if (nLootTable == 1)
|
||||
{
|
||||
CleanInventory(oSpawned);
|
||||
// Add our Items: Gold for Example
|
||||
nStack = Random(50) + 1;
|
||||
oItem = CreateItemOnObject("nw_it_gold001", oSpawned, nStack);
|
||||
}
|
||||
// Merchant-based loot - from DanieleB NESS scripts
|
||||
else if( nLootTable >= 500 )
|
||||
{
|
||||
object oStore = OBJECT_INVALID;
|
||||
oStore = GetObjectByTag( "LOOT_" + IntToString(nLootTable));
|
||||
|
||||
object oItem;
|
||||
int nCount;
|
||||
int nAmount;
|
||||
if( GetIsObjectValid( oStore ) )
|
||||
{
|
||||
// -- check if we already know item count
|
||||
nCount = GetLocalInt( oStore , "nItemCount" );
|
||||
if( nCount <= 0 )
|
||||
{
|
||||
// -- Count Items in Store Inventory
|
||||
oItem = GetFirstItemInInventory( oStore );
|
||||
while( GetIsObjectValid( oItem ) )
|
||||
{
|
||||
nCount++ ;
|
||||
oItem = GetNextItemInInventory( oStore );
|
||||
}
|
||||
SetLocalInt( oStore , "nItemCount" , nCount );
|
||||
}
|
||||
// -- probability for multiple items
|
||||
nAmount = d100();
|
||||
|
||||
// Cereborn: removed 12/31/02
|
||||
// Old:
|
||||
// int nProbOneItem = 50; // 50% chance 1 item
|
||||
// int nProbTwoItems = 15; // 15% chance 2 items
|
||||
// int nProbThreeItems = 5; // 5% chance 3 items
|
||||
// 30% chance no items ( implied )
|
||||
// New:
|
||||
int nProbOneItem = GetLocalInt(oSpawn, "f_LootTable1ItemChance");
|
||||
int nProbTwoItems = GetLocalInt(oSpawn, "f_LootTable2ItemChance");
|
||||
int nProbThreeItems = GetLocalInt(oSpawn, "f_LootTable3ItemChance");
|
||||
|
||||
if( nAmount <= nProbThreeItems )
|
||||
nAmount = 3;
|
||||
else
|
||||
if( nAmount <= nProbThreeItems + nProbTwoItems )
|
||||
nAmount = 2;
|
||||
else
|
||||
if( nAmount <= nProbThreeItems + nProbTwoItems + nProbOneItem )
|
||||
nAmount = 1;
|
||||
else
|
||||
nAmount = 0;
|
||||
// -- Generate nAmount items on oSpawned
|
||||
while( nAmount > 0 )
|
||||
{
|
||||
// -- Determine random item
|
||||
int nSelected;
|
||||
int nRand = Random( nCount ) + 1;
|
||||
// -- Get the item
|
||||
oItem = GetFirstItemInInventory( oStore );
|
||||
|
||||
for( nSelected = 1 ; nSelected < nRand ; nSelected++ )
|
||||
{
|
||||
oItem = GetNextItemInInventory( oStore );
|
||||
}
|
||||
// -- Grab item template
|
||||
if (oItem != OBJECT_INVALID)
|
||||
{
|
||||
sTemplate = GetResRef( oItem );
|
||||
}
|
||||
|
||||
// -- Checks to see if this it is a ammo or thrown item and creates more in the stack
|
||||
string sRoot = GetStringLowerCase( GetSubString( sTemplate , 0 , 6 ) );
|
||||
if( sRoot == "nw_wam" || sRoot == "nw_wth" )
|
||||
{
|
||||
nStack = Random( 30 ) + 1;
|
||||
}
|
||||
else
|
||||
// -- Check if the item is Gold, and creates more in Stack
|
||||
// small amount generated : gold placement should maybe be handled in some other way.
|
||||
if( GetStringLowerCase( sTemplate ) == "nw_it_gold001" )
|
||||
nStack = Random( 30 ) + 5;
|
||||
else
|
||||
if( nStack < 1 )
|
||||
nStack = 1;
|
||||
// -- create the item on oSpawned
|
||||
oItem = CreateItemOnObject( sTemplate , oSpawned , nStack );
|
||||
// -- decerement the Item Amount counter
|
||||
nAmount--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Write to log
|
||||
PrintString( "Could not find Loot Merchant [" +
|
||||
"LOOT_" +
|
||||
IntToString( nLootTable ) +
|
||||
"] for Spawn Waypoint : " +
|
||||
GetLocalString(oSpawn, "f_Flags") );
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
}
|
103
_module/nss/spawn_chk_custom.nss
Normal file
103
_module/nss/spawn_chk_custom.nss
Normal file
@@ -0,0 +1,103 @@
|
||||
//
|
||||
// Spawn Check - Custom
|
||||
//
|
||||
int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault);
|
||||
int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault);
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
int SpawnCheckCustom(object oSpawn)
|
||||
{
|
||||
// Initialize Values
|
||||
int nSpawnCheckCustom = GetLocalInt(oSpawn, "f_SpawnCheckCustom");
|
||||
|
||||
// Block Spawn by Default
|
||||
int nProcessSpawn = FALSE;
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
// Check 00
|
||||
if (nSpawnCheckCustom == 0)
|
||||
{
|
||||
// Example, Allow Spawn
|
||||
nProcessSpawn = TRUE;
|
||||
}
|
||||
//
|
||||
|
||||
//
|
||||
if (nSpawnCheckCustom == 1)
|
||||
{
|
||||
if (GetIsDawn() == TRUE || GetIsDay() == TRUE)
|
||||
{
|
||||
nProcessSpawn = TRUE;
|
||||
SetLocalInt(oSpawn, "SpawnProcessed", FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
int nSpawnProcessed = GetLocalInt(oSpawn, "SpawnProcessed");
|
||||
if (nSpawnProcessed == FALSE)
|
||||
{
|
||||
nProcessSpawn = TRUE;
|
||||
SetLocalInt(oSpawn, "SpawnProcessed", TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// Reproducing Predators
|
||||
if (nSpawnCheckCustom == 10)
|
||||
{
|
||||
int nChildren = GetLocalInt(oSpawn, "ChildrenSpawned");
|
||||
if (nChildren >= 10)
|
||||
{
|
||||
int nHappy = 0;
|
||||
int nPredators;
|
||||
int nNth = 1;
|
||||
object oPredator = GetNearestObject(OBJECT_TYPE_CREATURE, oSpawn, nNth);
|
||||
while (oPredator != OBJECT_INVALID)
|
||||
{
|
||||
if (GetLocalInt(oPredator, "Predator") == TRUE)
|
||||
{
|
||||
nPredators++;
|
||||
if (GetLocalInt(oPredator, "CurrentHungerState") > 0)
|
||||
{
|
||||
nHappy++;
|
||||
}
|
||||
}
|
||||
nNth++;
|
||||
oPredator = GetNearestObject(OBJECT_TYPE_CREATURE, oSpawn, nNth);
|
||||
}
|
||||
SendMessageToAllDMs("There are " + IntToString(nPredators) + " Predators Alive.");
|
||||
if (nHappy >= 2)
|
||||
{
|
||||
nProcessSpawn = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nProcessSpawn = TRUE;
|
||||
}
|
||||
if (nProcessSpawn == TRUE)
|
||||
{
|
||||
SendMessageToAllDMs("A Predator is Born!");
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
// Return whether Spawn can Proceed
|
||||
return nProcessSpawn;
|
||||
}
|
132
_module/nss/spawn_chk_pcs.nss
Normal file
132
_module/nss/spawn_chk_pcs.nss
Normal file
@@ -0,0 +1,132 @@
|
||||
//
|
||||
// Spawn Check - PCs
|
||||
//
|
||||
int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault);
|
||||
int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault);
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
int SpawnCheckPCs(object oSpawn)
|
||||
{
|
||||
// Initialize Values
|
||||
object oPC;
|
||||
object oArea = GetArea(oSpawn);
|
||||
string sSpawnName = GetLocalString(oSpawn, "f_Flags");
|
||||
location lSpawn = GetLocation(oSpawn);
|
||||
int nCheckPCs = GetLocalInt(oSpawn, "f_SpawnCheckPCs");
|
||||
float fCheckPCsRadius = GetLocalFloat(oSpawn, "f_CheckPCsRadius");
|
||||
|
||||
// Block Spawn by Default
|
||||
int nProcessSpawn = FALSE;
|
||||
|
||||
// Cycle through PCs
|
||||
if (fCheckPCsRadius > -1.0)
|
||||
{
|
||||
oPC = GetFirstObjectInShape(SHAPE_SPHERE, fCheckPCsRadius, lSpawn, FALSE, OBJECT_TYPE_CREATURE);
|
||||
}
|
||||
else
|
||||
{
|
||||
oPC = GetFirstObjectInArea(oArea);
|
||||
}
|
||||
while (oPC != OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsPC(oPC) == TRUE)
|
||||
{
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// Check 00
|
||||
if (nCheckPCs == 0)
|
||||
{
|
||||
// Example, Allow Spawn
|
||||
nProcessSpawn = TRUE;
|
||||
}
|
||||
//
|
||||
|
||||
// Spawn with a Skill Check
|
||||
if (nCheckPCs == 1)
|
||||
{
|
||||
// Get Current Number of Children
|
||||
int nSpawnCount = GetLocalInt(oSpawn, "SpawnCount");
|
||||
|
||||
if (nSpawnCount == 0)
|
||||
{
|
||||
// DC of Hidden Placeable
|
||||
int nItemDC = 20;
|
||||
|
||||
// Player's Skill
|
||||
int nSkill = GetSkillRank(SKILL_SEARCH, oPC);
|
||||
|
||||
// Do Skill Check
|
||||
int nDCCheck = d20() + nSkill;
|
||||
if (nDCCheck >= nItemDC)
|
||||
{
|
||||
// Placeable Spotted!
|
||||
string sSpotted = "You notice a thingamathingy!";
|
||||
FloatingTextStringOnCreature(sSpotted, oPC, TRUE);
|
||||
//Spawn it!
|
||||
nProcessSpawn = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// Spawn Based on Journal Quest Entry
|
||||
if (nCheckPCs == 1)
|
||||
{
|
||||
// Check Journal Quest Entry
|
||||
int nQuest = GetLocalInt(oPC, "NW_JOURNAL_ENTRYQuest1");
|
||||
if (nQuest == 1)
|
||||
{
|
||||
// Quest Entry is 1, Spawn!
|
||||
nProcessSpawn = TRUE;
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// Spawn Based on Item in PC Inventory
|
||||
if (nCheckPCs == 2)
|
||||
{
|
||||
// Check Player for Item
|
||||
object oItem = GetFirstItemInInventory(oPC);
|
||||
while (oItem != OBJECT_INVALID)
|
||||
{
|
||||
if (GetTag(oItem) == "MysticKey")
|
||||
{
|
||||
// Item Found, Spawn!
|
||||
nProcessSpawn = TRUE;
|
||||
}
|
||||
oItem = GetNextItemInInventory(oPC);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
}
|
||||
// Retreive Next PC
|
||||
if (fCheckPCsRadius > -1.0)
|
||||
{
|
||||
oPC = GetNextObjectInShape(SHAPE_SPHERE, fCheckPCsRadius, lSpawn, FALSE, OBJECT_TYPE_CREATURE);
|
||||
}
|
||||
else
|
||||
{
|
||||
oPC = GetNextObjectInArea(oArea);
|
||||
}
|
||||
}
|
||||
|
||||
// Return whether Spawn can Proceed
|
||||
return nProcessSpawn;
|
||||
}
|
62
_module/nss/spawn_corpse_dcy.nss
Normal file
62
_module/nss/spawn_corpse_dcy.nss
Normal file
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// NESS V8.0
|
||||
// Spawn: Corpse Decay Script
|
||||
//
|
||||
//
|
||||
// Do NOT Modify this File
|
||||
// See 'spawn__readme' for Instructions
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oHostBody = OBJECT_SELF;
|
||||
object oLootCorpse = GetLocalObject(oHostBody, "Corpse");
|
||||
object oItem;
|
||||
float fCorpseDecay;
|
||||
|
||||
// Don't Decay while Someone is Looting
|
||||
if (GetIsOpen(oLootCorpse) == TRUE)
|
||||
{
|
||||
// try again
|
||||
fCorpseDecay = GetLocalFloat(oHostBody, "CorpseDecay");
|
||||
DelayCommand(fCorpseDecay, ExecuteScript("spawn_corpse_dcy", oHostBody));
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't Decay if not Empty and Timer not Expired
|
||||
oItem = GetFirstItemInInventory(oLootCorpse);
|
||||
int nDecayTimerExpired = GetLocalInt(oHostBody, "DecayTimerExpired");
|
||||
|
||||
// Don't think this should ever happen, since nDecayTimerExpired should
|
||||
// be set to try by the command immediately beforethe one invoking this
|
||||
// script!
|
||||
if (oItem != OBJECT_INVALID && nDecayTimerExpired == FALSE)
|
||||
{
|
||||
fCorpseDecay = GetLocalFloat(oHostBody, "CorpseDecay");
|
||||
DelayCommand(fCorpseDecay - 0.1, SetLocalInt(oHostBody, "DecayTimerExpired", TRUE));
|
||||
DelayCommand(fCorpseDecay, ExecuteScript("spawn_corpse_dcy", oHostBody));
|
||||
return;
|
||||
}
|
||||
|
||||
int bDeleteLootOnDecay = GetLocalInt(oHostBody, "CorpseDeleteLootOnDecay");
|
||||
|
||||
// To avoid potential memory leaks, we clean everything that might be left on the
|
||||
// original creatures body
|
||||
NESS_CleanCorpse(oHostBody);
|
||||
|
||||
// Destroy all loot if indicated (R7 subflag)
|
||||
if (bDeleteLootOnDecay)
|
||||
{
|
||||
NESS_CleanInventory(oLootCorpse);
|
||||
}
|
||||
|
||||
// Destroy the invis corpse and drop a loot bag (if any loot left)
|
||||
SetPlotFlag(oLootCorpse, FALSE);
|
||||
DestroyObject(oLootCorpse);
|
||||
|
||||
// Destroy the visible corpse
|
||||
SetObjectIsDestroyable(oHostBody, TRUE, FALSE, FALSE);
|
||||
DestroyObject(oHostBody, 0.2);
|
||||
}
|
142
_module/nss/spawn_corpse_dth.nss
Normal file
142
_module/nss/spawn_corpse_dth.nss
Normal file
@@ -0,0 +1,142 @@
|
||||
//
|
||||
// NESS V8.0
|
||||
// Spawn : Corpse Death Script
|
||||
//
|
||||
//
|
||||
// Do NOT Modify this File
|
||||
// See 'spawn__readme' for Instructions
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void CopyItemVarsAndPlot(object oSource, object oInventory)
|
||||
{
|
||||
int bWasPlot = GetPlotFlag(oSource);
|
||||
object oNewItem = CopyItem(oSource, oInventory, TRUE);
|
||||
if (bWasPlot == TRUE)
|
||||
{
|
||||
SetPlotFlag(oNewItem,TRUE);
|
||||
}
|
||||
}
|
||||
// Strip everything droppable in the regular inventory, too.
|
||||
void LootInventoryAndPreserveVars(object oVictim, object oCorpse)
|
||||
{
|
||||
object oItem = GetFirstItemInInventory(oVictim);
|
||||
while (GetIsObjectValid(oItem)) {
|
||||
if (GetDroppableFlag(oItem)) {
|
||||
// Copy to the corpse and destroy
|
||||
CopyItemVarsAndPlot(oItem, oCorpse);
|
||||
DestroyObject(oItem, 0.1);
|
||||
}
|
||||
oItem = GetNextItemInInventory(oVictim);
|
||||
}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oDeadNPC = OBJECT_SELF;
|
||||
object oLootCorpse, oBlood;
|
||||
location lCorpseLoc = GetLocation(oDeadNPC);
|
||||
float fCorpseDecay = GetLocalFloat(oDeadNPC, "CorpseDecay");
|
||||
int nCorpseDecayType = GetLocalInt(oDeadNPC, "CorpseDecayType");
|
||||
int bDropWielded = GetLocalInt(oDeadNPC, "CorpseDropWielded");
|
||||
string sLootCorpseResRef = GetLocalString(oDeadNPC, "CorpseRemainsResRef");
|
||||
struct NESS_CorpseInfo stCorpseInfo;
|
||||
|
||||
int nCorpseGold = FALSE, nCorpseInv = FALSE, nCorpseEquip = FALSE;
|
||||
|
||||
object oKiller = GetLastDamager();
|
||||
if (oKiller == OBJECT_INVALID)
|
||||
{
|
||||
oKiller = GetLastKiller();
|
||||
}
|
||||
|
||||
if (fCorpseDecay > 0.0)
|
||||
{
|
||||
//Protect our corpse from decaying
|
||||
SetIsDestroyable(FALSE, FALSE, FALSE);
|
||||
|
||||
// Create Corpse and Lootable Corpse
|
||||
oLootCorpse = CreateObject(OBJECT_TYPE_PLACEABLE, sLootCorpseResRef, lCorpseLoc);
|
||||
|
||||
SetLocalObject(oLootCorpse, "HostBody", oDeadNPC);
|
||||
SetLocalObject(oDeadNPC, "Corpse", oLootCorpse);
|
||||
|
||||
switch (nCorpseDecayType)
|
||||
{
|
||||
// Type 0:
|
||||
// Inventory Items
|
||||
case 0:
|
||||
nCorpseGold = TRUE;
|
||||
nCorpseInv = TRUE;
|
||||
nCorpseEquip = FALSE;
|
||||
break;
|
||||
|
||||
// Type 1:
|
||||
// Inventory & Equipped Items
|
||||
case 1:
|
||||
nCorpseGold = TRUE;
|
||||
nCorpseInv = TRUE;
|
||||
nCorpseEquip = TRUE;
|
||||
break;
|
||||
|
||||
// Type 2:
|
||||
// Inventory Items, if PC Killed
|
||||
case 2:
|
||||
if (GetIsPC(oKiller) == TRUE || GetIsPC(GetMaster(oKiller)) == TRUE)
|
||||
{
|
||||
nCorpseGold = TRUE;
|
||||
nCorpseInv = TRUE;
|
||||
nCorpseEquip = FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
// Type 3:
|
||||
// Inventory & Equipped Items, if PC Killed
|
||||
case 3:
|
||||
if (GetIsPC(oKiller) == TRUE || GetIsPC(GetMaster(oKiller)) == TRUE)
|
||||
{
|
||||
nCorpseGold = TRUE;
|
||||
nCorpseInv = TRUE;
|
||||
nCorpseEquip = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Get Gold
|
||||
if (nCorpseGold == TRUE)
|
||||
{
|
||||
int nAmtGold = GetGold(oDeadNPC);
|
||||
if(nAmtGold)
|
||||
{
|
||||
object oGold = CreateItemOnObject("nw_it_gold001", oLootCorpse, nAmtGold);
|
||||
AssignCommand(oLootCorpse, TakeGoldFromCreature(nAmtGold, oDeadNPC,TRUE));
|
||||
}
|
||||
}
|
||||
|
||||
// Get Inventory & Equipment
|
||||
if (nCorpseEquip == TRUE)
|
||||
{
|
||||
stCorpseInfo = TransferAllInventorySlots(oDeadNPC, oLootCorpse, bDropWielded);
|
||||
}
|
||||
|
||||
if (nCorpseInv == TRUE)
|
||||
{
|
||||
LootInventoryAndPreserveVars(oDeadNPC, oLootCorpse);
|
||||
}
|
||||
|
||||
// Write a record of stuff left on the original corpse and its loot
|
||||
// corpse counterpart. These are used to remove items from the visual corpse
|
||||
// when the corresponding items are looted
|
||||
SetLocalObject(oLootCorpse, "OrigArmor", stCorpseInfo.origArmor);
|
||||
SetLocalObject(oLootCorpse, "LootArmor", stCorpseInfo.lootArmor);
|
||||
SetLocalObject(oLootCorpse, "OrigRgtWpn", stCorpseInfo.origRgtWpn);
|
||||
SetLocalObject(oLootCorpse, "LootRgtWpn", stCorpseInfo.lootRgtWpn);
|
||||
SetLocalObject(oLootCorpse, "OrigLftWpn", stCorpseInfo.origLftWpn);
|
||||
SetLocalObject(oLootCorpse, "LootLftWpn", stCorpseInfo.lootLftWpn);
|
||||
|
||||
// Set Corpse to Decay
|
||||
DelayCommand(fCorpseDecay - 0.1, SetLocalInt(oDeadNPC, "DecayTimerExpired", TRUE));
|
||||
DelayCommand(fCorpseDecay, ExecuteScript("spawn_corpse_dcy", oDeadNPC));
|
||||
}
|
||||
}
|
306
_module/nss/spawn_defaults.nss
Normal file
306
_module/nss/spawn_defaults.nss
Normal file
@@ -0,0 +1,306 @@
|
||||
//
|
||||
// NESS V8.1.3
|
||||
//
|
||||
// Spawn Global Defaults
|
||||
//
|
||||
//
|
||||
|
||||
// SXn
|
||||
// Set this value to 1 to have dim returns suppression be the default
|
||||
// when no SX flag is present.
|
||||
int nGlobalSuppressDR = 0;
|
||||
|
||||
// This is the default value for the SX flag when no value is specified.
|
||||
// Set to 0 to make SX (without a value) enable dim returns.
|
||||
int nSuppressDR = 1;
|
||||
|
||||
// SPnOn
|
||||
int nProcessFrequency = 1;
|
||||
int nProcessOffset = 0;
|
||||
|
||||
// ISnDn
|
||||
// InitialState
|
||||
int nInitialState = 1;
|
||||
int nInitialDelay = -1;
|
||||
|
||||
// FTn
|
||||
// FlagTable
|
||||
int nFlagTableNumber = 0;
|
||||
|
||||
// SDn|Mn
|
||||
// SpawnDelay
|
||||
int nSpawnDelay = 0;
|
||||
int nDelayMinimum = 0;
|
||||
|
||||
// SNn|Mn SA|n|Mn
|
||||
// SpawnNumber
|
||||
int nSpawnNumber = 1;
|
||||
int nSpawnNumberMin = -1;
|
||||
int nSpawnNumberAtOnce = 0;
|
||||
int nSpawnNumberAtOnceMin = 0;
|
||||
|
||||
// DYn|Tn
|
||||
// SpawnDay
|
||||
int nSpawnDayStart = -1;
|
||||
int nSpawnDayEnd = -1;
|
||||
|
||||
// HRn|Tn
|
||||
// SpawnHour
|
||||
int nSpawnHourStart = -1;
|
||||
int nSpawnHourEnd = -1;
|
||||
|
||||
// RW|Rn
|
||||
// RandomWalk
|
||||
int nWanderRange = 0;
|
||||
|
||||
// RH|Dn
|
||||
// ReturnHome
|
||||
int nReturnHomeRange = 1;
|
||||
|
||||
// PC|n|R
|
||||
// PCCheck
|
||||
int nPCCheckDelay = 0;
|
||||
|
||||
// RGn|Mn|Cn
|
||||
// RandomGold
|
||||
int nRandomGold = 0;
|
||||
int nRandomGoldMin = 0;
|
||||
int nGoldChance = 100;
|
||||
|
||||
// FXn|Dn
|
||||
// SpawnEffects
|
||||
int nSpawnEffect = 0;
|
||||
int nDespawnEffect = 0;
|
||||
|
||||
// PRn|Tn
|
||||
// PatrolRoutes
|
||||
int nPatrolRoute = -1;
|
||||
int nRouteType = 0;
|
||||
|
||||
// PLn|Tn|Pn
|
||||
// Placeables
|
||||
int nPlaceableType = 0;
|
||||
int nPlaceableRefreshPeriod = 60;
|
||||
int nTrapDisabled = 100;
|
||||
|
||||
// LTn|An|Bn|Cn
|
||||
// LootTable
|
||||
int nLootTable = -1;
|
||||
|
||||
// Cereborn: added 12/31/02
|
||||
int nLootTable1ItemChance = 50;
|
||||
int nLootTable2ItemChance = 15;
|
||||
int nLootTable3ItemChance = 5;
|
||||
|
||||
// DSn|Sn
|
||||
// SpawnDeactivation
|
||||
int nDeactivateSpawn = -1;
|
||||
int nDeactivateScript = -1;
|
||||
|
||||
// DIn
|
||||
// DeactivationInfo
|
||||
int nDeactivationInfo = -1;
|
||||
|
||||
// CLn|Mn
|
||||
// ChildLifespan
|
||||
int nChildLifespanMax = -1;
|
||||
int nChildLifespanMin = -1;
|
||||
|
||||
// SRn|Mn|P
|
||||
// SpawnRadius
|
||||
int nSpawnRadius = 0;
|
||||
int nSpawnRadiusMin = 0;
|
||||
|
||||
// SUn|In
|
||||
// SpawnUnseen
|
||||
int nSpawnUnseen = 0;
|
||||
int nUnseenRetryCount = -1;
|
||||
|
||||
// CDn|Tn|Rn|D
|
||||
// CorpseDecay
|
||||
int nCorpseDecay = 0;
|
||||
int nCorpseDecayType = 0;
|
||||
int nCorpseRemainsType = 0;
|
||||
|
||||
// CM|Dn
|
||||
// SpawnCamp
|
||||
int nCampDecay = 0;
|
||||
|
||||
// SSn|Dn
|
||||
// SpawnScript
|
||||
int nSpawnScript = -1;
|
||||
int nDespawnScript = -1;
|
||||
|
||||
// DTn
|
||||
// DeathScript
|
||||
int nDeathScript = -1;
|
||||
|
||||
// CCn
|
||||
// SpawnCheckCustom
|
||||
int nSpawnCheckCustom = -1;
|
||||
|
||||
// CPn|Rn
|
||||
// SpawnCheckPCs
|
||||
int nSpawnCheckPCs = -1;
|
||||
int nCheckPCsRadius = -1;
|
||||
|
||||
// TRn|Dn
|
||||
// SpawnTrigger
|
||||
int nSpawnTrigger = 0;
|
||||
int nDespawnTrigger = 0;
|
||||
|
||||
// AEn|Dn
|
||||
// AreaEffect
|
||||
int nSpawnAreaEffect = 0;
|
||||
int nAreaEffectDuration = 5;
|
||||
|
||||
// OEn|Dn
|
||||
// ObjectEffect
|
||||
int nObjectEffect = 0;
|
||||
int nObjectEffectDuration = -1;
|
||||
|
||||
// RSn
|
||||
// RandomSpawn
|
||||
int nRandomSpawn = 100;
|
||||
|
||||
// FCn
|
||||
// SpawnFaction
|
||||
int nSpawnFaction = -1;
|
||||
|
||||
// ALn|Sn
|
||||
int nSpawnAlignment = -1;
|
||||
int nAlignmentShift = 10;
|
||||
|
||||
// HBn
|
||||
// HeartbeatScript
|
||||
int nHeartbeatScript = -1;
|
||||
|
||||
// SLn|Rn
|
||||
// SpawnLocation
|
||||
int nSpawnLocation = -1;
|
||||
int nSpawnLocationMin = -1;
|
||||
|
||||
// EEn|Rn
|
||||
// EntranceExit
|
||||
int nEntranceExit = -1;
|
||||
int nEntranceExitMin = -1;
|
||||
int nExit = -1;
|
||||
int nExitMin = -1;
|
||||
|
||||
// HL|n|E
|
||||
// HealChildren
|
||||
int nHealChildren = 0;
|
||||
|
||||
// Sittable Tag
|
||||
string sSeatTag = "Seat";
|
||||
|
||||
int nEncounterLevel = 0;
|
||||
int bLeftoversForceProcessing = 1;
|
||||
int bCheckForStuckPatrols = 1;
|
||||
int bAlwaysDestroyCorpses = 1;
|
||||
|
||||
//CS|n|Cn|Tn
|
||||
//Cache Spawn
|
||||
|
||||
int nUseCache = 0; //if you set this to 1 then, by default all flags will assume to have basic caching.
|
||||
int nCacheBucket = 0;
|
||||
int nCacheCondition = 0;
|
||||
int nCacheTiming = 0;
|
||||
|
||||
void SetUserGlobalDefaults();
|
||||
|
||||
void SetGlobalDefaults()
|
||||
{
|
||||
SetUserGlobalDefaults();
|
||||
|
||||
// Record Values
|
||||
object oModule = GetModule();
|
||||
SetLocalInt(oModule, "df_GlobalSuppressDR", nGlobalSuppressDR);
|
||||
SetLocalInt(oModule, "df_SuppressDR", nSuppressDR);
|
||||
SetLocalInt(oModule, "df_processFrequency", nProcessFrequency);
|
||||
SetLocalInt(oModule, "df_processOffset", nProcessOffset);
|
||||
SetLocalInt(oModule, "df_InitialState", nInitialState);
|
||||
SetLocalInt(oModule, "df_InitialDelay", nInitialDelay);
|
||||
SetLocalInt(oModule, "df_FlagTableNumber", nFlagTableNumber);
|
||||
SetLocalInt(oModule, "df_SpawnDelay", nSpawnDelay);
|
||||
SetLocalInt(oModule, "df_DelayMinimum", nDelayMinimum);
|
||||
SetLocalInt(oModule, "df_SpawnNumber", nSpawnNumber);
|
||||
SetLocalInt(oModule, "df_SpawnNumberMin", nSpawnNumberMin);
|
||||
SetLocalInt(oModule, "df_SpawnNumberAtOnce", nSpawnNumberAtOnce);
|
||||
SetLocalInt(oModule, "df_SpawnNumberAtOnceMin", nSpawnNumberAtOnceMin);
|
||||
SetLocalInt(oModule, "df_SpawnDayStart", nSpawnDayStart);
|
||||
SetLocalInt(oModule, "df_SpawnDayEnd", nSpawnDayEnd);
|
||||
SetLocalInt(oModule, "df_SpawnHourStart", nSpawnHourStart);
|
||||
SetLocalInt(oModule, "df_SpawnHourEnd", nSpawnHourEnd);
|
||||
SetLocalInt(oModule, "df_WanderRange", nWanderRange);
|
||||
SetLocalInt(oModule, "df_ReturnHomeRange", nReturnHomeRange);
|
||||
SetLocalInt(oModule, "df_PCCheckDelay", nPCCheckDelay);
|
||||
SetLocalInt(oModule, "df_RandomGold", nRandomGold);
|
||||
SetLocalInt(oModule, "df_RandomGoldMin", nRandomGoldMin);
|
||||
SetLocalInt(oModule, "df_GoldChance", nGoldChance);
|
||||
SetLocalInt(oModule, "df_SpawnEffect", nSpawnEffect);
|
||||
SetLocalInt(oModule, "df_DespawnEffect", nDespawnEffect);
|
||||
SetLocalInt(oModule, "df_PatrolRoute", nPatrolRoute);
|
||||
SetLocalInt(oModule, "df_RouteType", nRouteType);
|
||||
SetLocalInt(oModule, "df_PlaceableType", nPlaceableType);
|
||||
SetLocalInt(oModule, "df_PlaceableRefreshPeriod", nPlaceableRefreshPeriod);
|
||||
SetLocalInt(oModule, "df_TrapDisabled", nTrapDisabled);
|
||||
SetLocalInt(oModule, "df_LootTable", nLootTable);
|
||||
SetLocalInt(oModule, "df_LootTable1ItemChance", nLootTable1ItemChance);
|
||||
SetLocalInt(oModule, "df_LootTable2ItemChance", nLootTable2ItemChance);
|
||||
SetLocalInt(oModule, "df_LootTable3ItemChance", nLootTable3ItemChance);
|
||||
SetLocalInt(oModule, "df_DeactivateSpawn", nDeactivateSpawn);
|
||||
SetLocalInt(oModule, "df_DeactivateScript", nDeactivateScript);
|
||||
SetLocalInt(oModule, "df_DeactivationInfo", nDeactivationInfo);
|
||||
SetLocalInt(oModule, "df_ChildLifespanMax", nChildLifespanMax);
|
||||
SetLocalInt(oModule, "df_ChildLifespanMin", nChildLifespanMin);
|
||||
SetLocalInt(oModule, "df_SpawnRadius", nSpawnRadius);
|
||||
SetLocalInt(oModule, "df_SpawnRadiusMin", nSpawnRadiusMin);
|
||||
SetLocalInt(oModule, "df_SpawnUnseen", nSpawnUnseen);
|
||||
SetLocalInt(oModule, "df_UnseenRetryCount", nUnseenRetryCount);
|
||||
SetLocalInt(oModule, "df_CorpseDecay", nCorpseDecay);
|
||||
SetLocalInt(oModule, "df_CorpseDecayType", nCorpseDecayType);
|
||||
SetLocalInt(oModule, "df_CampDecay", nCampDecay);
|
||||
SetLocalInt(oModule, "df_SpawnScript", nSpawnScript);
|
||||
SetLocalInt(oModule, "df_DespawnScript", nDespawnScript);
|
||||
SetLocalInt(oModule, "df_DeathScript", nDeathScript);
|
||||
SetLocalInt(oModule, "df_SpawnCheckCustom", nSpawnCheckCustom);
|
||||
SetLocalInt(oModule, "df_SpawnCheckPCs", nSpawnCheckPCs);
|
||||
SetLocalInt(oModule, "f_CheckPCsRadius", nCheckPCsRadius);
|
||||
SetLocalInt(oModule, "df_SpawnTrigger", nSpawnTrigger);
|
||||
SetLocalInt(oModule, "df_DespawnTrigger", nDespawnTrigger);
|
||||
SetLocalInt(oModule, "df_SpawnAreaEffect", nSpawnAreaEffect);
|
||||
SetLocalInt(oModule, "df_AreaEffectDuration", nAreaEffectDuration);
|
||||
SetLocalInt(oModule, "df_ObjectEffect", nObjectEffect);
|
||||
SetLocalInt(oModule, "df_ObjectEffectDuration", nObjectEffectDuration);
|
||||
SetLocalInt(oModule, "df_RandomSpawn", nRandomSpawn);
|
||||
SetLocalInt(oModule, "df_SpawnFaction", nSpawnFaction);
|
||||
SetLocalInt(oModule, "df_SpawnAlignment", nSpawnAlignment);
|
||||
SetLocalInt(oModule, "df_AlignmentShift", nAlignmentShift);
|
||||
SetLocalInt(oModule, "df_HeartbeatScript", nHeartbeatScript);
|
||||
SetLocalInt(oModule, "df_SpawnLocation", nSpawnLocation);
|
||||
SetLocalInt(oModule, "df_SpawnLocationMin", nSpawnLocationMin);
|
||||
SetLocalInt(oModule, "df_EntranceExit", nEntranceExit);
|
||||
SetLocalInt(oModule, "df_EntranceExitMin", nEntranceExitMin);
|
||||
SetLocalInt(oModule, "df_Exit", nExit);
|
||||
SetLocalInt(oModule, "df_ExitMin", nExitMin);
|
||||
SetLocalInt(oModule, "df_HealChildren", nHealChildren);
|
||||
SetLocalInt(oModule, "df_EncounterLevel", nEncounterLevel);
|
||||
SetLocalInt(oModule, "df_CorpseRemainsType", nCorpseRemainsType);
|
||||
|
||||
|
||||
SetLocalInt(oModule, "df_UseCache", nUseCache);
|
||||
SetLocalInt(oModule, "df_CacheBucket", nCacheBucket);
|
||||
SetLocalInt(oModule, "df_CacheCondition", nCacheCondition);
|
||||
SetLocalInt(oModule, "df_CacheTiming", nCacheTiming);
|
||||
|
||||
SetLocalInt(oModule, "ModuleSpawnCount", 0);
|
||||
|
||||
SetLocalString(oModule, "df_SeatTag", sSeatTag);
|
||||
SetLocalInt(oModule, "LeftoversForceProcessing", bLeftoversForceProcessing);
|
||||
SetLocalInt(oModule, "CheckForStuckPatrols", bCheckForStuckPatrols);
|
||||
SetLocalInt(oModule, "AlwaysDestroyCorpses", bAlwaysDestroyCorpses);
|
||||
|
||||
// Record Initialization
|
||||
SetLocalInt(oModule, "GlobalDefaultsInitialized", TRUE);
|
||||
}
|
127
_module/nss/spawn_dist_corps.nss
Normal file
127
_module/nss/spawn_dist_corps.nss
Normal file
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// NESS V8.0
|
||||
// Spawn Disturbed Corpse
|
||||
//
|
||||
// Brought into the NESS distribution for Version 8.0 and beyond. Original
|
||||
// header below. This file has been modified from its original form.
|
||||
//
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_ondist_loot // VERSION 1.1 //
|
||||
// // //
|
||||
// by Keron Blackfeld on 07/17/2002 ////////////////////////////
|
||||
// //
|
||||
// email Questions and Comments to: keron@broadswordgaming.com or catch me //
|
||||
// in Bioware's NWN Community - Builder's NWN Scripting Forum //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// This is an OnDisturbed Script to go with my _kb_loot_corpse script for //
|
||||
// LOOTABLE MONSTER/NPC CORPSES. If you were using my _kb_ohb_lootable, be //
|
||||
// sure to remove that script from the onHeartbeat of your lootable, the //
|
||||
// "invis_corpse_obj" placeable. //
|
||||
// //
|
||||
// PLACE THIS SCRIPT IN THE ONDISTURBED EVENT OF YOUR "invis_corpse_obj" //
|
||||
// BLUEPRINT. This script checks the inventory of OBJECT_SELF, and when it //
|
||||
// is empty, it checks the LocalInt to see if the now empty corpse should //
|
||||
// be Destroyed along with the Lootable Corpse Object. This script will also //
|
||||
// checks to see if it should clear its own inventory prior to fading in //
|
||||
// order to prevent a lootbag from appearing. If the inventory is NOT empty, //
|
||||
// it checks to see if the ARMOUR is removed from itself, and if so, it //
|
||||
// destroys the Original Armour on the corpse. //
|
||||
// //
|
||||
// The _kb_loot_corpse script must have this line: //
|
||||
// int nKeepEmpties = FALSE; //
|
||||
// in order for the Empty Corpse to Destroy itself in this script. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// ALFA NESS
|
||||
// Spawn : Loot Corpse Disturbed Script v1.2
|
||||
//
|
||||
//
|
||||
// Do NOT Modify this File
|
||||
// See 'spawn__readme' for Instructions
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
/*******************************************
|
||||
** Here is our main script, which is **
|
||||
** fired if the Inventory is disturbed. **
|
||||
** It then checks to see if it needs to **
|
||||
** either clean up the corpse or Destroy **
|
||||
** the original suit of armor still on **
|
||||
** the corpse. **
|
||||
*******************************************/
|
||||
void main()
|
||||
{
|
||||
//** Get all of our required information
|
||||
|
||||
//Get item that was disturbed to trigger event
|
||||
object oInvDisturbed = GetInventoryDisturbItem();
|
||||
|
||||
//Get type of inventory disturbance
|
||||
int nInvDistType = GetInventoryDisturbType();
|
||||
|
||||
// Get Values set by spawn_corpse_dth at creation
|
||||
object oHostCorpse = GetLocalObject(OBJECT_SELF, "HostBody");
|
||||
object oOrigArmor = GetLocalObject(OBJECT_SELF, "OrigArmor");
|
||||
object oLootArmor = GetLocalObject(OBJECT_SELF, "LootArmor");
|
||||
object oOrigRgtWpn = GetLocalObject(OBJECT_SELF, "OrigRgtWpn");
|
||||
object oLootRgtWpn = GetLocalObject(OBJECT_SELF, "LootRgtWpn");
|
||||
object oOrigLftWpn = GetLocalObject(OBJECT_SELF, "OrigLftWpn");
|
||||
object oLootLftWpn = GetLocalObject(OBJECT_SELF, "LootLftWpn");
|
||||
|
||||
object oPC = GetLastDisturbed();
|
||||
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0f, 1.2f));
|
||||
|
||||
object oHasInventory = GetFirstItemInInventory(OBJECT_SELF); //Check for inventory
|
||||
if (oHasInventory == OBJECT_INVALID) //If no inventory found
|
||||
{
|
||||
/*******************************************
|
||||
** Delete empty. **
|
||||
*******************************************/
|
||||
NESS_CleanCorpse(oHostCorpse);
|
||||
AssignCommand(oHostCorpse,SetIsDestroyable(TRUE,FALSE,FALSE)); //Set actual corpse to destroyable
|
||||
DestroyObject(oHostCorpse); //Delete the actual Creature Corpse
|
||||
|
||||
DelayCommand(1.0f,DestroyObject(OBJECT_SELF)); //Delete Lootable Object (Self)
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/*******************************************
|
||||
** If not empty, check to see if armor, **
|
||||
** left or right weapons have been **
|
||||
** removed from corpse. **
|
||||
*******************************************/
|
||||
if (nInvDistType == INVENTORY_DISTURB_TYPE_REMOVED)
|
||||
{
|
||||
if (oInvDisturbed == oLootArmor)
|
||||
{
|
||||
/*******************************************
|
||||
** The Armor is gone - destroy original **
|
||||
** armor still showing on corpse. **
|
||||
*******************************************/
|
||||
DestroyObject(oOrigArmor);
|
||||
}
|
||||
|
||||
// We don't do these for now, as the unequip animations look too
|
||||
// damn silly
|
||||
//else if (oInvDisturbed == oLootRgtWpn)
|
||||
//{
|
||||
// DestroyObject(oOrigRgtWpn);
|
||||
//}
|
||||
|
||||
//else if (oInvDisturbed == oLootLftWpn)
|
||||
//{
|
||||
// DestroyObject(oOrigLftWpn);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
154
_module/nss/spawn_flags.nss
Normal file
154
_module/nss/spawn_flags.nss
Normal file
@@ -0,0 +1,154 @@
|
||||
//
|
||||
// NESS V8.0
|
||||
// Spawn Flags
|
||||
//
|
||||
// Do NOT Modify this File
|
||||
// See 'spawn__readme' for Instructions
|
||||
//
|
||||
|
||||
int IsFlagPresent(string sName, string sFlag)
|
||||
{
|
||||
int nPos = FindSubString(sName, sFlag);
|
||||
if (nPos >= 0) // flag found
|
||||
{
|
||||
//debug("flag " + sFlag + " present");
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// This Function parses a String for Flags
|
||||
// When nGetValue is FALSE, this returns TRUE if the flag exists, FALSE otherwise.
|
||||
// nDefault is unused when nGetValue is FALSE.
|
||||
// When nGetValue is TRUE, it returns the value of the flag if it
|
||||
// exists, or nDefault otherwise.
|
||||
int GetFlagValue(string sName, string sFlag, int nDefault)
|
||||
{
|
||||
int nRetValue;
|
||||
int nPos;
|
||||
|
||||
nPos = FindSubString(sName, sFlag);
|
||||
if (nPos >= 0) // flag found
|
||||
{
|
||||
// Trim to the start of the flag
|
||||
sName = GetStringRight(sName, GetStringLength(sName) -
|
||||
(nPos + GetStringLength(sFlag)));
|
||||
|
||||
// find the end of the flag
|
||||
nPos = FindSubString(sName, "_");
|
||||
if (nPos >= 0)
|
||||
{
|
||||
sName = GetStringLeft(sName, nPos);
|
||||
}
|
||||
|
||||
// Retreive Flag
|
||||
if (TestStringAgainstPattern("*n", GetStringLeft(sName, 1)) == FALSE)
|
||||
{
|
||||
// No value specified, use default
|
||||
nRetValue = nDefault;
|
||||
//debug("flag " + sFlag + " - def val = " + IntToString(nRetValue));
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Retrieve Value
|
||||
nRetValue = StringToInt(sName);
|
||||
//debug("flag " + sFlag + " - val = " + IntToString(nRetValue));
|
||||
}
|
||||
}
|
||||
|
||||
else // flag not found at all
|
||||
{
|
||||
nRetValue = nDefault;
|
||||
|
||||
}
|
||||
|
||||
// Return Value
|
||||
return nRetValue;
|
||||
}
|
||||
//
|
||||
|
||||
int IsSubFlagPresent(string sName, string sFlag, string sSubFlag)
|
||||
{
|
||||
int nPos = FindSubString(sName, sFlag);
|
||||
if (nPos >= 0)
|
||||
{
|
||||
// Trim Flag
|
||||
sName = GetStringRight(sName, GetStringLength(sName) -
|
||||
(nPos + GetStringLength(sFlag)));
|
||||
|
||||
nPos = FindSubString(sName, "_");
|
||||
if (nPos >= 0)
|
||||
{
|
||||
sName = GetStringLeft(sName, nPos);
|
||||
}
|
||||
|
||||
// Retreive SubFlag
|
||||
nPos = FindSubString(sName, sSubFlag);
|
||||
if (nPos >= 0)
|
||||
{
|
||||
//debug("flag " + sFlag + "subflag " + sSubFlag + " present");
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// This Function parses a String for a Subvalue from Flags
|
||||
int GetSubFlagValue(string sName, string sFlag, string sSubFlag, int nDefault)
|
||||
{
|
||||
int nRetValue;
|
||||
int nPos;
|
||||
|
||||
nPos = FindSubString(sName, sFlag);
|
||||
if (nPos >= 0)
|
||||
{
|
||||
// Trim Flag
|
||||
sName = GetStringRight(sName, GetStringLength(sName) -
|
||||
(nPos + GetStringLength(sFlag)));
|
||||
|
||||
nPos = FindSubString(sName, "_");
|
||||
|
||||
if (nPos >= 0)
|
||||
{
|
||||
sName = GetStringLeft(sName, nPos);
|
||||
}
|
||||
|
||||
// Retreive SubFlag
|
||||
nPos = FindSubString(sName, sSubFlag);
|
||||
if (nPos >= 0)
|
||||
{
|
||||
sName = GetStringRight(sName, GetStringLength(sName) -
|
||||
(nPos + GetStringLength(sSubFlag)));
|
||||
|
||||
if (TestStringAgainstPattern("*n", GetStringLeft(sName, 1)) == FALSE)
|
||||
{
|
||||
nRetValue = nDefault; // SubFlag found but no value
|
||||
//debug("flag " + sFlag + " subflag " + sSubFlag + " - def val = " +
|
||||
// IntToString(nRetValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Retrieve Value
|
||||
nRetValue = StringToInt(sName); // Subflag (with value) found
|
||||
//debug("flag " + sFlag + " subflag " + sSubFlag + " - val = " +
|
||||
// IntToString(nRetValue));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nRetValue = nDefault; // subflag not found
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nRetValue = nDefault; // Main flag not found
|
||||
}
|
||||
|
||||
// Return Value
|
||||
return nRetValue;
|
||||
}
|
||||
//
|
||||
|
3702
_module/nss/spawn_functions.nss
Normal file
3702
_module/nss/spawn_functions.nss
Normal file
File diff suppressed because it is too large
Load Diff
1906
_module/nss/spawn_main.nss
Normal file
1906
_module/nss/spawn_main.nss
Normal file
File diff suppressed because it is too large
Load Diff
50
_module/nss/spawn_oncloscrp.nss
Normal file
50
_module/nss/spawn_oncloscrp.nss
Normal file
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// NESS V8.1
|
||||
// Spawn On Close Corpse
|
||||
//
|
||||
// Brought into the NESS distribution for Version 8.0 and beyond. Original
|
||||
// header below. Added code to cause immediate decay when emptied.
|
||||
//
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_corpse_sound // VERSION 1.0 //
|
||||
// // //
|
||||
// by Keron Blackfeld on 07/17/2002 ////////////////////////////
|
||||
// //
|
||||
// email Questions and Comments to: keron@broadswordgaming.com or catch me //
|
||||
// in Bioware's NWN Community - Builder's NWN Scripting Forum //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// This script is a simple, albeit weak, attempt to mask the default DOOR //
|
||||
// sounds tied to the invisible lootable object. Please this in both the //
|
||||
// onOpened and onClosed Events of the "invis_corpse_obj" described in my //
|
||||
// _kb_lootable_corpse script. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
effect eQuiet = EffectSilence();
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eQuiet, OBJECT_SELF, 120.0f);
|
||||
PlaySound("as_sw_chestcl1");
|
||||
|
||||
|
||||
object oHasInventory = GetFirstItemInInventory(OBJECT_SELF); //Check for inventory
|
||||
if (oHasInventory == OBJECT_INVALID) //If no inventory found
|
||||
{
|
||||
/*******************************************
|
||||
** Delete empty. **
|
||||
*******************************************/
|
||||
object oHostCorpse = GetLocalObject(OBJECT_SELF, "HostBody");
|
||||
NESS_CleanCorpse(oHostCorpse);
|
||||
AssignCommand(oHostCorpse,SetIsDestroyable(TRUE,FALSE,FALSE)); //Set actual corpse to destroyable
|
||||
DestroyObject(oHostCorpse); //Delete the actual Creature Corpse
|
||||
|
||||
DelayCommand(1.0f,DestroyObject(OBJECT_SELF)); //Delete Lootable Object (Self)
|
||||
|
||||
}
|
||||
}
|
33
_module/nss/spawn_onopencrp.nss
Normal file
33
_module/nss/spawn_onopencrp.nss
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// NESS V8.1
|
||||
// Spawn On Open Corpse
|
||||
//
|
||||
// Brought into the NESS distribution for Version 8.0 and beyond. Original
|
||||
// header below.
|
||||
//
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_corpse_sound // VERSION 1.0 //
|
||||
// // //
|
||||
// by Keron Blackfeld on 07/17/2002 ////////////////////////////
|
||||
// //
|
||||
// email Questions and Comments to: keron@broadswordgaming.com or catch me //
|
||||
// in Bioware's NWN Community - Builder's NWN Scripting Forum //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// This script is a simple, albeit weak, attempt to mask the default DOOR //
|
||||
// sounds tied to the invisible lootable object. Please this in both the //
|
||||
// onOpened and onClosed Events of the "invis_corpse_obj" described in my //
|
||||
// _kb_lootable_corpse script. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
effect eQuiet = EffectSilence();
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eQuiet, OBJECT_SELF, 120.0f);
|
||||
PlaySound("as_sw_clothop1");
|
||||
AssignCommand(GetLastOpenedBy(), ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0f, 1.5f));
|
||||
}
|
8
_module/nss/spawn_orig_hb.nss
Normal file
8
_module/nss/spawn_orig_hb.nss
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
#include "spawn_main"
|
||||
|
||||
void main()
|
||||
{
|
||||
Spawn();
|
||||
}
|
||||
|
40
_module/nss/spawn_pseudohb.nss
Normal file
40
_module/nss/spawn_pseudohb.nss
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// NESS V8.1
|
||||
//
|
||||
// Spawn Pseudo-heartbeat
|
||||
//
|
||||
// This script is executed when a PC enters an otherwise empty area
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
object oArea = OBJECT_SELF;
|
||||
|
||||
// No pseudo-heartbeats scheduled, since we just fired this one
|
||||
SetLocalInt( oArea, SPAWN_HEARTBEAT_SCHEDULED, FALSE );
|
||||
|
||||
// Do a heartbeat if there are PCs in the area or any spawns up
|
||||
if ( NeedPseudoHeartbeat( oArea ) )
|
||||
{
|
||||
// This defaults to spawn_sample_hb. You can pass the name of any script
|
||||
// to use in the function Spawn_OnAreaEnter()
|
||||
string sHeartbeatFunc = GetLocalString( oArea, SPAWN_HEARTBEAT_SCRIPT );
|
||||
|
||||
// start actual heartbeat code
|
||||
ExecuteScript( sHeartbeatFunc, oArea );
|
||||
// end actual heartbeat code
|
||||
|
||||
// This function sets SPAWN_HEARTBEAT_SCHEDULED to TRUE
|
||||
ScheduleNextPseudoHeartbeat( oArea );
|
||||
}
|
||||
else
|
||||
{
|
||||
ReleaseAreaRefs(OBJECT_SELF);
|
||||
}
|
||||
|
||||
|
||||
//**FLAG else here to remove refcounts
|
||||
}
|
8
_module/nss/spawn_sample_hb.nss
Normal file
8
_module/nss/spawn_sample_hb.nss
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
#include "spawn_main"
|
||||
|
||||
void main()
|
||||
{
|
||||
Spawn();
|
||||
}
|
||||
|
55
_module/nss/spawn_sc_cmptrig.nss
Normal file
55
_module/nss/spawn_sc_cmptrig.nss
Normal file
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// NESS
|
||||
// Camp Trigger Scripts v8.1.3
|
||||
//
|
||||
//
|
||||
#include "spawn_functions"
|
||||
//
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
void DestroyCamp(object oCamp, float fCampDecay, int nSaveState);
|
||||
//
|
||||
//
|
||||
void main()
|
||||
{
|
||||
// Initialize Variables
|
||||
object oSpawned;
|
||||
string sObject;
|
||||
int iCount, nCampNumP, nCampNumC;
|
||||
|
||||
// Retrieve Script
|
||||
int nCampTriggerScript = GetLocalInt(OBJECT_SELF, "CampTriggerScript");
|
||||
|
||||
// Invalid Script
|
||||
if (nCampTriggerScript == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
object oCamp = OBJECT_SELF;
|
||||
object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn");
|
||||
float fCampDecay = GetLocalFloat(oSpawn, "f_CampDecay");
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// Destroy Camp
|
||||
if (nCampTriggerScript == 0)
|
||||
{
|
||||
DestroyCamp(oCamp, fCampDecay, FALSE);
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
}
|
46
_module/nss/spawn_sc_deactiv.nss
Normal file
46
_module/nss/spawn_sc_deactiv.nss
Normal file
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// Deactivation Scripts
|
||||
//
|
||||
#include "spawn_functions"
|
||||
//
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
void main()
|
||||
{
|
||||
// Retrieve Script
|
||||
int nDeactivateScript = GetLocalInt(OBJECT_SELF, "DeactivateScript");
|
||||
|
||||
// Invalid Script
|
||||
if (nDeactivateScript == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// Script 00
|
||||
if (nDeactivateScript == 0)
|
||||
{
|
||||
// Explode with Gore when Deactivated
|
||||
effect eVisual = EffectVisualEffect(VFX_COM_CHUNK_RED_LARGE);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVisual, GetLocation(OBJECT_SELF), 0.0);
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
}
|
67
_module/nss/spawn_sc_death.nss
Normal file
67
_module/nss/spawn_sc_death.nss
Normal file
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// Death Scripts
|
||||
//
|
||||
#include "spawn_functions"
|
||||
//
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
void main()
|
||||
{
|
||||
// Initialize Variables
|
||||
|
||||
// Retrieve Script Number
|
||||
int nDeathScript = GetLocalInt(OBJECT_SELF, "DeathScript");
|
||||
|
||||
// Invalid Script
|
||||
if (nDeathScript == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// Script 00
|
||||
if (nDeathScript == 0)
|
||||
{
|
||||
}
|
||||
//
|
||||
|
||||
// Scared Prey
|
||||
if (nDeathScript == 10)
|
||||
{
|
||||
object oKiller = GetLastKiller();
|
||||
if (GetLocalInt(oKiller, "Predator") == TRUE)
|
||||
{
|
||||
// Feed the Predator
|
||||
int nCurrentHungerState = GetLocalInt(oKiller, "CurrentHungerState");
|
||||
int nKills = GetLocalInt(oKiller, "Kills");
|
||||
nKills++;
|
||||
int nFed = 5 + (nKills / 25);
|
||||
nCurrentHungerState = nCurrentHungerState + 1 + nFed;
|
||||
SendMessageToAllDMs("Predator is Fed (" + IntToString(nFed) + ").");
|
||||
AssignCommand(oKiller, SpeakString("That's " + IntToString(nKills) + " prey I've killed! I get " + IntToString(nFed) + " more food!"));
|
||||
SetLocalInt(oKiller, "Kills", nKills);
|
||||
SetLocalInt(oKiller, "CurrentHungerState", nCurrentHungerState);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
// Record that we Ran Script
|
||||
SetLocalInt(OBJECT_SELF, "DeathScriptRan", TRUE);
|
||||
}
|
180
_module/nss/spawn_sc_hbeat.nss
Normal file
180
_module/nss/spawn_sc_hbeat.nss
Normal file
@@ -0,0 +1,180 @@
|
||||
//
|
||||
// Heartbeat Scripts
|
||||
//
|
||||
#include "spawn_functions"
|
||||
//
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
void main()
|
||||
{
|
||||
// Retrieve Script Number
|
||||
int nHeartbeatScript = GetLocalInt(OBJECT_SELF, "HeartbeatScript");
|
||||
|
||||
// Invalid Script
|
||||
if (nHeartbeatScript == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// Script 00
|
||||
if (nHeartbeatScript == 0)
|
||||
{
|
||||
if (d2() == 2)
|
||||
{
|
||||
ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
//
|
||||
if (nHeartbeatScript == 2)
|
||||
{
|
||||
object oCentralObject;
|
||||
location lCentralObject, lLocation;
|
||||
vector vCentralObject, vLocation;
|
||||
float fAngle, fRadius, fLocationX, fLocationY;
|
||||
|
||||
// Add Multiple Actions per HeartbeatScript
|
||||
int nNth;
|
||||
for (nNth = 1; nNth <= 10; nNth++)
|
||||
{
|
||||
// Central Object
|
||||
oCentralObject = GetObjectByTag("CentralObject");
|
||||
lCentralObject = GetLocation(oCentralObject);
|
||||
vCentralObject = GetPositionFromLocation(lCentralObject);
|
||||
|
||||
// Retreive and Increment Angle by 10 Degrees
|
||||
fAngle = GetLocalFloat(OBJECT_SELF, "Angle");
|
||||
fAngle = fAngle + 5.0;
|
||||
if (fAngle >= 360.0)
|
||||
{
|
||||
fAngle = 0.0;
|
||||
}
|
||||
|
||||
// Create New Location
|
||||
fRadius = 5.0;
|
||||
fLocationX = fRadius * cos(fAngle);
|
||||
fLocationY = fRadius * sin(fAngle);
|
||||
vLocation = Vector(fLocationX, fLocationY, 0.0);
|
||||
lLocation = Location(GetArea(OBJECT_SELF), vCentralObject + vLocation, 0.0);
|
||||
|
||||
// Move to New Location
|
||||
ActionMoveToLocation(lLocation, TRUE);
|
||||
|
||||
// Record New Angle
|
||||
SetLocalFloat(OBJECT_SELF, "Angle", fAngle);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
// Script 001 - Flavor text for dockworkers
|
||||
if (nHeartbeatScript == 1)
|
||||
{
|
||||
ActionSpeakString("Hand me that rope, would ya?");
|
||||
}
|
||||
//
|
||||
|
||||
// Check if a Placeable was Used
|
||||
if (nHeartbeatScript == 5)
|
||||
{
|
||||
object oPC = GetLastUsedBy();
|
||||
SendMessageToPC(oPC, "You were the last user.");
|
||||
}
|
||||
//
|
||||
|
||||
// Prowling Predator
|
||||
if (nHeartbeatScript == 10)
|
||||
{
|
||||
string sState;
|
||||
int nCurrentHungerState = GetLocalInt(OBJECT_SELF, "CurrentHungerState");
|
||||
nCurrentHungerState--;
|
||||
SetLocalInt(OBJECT_SELF, "Predator", TRUE);
|
||||
|
||||
if (GetLocalInt(OBJECT_SELF, "Sleeping") == FALSE)
|
||||
{
|
||||
// Hungry Yet?
|
||||
if (nCurrentHungerState <= 0)
|
||||
{
|
||||
if (nCurrentHungerState < -10)
|
||||
{
|
||||
// Death Comes to Those who Cannot Hunt
|
||||
sState = "Dead from Starvation";
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints(OBJECT_SELF)), OBJECT_SELF);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nCurrentHungerState > -5)
|
||||
{
|
||||
// Hungry!
|
||||
sState = "Hungry and Prowling";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Dying of Starvation!
|
||||
sState = "Starving";
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints(OBJECT_SELF)/6), OBJECT_SELF);
|
||||
}
|
||||
// Prowl
|
||||
if (GetIsInCombat(OBJECT_SELF) == FALSE)
|
||||
{
|
||||
ClearAllActions();
|
||||
ActionMoveAwayFromLocation(GetLocation(OBJECT_SELF), TRUE, 20.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nCurrentHungerState < 10)
|
||||
{
|
||||
if (nCurrentHungerState > 5)
|
||||
{
|
||||
// Happy and Healing.
|
||||
sState = "Fat and Happy";
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(OBJECT_SELF)/6), OBJECT_SELF, 0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Happy
|
||||
sState = "Happy";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sState = "Fat and Sleeping";
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectSleep(), OBJECT_SELF, 12.0);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_SLEEP), OBJECT_SELF, 0.0);
|
||||
SetLocalInt(OBJECT_SELF, "Sleeping", TRUE);
|
||||
DelayCommand(10.0, SetLocalInt(OBJECT_SELF, "Sleeping", FALSE));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sState = "Fat and Sleeping";
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_SLEEP), OBJECT_SELF, 0.0);
|
||||
}
|
||||
SendMessageToAllDMs(sState + " (" + IntToString(nCurrentHungerState) + ").");
|
||||
SpeakString("I am " + sState + ".");
|
||||
SetLocalInt(OBJECT_SELF, "CurrentHungerState", nCurrentHungerState);
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
}
|
62
_module/nss/spawn_sc_patrol.nss
Normal file
62
_module/nss/spawn_sc_patrol.nss
Normal file
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// NESS
|
||||
// Patrol Scripts v8.1.3
|
||||
//
|
||||
//
|
||||
#include "spawn_functions"
|
||||
//
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
void main()
|
||||
{
|
||||
// Retrieve Script Number
|
||||
int nPatrolScript = GetLocalInt(OBJECT_SELF, "PatrolScript");
|
||||
|
||||
// Retrieve Stop Information
|
||||
int nStopNumber = GetLocalInt(OBJECT_SELF, "PR_NEXTSTOP");
|
||||
object oStop = GetLocalObject(OBJECT_SELF, "PR_SN" + PadIntToString(nStopNumber, 2));
|
||||
|
||||
// Invalid Script
|
||||
if (nPatrolScript == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// Script 00
|
||||
if (nPatrolScript == 0)
|
||||
{
|
||||
ActionDoCommand(SpeakString("Example!"));
|
||||
}
|
||||
//
|
||||
|
||||
// Turn Off Lights
|
||||
if (nPatrolScript == 7)
|
||||
{
|
||||
object oLight = GetNearestObjectByTag("Light", oStop);
|
||||
if ((GetIsDay() == TRUE && GetPlaceableIllumination(oLight) == TRUE)
|
||||
|| (GetIsNight() == TRUE && GetPlaceableIllumination(oLight) == FALSE))
|
||||
{
|
||||
ActionDoCommand(DoPlaceableObjectAction(oLight, PLACEABLE_ACTION_USE));
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
}
|
309
_module/nss/spawn_sc_spawn.nss
Normal file
309
_module/nss/spawn_sc_spawn.nss
Normal file
@@ -0,0 +1,309 @@
|
||||
//
|
||||
// Spawn and Despawn Scripts
|
||||
//
|
||||
#include "spawn_functions"
|
||||
//
|
||||
object GetChildByTag(object oSpawn, string sChildTag);
|
||||
object GetChildByNumber(object oSpawn, int nChildNum);
|
||||
object GetSpawnByID(int nSpawnID);
|
||||
void DeactivateSpawn(object oSpawn);
|
||||
void DeactivateSpawnsByTag(string sSpawnTag);
|
||||
void DeactivateAllSpawns();
|
||||
void DespawnChildren(object oSpawn);
|
||||
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
||||
//
|
||||
//
|
||||
void main()
|
||||
{
|
||||
// Retrieve Script Number
|
||||
int nSpawnScript = GetLocalInt(OBJECT_SELF, "SpawnScript");
|
||||
int nDespawnScript = GetLocalInt(OBJECT_SELF, "DespawnScript");
|
||||
|
||||
// Invalid Script
|
||||
if (nSpawnScript == -1 || nDespawnScript == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (nSpawnScript > 0)
|
||||
{
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// Script 00
|
||||
// Dummy Script - Never Use
|
||||
if (nSpawnScript == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//
|
||||
|
||||
if (nSpawnScript == 1)
|
||||
{
|
||||
// lamplighter
|
||||
int nLit = GetLocalInt(OBJECT_SELF, "torchesLit");
|
||||
if (! nLit)
|
||||
{
|
||||
//SendMessageToPC(GetFirstPC(), "lighting torches");
|
||||
SetLocalInt(OBJECT_SELF, "torchesLit", 1);
|
||||
|
||||
// find all objects in area with tag lightableTorch
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
object oTorch = GetFirstObjectInArea(oArea);
|
||||
int nCount = 0;
|
||||
string sTorchTag = "lightableTorch";
|
||||
|
||||
while (oTorch != OBJECT_INVALID)
|
||||
{
|
||||
if (GetTag(oTorch) == sTorchTag)
|
||||
{
|
||||
nCount++;
|
||||
AssignCommand(oTorch, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
|
||||
DelayCommand(0.4, SetPlaceableIllumination(oTorch, TRUE));
|
||||
SetLocalInt(oTorch,"NW_L_AMION",1);
|
||||
}
|
||||
|
||||
oTorch = GetNextObjectInArea(oArea);
|
||||
}
|
||||
|
||||
if (nCount > 0)
|
||||
{
|
||||
DelayCommand(0.1,RecomputeStaticLighting(oArea));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}// end spawn script 1
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
if (nDespawnScript > 0)
|
||||
{
|
||||
|
||||
//
|
||||
// Only Make Modifications Between These Lines
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
// Script 00
|
||||
// Dummy Script - Never Use
|
||||
if (nDespawnScript == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//
|
||||
|
||||
if (nDespawnScript == 1)
|
||||
{
|
||||
|
||||
// lampdouser
|
||||
//SendMessageToPC(GetFirstPC(), "dousing torches");
|
||||
|
||||
// find all objects in area with tag lightableTorch
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
object oTorch = GetFirstObjectInArea(oArea);
|
||||
int nCount = 0;
|
||||
string sTorchTag = "lightableTorch";
|
||||
|
||||
while (oTorch != OBJECT_INVALID)
|
||||
{
|
||||
if (GetTag(oTorch) == sTorchTag)
|
||||
{
|
||||
nCount++;
|
||||
AssignCommand(oTorch,PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
|
||||
DelayCommand(0.4, SetPlaceableIllumination(oTorch, FALSE));
|
||||
SetLocalInt(oTorch,"NW_L_AMION",0);
|
||||
}
|
||||
|
||||
oTorch = GetNextObjectInArea(oArea);
|
||||
}
|
||||
|
||||
if (nCount > 0)
|
||||
{
|
||||
DelayCommand(0.1,RecomputeStaticLighting(oArea));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Area Cleanup Example
|
||||
if (nDespawnScript == 999)
|
||||
{
|
||||
// Settings
|
||||
int nMerchantPrefixLetters = 3;
|
||||
string sMerchantPrefix = "MC_";
|
||||
int nChestPrefixLetters = 3;
|
||||
string sChestPrefix = "CH_";
|
||||
|
||||
// Create an Area Merchant List
|
||||
int nMerchantNum;
|
||||
string sMerchantNum;
|
||||
int nNth = 1;
|
||||
object oMerchant = GetNearestObject(OBJECT_TYPE_STORE, OBJECT_SELF, nNth);
|
||||
while (oMerchant != OBJECT_INVALID)
|
||||
{
|
||||
if (GetStringLeft(GetTag(oMerchant), nMerchantPrefixLetters) == sMerchantPrefix)
|
||||
{
|
||||
nMerchantNum++;
|
||||
sMerchantNum = "Merchant" + PadIntToString(nMerchantNum, 2);
|
||||
SetLocalObject(OBJECT_SELF, sMerchantNum, oMerchant);
|
||||
}
|
||||
nNth++;
|
||||
oMerchant = GetNearestObject(OBJECT_TYPE_STORE, OBJECT_SELF, nNth);
|
||||
}
|
||||
|
||||
// Create an Area Chest List
|
||||
int nChestNum;
|
||||
string sChestNum;
|
||||
nNth = 1;
|
||||
object oChest = GetNearestObject(OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nNth);
|
||||
while (oChest != OBJECT_INVALID)
|
||||
{
|
||||
if (GetStringLeft(GetTag(oChest), nChestPrefixLetters) == sChestPrefix)
|
||||
{
|
||||
nChestNum++;
|
||||
sChestNum = "Chest" + PadIntToString(nChestNum, 2);
|
||||
SetLocalObject(OBJECT_SELF, sChestNum, oChest);
|
||||
}
|
||||
nNth++;
|
||||
oChest = GetNearestObject(OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nNth);
|
||||
}
|
||||
|
||||
// Cleanup Creatures
|
||||
nNth = 1;
|
||||
object oCreature = GetNearestObject(OBJECT_TYPE_CREATURE, OBJECT_SELF, nNth);
|
||||
while (oCreature != OBJECT_INVALID)
|
||||
{
|
||||
// Destroy Creatures NOT Spawned by Spawner
|
||||
if (GetLocalObject(oCreature, "ParentSpawn") == OBJECT_INVALID)
|
||||
{
|
||||
DestroyObject(oCreature);
|
||||
}
|
||||
|
||||
// Cleanup Corpses
|
||||
if (GetIsDead(oCreature) == TRUE)
|
||||
{
|
||||
AssignCommand(oCreature, SetIsDestroyable(TRUE, TRUE));
|
||||
DestroyObject(oCreature);
|
||||
}
|
||||
|
||||
nNth++;
|
||||
oCreature = GetNearestObject(OBJECT_TYPE_CREATURE, OBJECT_SELF, nNth);
|
||||
}
|
||||
|
||||
// Cleanup All Items in Area
|
||||
string sItemTag;
|
||||
int nStack;
|
||||
int nCurrentMerchant = 0;
|
||||
int nCurrentChest = 0;
|
||||
nNth = 1;
|
||||
object oItem = GetNearestObject(OBJECT_TYPE_ITEM, OBJECT_SELF, nNth);
|
||||
while (oItem != OBJECT_INVALID)
|
||||
{
|
||||
// Retrieve Item Information
|
||||
sItemTag = GetTag(oItem);
|
||||
nStack = GetNumStackedItems(oItem);
|
||||
|
||||
// Destroy Item
|
||||
DestroyObject(oItem);
|
||||
|
||||
// Place Items on Merchants
|
||||
if (nMerchantNum > 0)
|
||||
{
|
||||
if (nCurrentMerchant = nMerchantNum - 1)
|
||||
{
|
||||
nCurrentMerchant = 0;
|
||||
}
|
||||
oMerchant = GetLocalObject(OBJECT_SELF, "Merchant" + PadIntToString(nCurrentMerchant, 2));
|
||||
CreateItemOnObject(sItemTag, oMerchant, nStack);
|
||||
nCurrentMerchant++;
|
||||
}
|
||||
// Place Items in Chests
|
||||
else if (nChestNum > 0)
|
||||
{
|
||||
if (nCurrentChest = nChestNum -1)
|
||||
{
|
||||
nCurrentChest = 0;
|
||||
}
|
||||
oChest = GetLocalObject(OBJECT_SELF, "Chest" + PadIntToString(nCurrentChest, 2));
|
||||
CreateItemOnObject(sItemTag, oChest, nStack);
|
||||
nCurrentChest++;
|
||||
}
|
||||
|
||||
nNth++;
|
||||
oItem = GetNearestObject(OBJECT_TYPE_ITEM, OBJECT_SELF, nNth);
|
||||
}
|
||||
|
||||
// Cleanup 'Body Bags'
|
||||
nNth = 1;
|
||||
oItem = GetNearestObject(OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nNth);
|
||||
while (oItem != OBJECT_INVALID)
|
||||
{
|
||||
if(GetTag(oItem) == "Body Bag")
|
||||
{
|
||||
// Check for Inventory
|
||||
if (GetHasInventory(oItem) == TRUE)
|
||||
{
|
||||
object oInventoryItem = GetFirstItemInInventory(oItem);
|
||||
while (oInventoryItem != OBJECT_INVALID)
|
||||
{
|
||||
// Retrieve Item Information
|
||||
sItemTag = GetTag(oInventoryItem);
|
||||
nStack = GetNumStackedItems(oInventoryItem);
|
||||
|
||||
// Destroy Item
|
||||
DestroyObject(oInventoryItem);
|
||||
|
||||
// Place Items on Merchants
|
||||
if (nMerchantNum > 0)
|
||||
{
|
||||
if (nCurrentMerchant = nMerchantNum - 1)
|
||||
{
|
||||
nCurrentMerchant = 0;
|
||||
}
|
||||
oMerchant = GetLocalObject(OBJECT_SELF, "Merchant" + PadIntToString(nCurrentMerchant, 2));
|
||||
CreateItemOnObject(sItemTag, oMerchant, nStack);
|
||||
nCurrentMerchant++;
|
||||
}
|
||||
// Place Items in Chests
|
||||
else if (nChestNum > 0)
|
||||
{
|
||||
if (nCurrentChest = nChestNum -1)
|
||||
{
|
||||
nCurrentChest = 0;
|
||||
}
|
||||
oChest = GetLocalObject(OBJECT_SELF, "Chest" + PadIntToString(nCurrentChest, 2));
|
||||
CreateItemOnObject(sItemTag, oChest, nStack);
|
||||
nCurrentChest++;
|
||||
}
|
||||
oInventoryItem = GetNextItemInInventory(oItem);
|
||||
}
|
||||
}
|
||||
|
||||
// Destroy Body Bag
|
||||
DestroyObject(oItem);
|
||||
}
|
||||
nNth++;
|
||||
oItem = GetNearestObject(OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nNth);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Only Make Modifications Between These Lines
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
// Clean Up
|
||||
SetLocalInt(OBJECT_SELF, "SpawnScript", 0);
|
||||
SetLocalInt(OBJECT_SELF, "DespawnScript", 0);
|
||||
}
|
34
_module/nss/spawn_smpl_onen2.nss
Normal file
34
_module/nss/spawn_smpl_onen2.nss
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// NESS V8.1.2
|
||||
//
|
||||
// Spawn sample onEnter, version 2
|
||||
//
|
||||
// If you want to use pseudo-heartbeats and do not already have an area onEnter
|
||||
// script, you can use this one. Otherwise, just add Spawn_OnAreaEnter() to
|
||||
// your existing onEnter handler. Note that you use this (and
|
||||
// SpawnOnAreaExit()) INSTEAD OF Spawn() / spawn_sample_hb.
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
// Spawn_OnAreaEnter() can take three arguments - the name of the heartbeat
|
||||
// script to execute, the heartbeat duration, and a delay for the first
|
||||
// heartbeat. They default to spawn_sample_hb, 6.0, and 0.0 respectively; as
|
||||
// if it were called like:
|
||||
// Spawn_OnAreaEnter( "spawn_sample_hb", 6.0, 0.0 );
|
||||
|
||||
if ( GetIsAreaAboveGround( OBJECT_SELF ) &&
|
||||
! GetIsAreaNatural( OBJECT_SELF ) )
|
||||
{
|
||||
// Indoors - no delay on the first HB
|
||||
Spawn_OnAreaEnter( "spawn_sample_hb", 10.0 );
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
// Outdoors or underground - do a 3 second delay on the first HB
|
||||
Spawn_OnAreaEnter( "spawn_sample_hb", 10.0, 3.0 );
|
||||
}
|
||||
}
|
23
_module/nss/spawn_smpl_onent.nss
Normal file
23
_module/nss/spawn_smpl_onent.nss
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// NESS V8.1
|
||||
//
|
||||
// Spawn sample onEnter
|
||||
//
|
||||
// If you want to use pseudo-heartbeats and do not already have an area onEnter
|
||||
// script, you can use this one. Otherwise, just add Spawn_OnAreaEnter() to
|
||||
// your existing onEnter handler. Note that you use this (and
|
||||
// SpawnOnAreaExit()) INSTEAD OF Spawn() / spawn_sample_hb.
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
// Spawn_OnAreaEnter() can take three arguments - the name of the heartbeat
|
||||
// script to execute, the heartbeat duration, and a delay for the first
|
||||
// heartbeat. They default to spawn_sample_hb, 6.0, and 0.0 respectively; as
|
||||
// if it were called like:
|
||||
// Spawn_OnAreaEnter( "spawn_sample_hb", 6.0, 0.0 );
|
||||
|
||||
Spawn_OnAreaEnter();
|
||||
}
|
17
_module/nss/spawn_smpl_onext.nss
Normal file
17
_module/nss/spawn_smpl_onext.nss
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// NESS V8.1
|
||||
//
|
||||
// Spawn sample onExit
|
||||
//
|
||||
// If you want to use pseudo-heartbeats and do not already have an area onExit
|
||||
// script, you can use this one. Otherwise, just add Spawn_OnAreaExit() to
|
||||
// your existing onExit handler. Note that you use this (and
|
||||
// SpawnOnAreaEnter()) INSTEAD OF Spawn() / spawn_sample_hb.
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
Spawn_OnAreaExit();
|
||||
}
|
156
_module/nss/spawn_timefuncs.nss
Normal file
156
_module/nss/spawn_timefuncs.nss
Normal file
@@ -0,0 +1,156 @@
|
||||
//
|
||||
//
|
||||
// ALFA NESS
|
||||
// Time functions v1.1
|
||||
//
|
||||
// Do NOT Modify this File
|
||||
// See 'spawn__readme' for Instructions
|
||||
//
|
||||
//
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Time Conversion Functions
|
||||
//:: spawn_timefuncs
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
These functions allow Calendar y/m/d/h/m/s to
|
||||
be converted to seconds of real time which can be used as
|
||||
a basis for time comparisons. Time is reckoned
|
||||
in seconds from the NWN Epoch - 1340 DR.
|
||||
|
||||
Note that HoursToRealSeconds() is equivalent to the Bioware function
|
||||
HoursToSeconds(); it is included for completeness.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Cereborn
|
||||
//:: Created On: November 22, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
int CLOCK_DEBUG = FALSE;
|
||||
|
||||
int SPAWN_EPOCH = 1340;
|
||||
|
||||
void clockDebug(string str)
|
||||
{
|
||||
if (CLOCK_DEBUG)
|
||||
{
|
||||
SendMessageToAllDMs(str);
|
||||
object oPC = GetFirstPC();
|
||||
if (! GetIsDM(oPC))
|
||||
SendMessageToPC(oPC, str);
|
||||
WriteTimestampedLogEntry(str);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the current time (elapsed since the Epoch) in real seconds
|
||||
int GetCurrentRealSeconds();
|
||||
|
||||
// Convert a calendar (game) time to real seconds
|
||||
int CalendarToRealSeconds(int year, int month, int day, int hour, int minute,
|
||||
int second);
|
||||
|
||||
// Returns number of real seconds in the # of specified (game) years
|
||||
int YearsToRealSeconds(int years);
|
||||
|
||||
// Returns number of real seconds in the # of specified (game) months
|
||||
int MonthsToRealSeconds(int months);
|
||||
|
||||
// Returns number of real seconds in the # of specified (game) days
|
||||
int DaysToRealSeconds(int days);
|
||||
|
||||
// Returns number of real seconds in the # of specified (game) hours
|
||||
int HoursToRealSeconds(int hours);
|
||||
|
||||
int YearsToRealSeconds(int years)
|
||||
{
|
||||
return MonthsToRealSeconds(years*12);
|
||||
}
|
||||
|
||||
int MonthsToRealSeconds(int months)
|
||||
{
|
||||
return DaysToRealSeconds(months*28);
|
||||
}
|
||||
|
||||
int DaysToRealSeconds(int days)
|
||||
{
|
||||
return FloatToInt(HoursToSeconds(days*24));
|
||||
}
|
||||
|
||||
int HoursToRealSeconds(int hours)
|
||||
{
|
||||
return FloatToInt(HoursToSeconds(hours));
|
||||
}
|
||||
|
||||
int CalendarToRealSeconds(int year, int month, int day, int hour, int minute,
|
||||
int second)
|
||||
{
|
||||
if (year < SPAWN_EPOCH)
|
||||
year = SPAWN_EPOCH;
|
||||
if (month < 1)
|
||||
month = 1;
|
||||
if (day < 1)
|
||||
day = 1;
|
||||
|
||||
return (YearsToRealSeconds(year-SPAWN_EPOCH) +
|
||||
MonthsToRealSeconds(month-1) +
|
||||
DaysToRealSeconds(day-1) +
|
||||
FloatToInt(HoursToSeconds(hour)) +
|
||||
(minute*60) +
|
||||
second);
|
||||
}
|
||||
|
||||
|
||||
int GetCurrentRealSeconds()
|
||||
{
|
||||
//clockDebug("Converting " + IntToString(GetCalendarYear()) + " " +
|
||||
// IntToString(GetCalendarMonth()) + " " +
|
||||
// IntToString(GetCalendarDay()) + " " +
|
||||
// IntToString(GetTimeHour()) + " " +
|
||||
// IntToString(GetTimeMinute()) + " " +
|
||||
// IntToString(GetTimeSecond()));
|
||||
|
||||
return CalendarToRealSeconds(GetCalendarYear(), GetCalendarMonth(),
|
||||
GetCalendarDay(), GetTimeHour(), GetTimeMinute(), GetTimeSecond());
|
||||
}
|
||||
|
||||
string RealSecondsToString(int nRealSeconds)
|
||||
{
|
||||
int nMod;
|
||||
int nRem;
|
||||
string sDateTime = "";
|
||||
|
||||
nMod = nRealSeconds / YearsToRealSeconds(1);
|
||||
nRem = nRealSeconds % YearsToRealSeconds(1);
|
||||
|
||||
sDateTime = IntToString(nMod + SPAWN_EPOCH);
|
||||
|
||||
nMod = nRem / MonthsToRealSeconds(1);
|
||||
nRem = nRem % MonthsToRealSeconds(1);
|
||||
|
||||
sDateTime += " " + IntToString(nMod+1);
|
||||
|
||||
nMod = nRem / DaysToRealSeconds(1);
|
||||
nRem = nRem % DaysToRealSeconds(1);
|
||||
|
||||
sDateTime += " " + IntToString(nMod+1);
|
||||
|
||||
nMod = nRem / FloatToInt(HoursToSeconds(1));
|
||||
nRem = nRem % FloatToInt(HoursToSeconds(1));
|
||||
|
||||
sDateTime += " " + IntToString(nMod) + ":";
|
||||
|
||||
nMod = nRem / 60;
|
||||
nRem = nRem % 60;
|
||||
|
||||
if (nMod < 10)
|
||||
sDateTime += "0" + IntToString(nMod) + ":";
|
||||
else
|
||||
sDateTime += IntToString(nMod) + ":";
|
||||
|
||||
if (nRem < 10)
|
||||
sDateTime += "0" + IntToString(nRem);
|
||||
else
|
||||
sDateTime += IntToString(nRem);
|
||||
|
||||
return sDateTime;
|
||||
}
|
||||
|
29
_module/nss/spawn_used_corps.nss
Normal file
29
_module/nss/spawn_used_corps.nss
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// NESS V8.0
|
||||
// Spawn Used Corpse
|
||||
//
|
||||
// Brought into the NESS distribution for Version 8.0 and beyond. Original
|
||||
// header below.
|
||||
//
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_loot_crouch // VERSION 1.0 //
|
||||
// // //
|
||||
// by Keron Blackfeld on 07/27/2002 ////////////////////////////
|
||||
// //
|
||||
// email Questions and Comments to: keron@broadswordgaming.com or catch me //
|
||||
// in Bioware's NWN Community - Builder's NWN Scripting Forum //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// PLACE THIS SCRIPT IN THE ONUSED EVENT OF YOUR "invis_corpse_obj" //
|
||||
// BLUEPRINT. This script causes the PC opening the corpse to crouch down //
|
||||
// and visibly reach for the corpse. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void main()
|
||||
{
|
||||
object oPC = GetLastUsedBy();
|
||||
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0f, 1.2f));
|
||||
}
|
16
_module/nss/spawnb_cc_activ.nss
Normal file
16
_module/nss/spawnb_cc_activ.nss
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Conversation Check
|
||||
//
|
||||
int StartingConditional()
|
||||
{
|
||||
object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn");
|
||||
if (GetLocalInt(oSpawn, "SpawnDeactivated") == TRUE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
16
_module/nss/spawnb_cc_dactiv.nss
Normal file
16
_module/nss/spawnb_cc_dactiv.nss
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Conversation Check
|
||||
//
|
||||
int StartingConditional()
|
||||
{
|
||||
object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn");
|
||||
if (GetLocalInt(oSpawn, "SpawnDeactivated") == FALSE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
15
_module/nss/spawnb_cc_dump.nss
Normal file
15
_module/nss/spawnb_cc_dump.nss
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Conversation Check
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
if (NESS_IsModuleSpawnDumping())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
15
_module/nss/spawnb_cc_nodump.nss
Normal file
15
_module/nss/spawnb_cc_nodump.nss
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Conversation Check
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
if (NESS_IsModuleSpawnDumping())
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
15
_module/nss/spawnb_cc_notrck.nss
Normal file
15
_module/nss/spawnb_cc_notrck.nss
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Conversation Check
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
if (NESS_IsModuleSpawnTracking())
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
18
_module/nss/spawnb_cc_nsclog.nss
Normal file
18
_module/nss/spawnb_cc_nsclog.nss
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Conversation Check
|
||||
// Spawn Delay Debugging off
|
||||
//
|
||||
int StartingConditional()
|
||||
{
|
||||
object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn");
|
||||
object oArea = GetArea(oSpawn);
|
||||
if (GetLocalInt(oArea, "SpawnCountDebug") == TRUE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
18
_module/nss/spawnb_cc_nsdlog.nss
Normal file
18
_module/nss/spawnb_cc_nsdlog.nss
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Conversation Check
|
||||
// Spawn Delay Debugging off
|
||||
//
|
||||
int StartingConditional()
|
||||
{
|
||||
object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn");
|
||||
object oArea = GetArea(oSpawn);
|
||||
if (GetLocalInt(oArea, "SpawnDelayDebug") == TRUE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
18
_module/nss/spawnb_cc_sclog.nss
Normal file
18
_module/nss/spawnb_cc_sclog.nss
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Conversation Check
|
||||
// Spawn Delay Debugging on
|
||||
//
|
||||
int StartingConditional()
|
||||
{
|
||||
object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn");
|
||||
object oArea = GetArea(oSpawn);
|
||||
if (GetLocalInt(oArea, "SpawnCountDebug") == FALSE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
18
_module/nss/spawnb_cc_sdlog.nss
Normal file
18
_module/nss/spawnb_cc_sdlog.nss
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Conversation Check
|
||||
// Spawn Delay Debugging on
|
||||
//
|
||||
int StartingConditional()
|
||||
{
|
||||
object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn");
|
||||
object oArea = GetArea(oSpawn);
|
||||
if (GetLocalInt(oArea, "SpawnDelayDebug") == FALSE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
15
_module/nss/spawnb_cc_trck.nss
Normal file
15
_module/nss/spawnb_cc_trck.nss
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Conversation Check
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
if (NESS_IsModuleSpawnTracking())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
69
_module/nss/spawnb_main.nss
Normal file
69
_module/nss/spawnb_main.nss
Normal file
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// SpawnBanner v1.0
|
||||
//
|
||||
void SpawnBanner(object oPC, object oItem, object oTarget, location lTarget)
|
||||
{
|
||||
object oArea = GetArea(oPC);
|
||||
|
||||
if (GetTag(oTarget) == "SpawnBanner")
|
||||
{
|
||||
object oSpawn = GetLocalObject(oTarget, "ParentSpawn");
|
||||
|
||||
SetCustomToken(999, "\n");
|
||||
SetCustomToken(1000, GetLocalString(oSpawn, "f_Flags"));
|
||||
SetCustomToken(1001, GetLocalString(oSpawn, "f_Template"));
|
||||
|
||||
AssignCommand(oPC, ActionStartConversation(oTarget, "spawn_banner"));
|
||||
}
|
||||
else
|
||||
{
|
||||
int nState = GetLocalInt(oArea, "SpawnBannerState");
|
||||
if (nState == 0)
|
||||
{
|
||||
// Show Spawn Banners
|
||||
SendMessageToAllDMs("showing banners");
|
||||
|
||||
int nNth;
|
||||
string sSpawnNum, sSpawnName;
|
||||
object oSpawn, oBanner;
|
||||
location lSpawn;
|
||||
|
||||
int nSpawns = GetLocalInt(oArea, "Spawns");
|
||||
|
||||
for (nNth = 1; nNth <= nSpawns; nNth++)
|
||||
{
|
||||
sSpawnNum = "Spawn";
|
||||
if (nNth < 10)
|
||||
{
|
||||
sSpawnNum = sSpawnNum + "0";
|
||||
}
|
||||
sSpawnNum = sSpawnNum + IntToString(nNth);
|
||||
oSpawn = GetLocalObject(oArea, sSpawnNum);
|
||||
lSpawn = GetLocation(oSpawn);
|
||||
if (GetLocalInt(oSpawn, "SpawnDeactivated") == FALSE)
|
||||
{
|
||||
oBanner = CreateObject(OBJECT_TYPE_PLACEABLE, "spawn_ban_a", lSpawn);
|
||||
}
|
||||
else
|
||||
{
|
||||
oBanner = CreateObject(OBJECT_TYPE_PLACEABLE, "spawn_ban_d", lSpawn);
|
||||
}
|
||||
SetLocalObject(oBanner, "ParentSpawn", oSpawn);
|
||||
}
|
||||
SetLocalInt(oArea, "SpawnBannerState", 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hide Spawn Banners
|
||||
int nNth = 1;
|
||||
object oBanner = GetNearestObjectByTag("SpawnBanner", oPC, nNth);
|
||||
while (oBanner != OBJECT_INVALID)
|
||||
{
|
||||
DestroyObject(oBanner);
|
||||
nNth++;
|
||||
oBanner = GetNearestObjectByTag("SpawnBanner", oPC, nNth);
|
||||
}
|
||||
SetLocalInt(oArea, "SpawnBannerState", 0);
|
||||
}
|
||||
}
|
||||
}
|
18
_module/nss/spawnb_sample_ai.nss
Normal file
18
_module/nss/spawnb_sample_ai.nss
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// SpawnBanner : Sample OnActivateItem Script
|
||||
//
|
||||
#include "spawnb_main"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetItemActivator();
|
||||
object oItem = GetItemActivated();
|
||||
object oTarget = GetItemActivatedTarget();
|
||||
location lTarget = GetItemActivatedTargetLocation();
|
||||
|
||||
// Rod of Spawn Banners
|
||||
if (GetTag(oItem) == "RodofSpawnBanners")
|
||||
{
|
||||
SpawnBanner(oPC, oItem, oTarget, lTarget);
|
||||
}
|
||||
}
|
17
_module/nss/spawnb_sc_activ.nss
Normal file
17
_module/nss/spawnb_sc_activ.nss
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Activate Spawn
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn");
|
||||
NESS_ActivateSpawn(oSpawn);
|
||||
DestroyObject(OBJECT_SELF);
|
||||
object oBanner = CreateObject(OBJECT_TYPE_PLACEABLE, "spawn_ban_a", GetLocation(oSpawn));
|
||||
SetLocalObject(oBanner, "ParentSpawn", oSpawn);
|
||||
FloatingTextStringOnCreature("Spawn Activated", oPC);
|
||||
}
|
17
_module/nss/spawnb_sc_dactiv.nss
Normal file
17
_module/nss/spawnb_sc_dactiv.nss
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Deactivate Spawn
|
||||
//
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn");
|
||||
NESS_DeactivateSpawn(oSpawn);
|
||||
DestroyObject(OBJECT_SELF);
|
||||
object oBanner = CreateObject(OBJECT_TYPE_PLACEABLE, "spawn_ban_d",
|
||||
GetLocation(oSpawn));
|
||||
SetLocalObject(oBanner, "ParentSpawn", oSpawn);
|
||||
FloatingTextStringOnCreature("Spawn Deactivated", oPC);
|
||||
}
|
14
_module/nss/spawnb_sc_disp.nss
Normal file
14
_module/nss/spawnb_sc_disp.nss
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Spawn Banner Display Text
|
||||
//
|
||||
void main()
|
||||
{
|
||||
object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn");
|
||||
object oPC = GetLastUsedBy();
|
||||
|
||||
string sSpawnName = GetLocalString(oSpawn, "f_Flags");
|
||||
string sSpawnTag = GetLocalString(oSpawn, "f_Template");
|
||||
|
||||
DelayCommand(0.0, FloatingTextStringOnCreature(sSpawnName, oPC));
|
||||
DelayCommand(1.0, FloatingTextStringOnCreature(sSpawnTag, oPC));
|
||||
}
|
12
_module/nss/spawnb_sc_dump.nss
Normal file
12
_module/nss/spawnb_sc_dump.nss
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Turn Spawn Tracking ON
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
NESS_DumpModuleSpawns();
|
||||
SendMessageToAllDMs("Spawn dumping enabled");
|
||||
}
|
12
_module/nss/spawnb_sc_nodump.nss
Normal file
12
_module/nss/spawnb_sc_nodump.nss
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Turn Spawn Tracking OFF
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
NESS_DumpModuleSpawns(FALSE);
|
||||
SendMessageToAllDMs("Spawn dumping disabled");
|
||||
}
|
12
_module/nss/spawnb_sc_notrck.nss
Normal file
12
_module/nss/spawnb_sc_notrck.nss
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Turn Spawn Tracking OFF
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
NESS_TrackModuleSpawns(FALSE);
|
||||
SendMessageToAllDMs("Spawn tracking disabled");
|
||||
}
|
11
_module/nss/spawnb_sc_nsdlog.nss
Normal file
11
_module/nss/spawnb_sc_nsdlog.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Turn Spawn Delay logging ON
|
||||
//
|
||||
|
||||
void main()
|
||||
{
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
SetLocalInt(oArea, "SpawnDelayDebug", FALSE);
|
||||
SendMessageToAllDMs("Spawn delay logging disabled");
|
||||
}
|
11
_module/nss/spawnb_sc_sclog.nss
Normal file
11
_module/nss/spawnb_sc_sclog.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Turn Spawn Delay logging ON
|
||||
//
|
||||
|
||||
void main()
|
||||
{
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
SetLocalInt(oArea, "SpawnCountDebug", TRUE);
|
||||
SendMessageToAllDMs("Spawn count logging enabled");
|
||||
}
|
11
_module/nss/spawnb_sc_sdlog.nss
Normal file
11
_module/nss/spawnb_sc_sdlog.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Turn Spawn Delay logging ON
|
||||
//
|
||||
|
||||
void main()
|
||||
{
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
SetLocalInt(oArea, "SpawnDelayDebug", TRUE);
|
||||
SendMessageToAllDMs("Spawn delay logging enabled");
|
||||
}
|
11
_module/nss/spawnb_sc_snclog.nss
Normal file
11
_module/nss/spawnb_sc_snclog.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Turn Spawn Delay logging ON
|
||||
//
|
||||
|
||||
void main()
|
||||
{
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
SetLocalInt(oArea, "SpawnCountDebug", FALSE);
|
||||
SendMessageToAllDMs("Spawn count logging disable");
|
||||
}
|
12
_module/nss/spawnb_sc_trck.nss
Normal file
12
_module/nss/spawnb_sc_trck.nss
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// Spawn Banner
|
||||
// Turn Spawn Tracking ON
|
||||
//
|
||||
|
||||
#include "spawn_functions"
|
||||
|
||||
void main()
|
||||
{
|
||||
NESS_TrackModuleSpawns();
|
||||
SendMessageToAllDMs("Spawn tracking enabled");
|
||||
}
|
20
_module/nss/spawnbanner.nss
Normal file
20
_module/nss/spawnbanner.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// SpawnBanner : Sample OnActivateItem Script
|
||||
//
|
||||
#include "x2_inc_switches"
|
||||
#include "spawnb_main"
|
||||
void main()
|
||||
{
|
||||
int nResult = X2_EXECUTE_SCRIPT_END;
|
||||
|
||||
if ( GetUserDefinedItemEventNumber() == X2_ITEM_EVENT_ACTIVATE )
|
||||
{
|
||||
object oPC = GetItemActivator();
|
||||
object oItem = GetItemActivated();
|
||||
object oTarget = GetItemActivatedTarget();
|
||||
location lTarget = GetItemActivatedTargetLocation();
|
||||
SpawnBanner(oPC, oItem, oTarget, lTarget);
|
||||
}
|
||||
SetExecutedScriptReturnValue(nResult);
|
||||
}
|
||||
|
9
_module/nss/wys_e_dummydeath.nss
Normal file
9
_module/nss/wys_e_dummydeath.nss
Normal file
@@ -0,0 +1,9 @@
|
||||
// Restore and recover the dummy
|
||||
void main()
|
||||
{
|
||||
string oDummyTag = GetTag(OBJECT_SELF);
|
||||
//SendMessageToPC(GetFirstPC(),"Dummy is dead " + oDummyTag);
|
||||
object oNewDummy =
|
||||
CreateObject(OBJECT_TYPE_CREATURE,GetResRef(OBJECT_SELF),
|
||||
GetLocation(OBJECT_SELF),FALSE);
|
||||
}
|
8
_module/nss/wys_e_dummydmg.nss
Normal file
8
_module/nss/wys_e_dummydmg.nss
Normal file
@@ -0,0 +1,8 @@
|
||||
void main()
|
||||
{
|
||||
int iHp = GetMaxHitPoints() - GetCurrentHitPoints();
|
||||
if (iHp > 0) {
|
||||
effect eHeal = EffectHeal(iHp);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user