Area Changes and other fixes
Added CCOH Fixed some on death issues Fixed the gaurd Added Server Enty/ooc changed some areas back to original craftable
This commit is contained in:
@@ -178,9 +178,6 @@ the original treasure generation system in user-made modules.
|
||||
//:://////////////////////////////////////////////////
|
||||
|
||||
// For legacy treasure generation
|
||||
|
||||
#include "loot_inc_data"
|
||||
#include "loot_inc_main"
|
||||
#include "nw_o2_coninclude"
|
||||
|
||||
/**********************************************************************
|
||||
@@ -190,7 +187,6 @@ the original treasure generation system in user-made modules.
|
||||
// * this is the percent chance that no treasure will be spawned by a creature dying
|
||||
const int BK_CHANCE_OF_N0_MONSTERTREASURE = 80;
|
||||
|
||||
|
||||
// Tags for the module-wide containers
|
||||
string sModContLow = "X0_MOD_TREASURE_LOW";
|
||||
string sModContMed = "X0_MOD_TREASURE_MED";
|
||||
@@ -305,8 +301,7 @@ int CTG_GetIsTreasureGenerated(object oCont);
|
||||
|
||||
// Set whether treasure has been generated
|
||||
void CTG_SetIsTreasureGenerated(object oCont, int bGenerated=TRUE);
|
||||
// Set whether treasure has been regenerated
|
||||
void CTG_SetIsTreasureRegenerated(object oCont, int bGenerated=FALSE);
|
||||
|
||||
// Create random treasure items of the appropriate type
|
||||
// in the specified container. Will typically be called
|
||||
// by a script on a treasure container.
|
||||
@@ -403,6 +398,7 @@ string CTG_GetRacialtypeChestTag(string sBaseTag, object oSource);
|
||||
|
||||
// This function deliberately not prototyped. Should not be used
|
||||
// outside this library.
|
||||
|
||||
// Test whether a treasure container has been initialized for
|
||||
// specific base treasure type use.
|
||||
int CTG_GetIsContainerInitialized(object oBaseCont)
|
||||
@@ -527,7 +523,7 @@ object CTG_GetMonsterBaseContainer(object oSource=OBJECT_SELF)
|
||||
// a chest with a tag matching the specific
|
||||
// monster.
|
||||
// We strip numbers off the end of the tag first
|
||||
string sCreatureTag = GetTag(oSource);
|
||||
string sCreatureTag = GetResRef(oSource);
|
||||
while ( GetIsInteger(GetStringRight(sCreatureTag, 1)) ) {
|
||||
sCreatureTag = GetStringLeft(sCreatureTag,
|
||||
GetStringLength(sCreatureTag)-1);
|
||||
@@ -761,13 +757,8 @@ int CTG_GetIsTreasureGenerated(object oCont)
|
||||
void CTG_SetIsTreasureGenerated(object oCont, int bGenerated=TRUE)
|
||||
{
|
||||
SetLocalInt(oCont, sTreasureGeneratedVarname, bGenerated);
|
||||
}
|
||||
|
||||
}
|
||||
void CTG_SetIsTreasureRegenerated(object oCont, int bGenerated=FALSE)
|
||||
{
|
||||
float fRespawnTime = GetRespawnTime (oCont);
|
||||
AssignCommand(oCont, DelayCommand(fRespawnTime, SetLocalInt(oCont, sTreasureGeneratedVarname, FALSE) ) );
|
||||
}
|
||||
// Create random treasure items of the appropriate type
|
||||
// in the specified container. Should be called
|
||||
// by a script on a treasure container.
|
||||
@@ -817,9 +808,6 @@ void CTG_CreateSpecificBaseTypeTreasure(int nTreasureType,
|
||||
// Prevent duplicate treasure generation
|
||||
if (CTG_GetIsTreasureGenerated(oCont)) {return;}
|
||||
CTG_SetIsTreasureGenerated(oCont);
|
||||
float fRespawnTime = GetRespawnTime (oCont);
|
||||
AssignCommand(oCont, DelayCommand(fRespawnTime, CTG_SetIsTreasureRegenerated(oCont) ) );
|
||||
|
||||
|
||||
// Locate the base container
|
||||
object oBaseCont = CTG_GetNearestBaseContainer(nTreasureType,
|
||||
@@ -927,10 +915,30 @@ void CTG_CreateSpecificBaseTypeTreasure(int nTreasureType,
|
||||
else
|
||||
{
|
||||
// Make the item
|
||||
CopyItem(oItem, oCont);
|
||||
if (nItemsCreated == 1) {
|
||||
//CRP CODE ADDITION - BREAKABLE ITEMS
|
||||
if(CRP_USE_BREAKABLE_ITEMS && CRP_CONTAINER_HAS_BEEN_DESTROYED)
|
||||
{
|
||||
//int bDamage = GetDamageDealtByType(DAMAGE_TYPE_ACID) + 1;
|
||||
//bDamage = bDamage + GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL) + 1;
|
||||
//bDamage = bDamage + GetDamageDealtByType(DAMAGE_TYPE_FIRE) + 1;
|
||||
//bDamage = bDamage + GetDamageDealtByType(DAMAGE_TYPE_MAGICAL) + 1;
|
||||
|
||||
//if(bDamage >= 7 && crp_GetIsItemDestroyed(oItem, TRUE))
|
||||
//CreateItemOnObject(CRP_DESTROYED_ITEM, oCont, 1);
|
||||
//else
|
||||
if(crp_GetIsItemDestroyed(oItem, CRP_ALT_DAMAGE))
|
||||
CreateItemOnObject(CRP_DESTROYED_ITEM, oCont, 1);
|
||||
else
|
||||
CopyItem(oItem, oCont);
|
||||
}
|
||||
else
|
||||
{
|
||||
CopyItem(oItem, oCont);
|
||||
}
|
||||
if (nItemsCreated == 1)
|
||||
oItem1 = oItem;
|
||||
} else {
|
||||
else
|
||||
{
|
||||
// if this is the third item, it doesn't matter
|
||||
// anyway, so we might as well save the conditional.
|
||||
oItem2 = oItem;
|
||||
@@ -984,10 +992,16 @@ void CTG_GenerateNPCTreasure(int nTreasureType=5, object oNPC=OBJECT_SELF)
|
||||
// No treasure, sorry.
|
||||
return;
|
||||
}
|
||||
|
||||
if (nTreasureType == TREASURE_TYPE_MONSTER) {
|
||||
|
||||
if (d100() < BK_CHANCE_OF_N0_MONSTERTREASURE) {
|
||||
//CRP CODE ADDITION
|
||||
if (nTreasureType == TREASURE_TYPE_MONSTER)
|
||||
{
|
||||
if(CRP_USE_COINS)
|
||||
{
|
||||
if(d100() < CRP_CHANCE_OF_NO_MONSTERTREASURE)
|
||||
return;
|
||||
}
|
||||
else if (d100() < BK_CHANCE_OF_N0_MONSTERTREASURE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user