/////////////////////////////////////////////////////////////////////////////// // rts_mon_gold - Gold Drop OPTIONAL script for monsters // By Deva Bryson Winblood. /////////////////////////////////////////////////////////////////////////////// void main() { object oMod=GetModule(); object oMe=OBJECT_SELF; int nGD=GetLocalInt(oMod,"nMONGoldDrop"); float fCR=GetChallengeRating(oMe); string sRes="pileogold"; object oPile; int nGold=FloatToInt(fCR)*nGD; int nRace=GetRacialType(oMe); //PrintString("rts_mon_gold script called by "+GetName(oMe)+" extra gold drop."); if (nRace==RACIAL_TYPE_ANIMAL||nRace==RACIAL_TYPE_VERMIN||nRace==RACIAL_TYPE_CONSTRUCT) return; if (nGold<1) return; oPile=CreateObject(OBJECT_TYPE_PLACEABLE,sRes,GetLocation(oMe)); CreateItemOnObject("nw_it_gold001",oPile,nGold); SetLocalInt(oPile,"bDecay",TRUE); }