55 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
//::///////////////////////////////////////////////
 | 
						|
//:: Name re_treasure0
 | 
						|
//:: Copyright (c) 2001 Bioware Corp.
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
/*
 | 
						|
The purpose of re_treasure# scripts are to generate
 | 
						|
random treasure on a creature created via the BESIE
 | 
						|
Random Encounter System by Ray Miller.  These scripts
 | 
						|
are called via an ExecuteScript() function from within
 | 
						|
"re_rndenc".  The object executing this script is passed
 | 
						|
as the creature to be given treasure, so this creature
 | 
						|
can be refered to as OBJECT_SELF.
 | 
						|
*/
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
//:: Created By: Ray Miller
 | 
						|
//:: Created On: 10/27/02
 | 
						|
//::////////////////////////////////////////////////////////////////////////////
 | 
						|
/*
 | 
						|
This is the standard treasure script for the BESIE Random Encounter System
 | 
						|
By Ray Miller.  Prior to v1.8 This script executed a series of functions to
 | 
						|
bestow treasure upon creatures generated by the system.  The problem was that
 | 
						|
there were to many function which looped too many times and would sometimes cause
 | 
						|
the spawner to abort with a "too many instructions error".  So now we just use it
 | 
						|
to bestow money.
 | 
						|
 | 
						|
Please note that the amount of treasure that should be rewarded for an encounter
 | 
						|
or in a module is very subjective.  Some will consider this amount far too generous
 | 
						|
and some too greedy.
 | 
						|
*/
 | 
						|
////////////////////////////////////////////////////////////////////////////////
 | 
						|
#include "prc_inc_racial"
 | 
						|
 | 
						|
void main()
 | 
						|
{
 | 
						|
    if(d100()>66) return;
 | 
						|
    object oCreature = OBJECT_SELF;
 | 
						|
    object oMarker;
 | 
						|
    if(MyPRCGetRacialType(oCreature) == RACIAL_TYPE_ANIMAL
 | 
						|
    || MyPRCGetRacialType(oCreature) == RACIAL_TYPE_VERMIN) return;
 | 
						|
    float fChallengeFactor = GetChallengeRating(oCreature) * 30.0;
 | 
						|
    float fFactor = IntToFloat(Random(5) + 2);
 | 
						|
    int iTreasure = FloatToInt(fChallengeFactor / fFactor);
 | 
						|
    int iType = MyPRCGetRacialType(oCreature);
 | 
						|
    CreateItemOnObject("NW_IT_GOLD001", oCreature, iTreasure);
 | 
						|
    if(iType == RACIAL_TYPE_UNDEAD || iType == RACIAL_TYPE_ABERRATION)
 | 
						|
    oMarker = CreateItemOnObject("NW_IT_MSMLMISC21", oCreature, 1);
 | 
						|
    else if(iType == RACIAL_TYPE_CONSTRUCT ||
 | 
						|
    iType == RACIAL_TYPE_ELEMENTAL ||
 | 
						|
    iType == RACIAL_TYPE_OUTSIDER)
 | 
						|
    oMarker = CreateItemOnObject("NW_IT_MSMLMISC11", oCreature, 1);
 | 
						|
    else
 | 
						|
    oMarker = CreateItemOnObject("NW_IT_MMIDMISC05", oCreature, 1);
 | 
						|
    SetLocalInt(oMarker, "bItemForGold", TRUE);
 | 
						|
}
 |