59 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
#include "nw_i0_plot"
 | 
						|
int StartingConditional()
 | 
						|
{
 | 
						|
    object oPC = GetPCSpeaker();
 | 
						|
    int nLevel = GetHitDice(oPC);
 | 
						|
    string sMinorItem;
 | 
						|
    string sMajorItem;
 | 
						|
    int nMinorGold;
 | 
						|
    int nMinorXP;
 | 
						|
    int nMajorGold;
 | 
						|
    int nMajorXP;
 | 
						|
    int nMinorNum;
 | 
						|
    int nMajorNum;
 | 
						|
    int nGold;
 | 
						|
    int nXP;
 | 
						|
    object oItem;
 | 
						|
 | 
						|
    if (nLevel <= 3)
 | 
						|
    {
 | 
						|
        sMinorItem = "anc_it_slimeball";
 | 
						|
        sMajorItem = "anc_it_cubeskull";
 | 
						|
        nMinorGold = 75;
 | 
						|
        nMajorGold = 200;
 | 
						|
        nMinorXP = 50;
 | 
						|
        nMajorXP = 100;
 | 
						|
    }
 | 
						|
 | 
						|
    else //if (nLevel <= 7)
 | 
						|
    {
 | 
						|
        sMinorItem = "anc_it_colhidew";
 | 
						|
        sMajorItem = "anc_it_colhideb";
 | 
						|
        nMinorGold = 100;
 | 
						|
        nMajorGold = 250;
 | 
						|
        nMinorXP = 125;
 | 
						|
        nMajorXP = 250;
 | 
						|
    }
 | 
						|
 | 
						|
    //get numbers of items
 | 
						|
    nMinorNum = GetNumItems(oPC, sMinorItem);
 | 
						|
    nMajorNum = GetNumItems(oPC, sMajorItem);
 | 
						|
 | 
						|
    //get gold and XP the PC will receive
 | 
						|
    nGold = nMinorGold * nMinorNum + nMajorGold * nMajorNum;
 | 
						|
    nXP = nMinorXP * nMinorNum + nMajorXP * nMajorNum; //the rule of thumb: about 20 minor items + 10 major items are required to advance from a level in the middle of the level range (here: lvl 2)
 | 
						|
 | 
						|
    //destroy items
 | 
						|
    oItem = GetFirstItemInInventory(oPC);
 | 
						|
    while (GetIsObjectValid(oItem))
 | 
						|
    {
 | 
						|
        if (GetTag(oItem) == sMinorItem || GetTag(oItem) == sMajorItem ) DestroyObject(oItem);
 | 
						|
        oItem = GetNextItemInInventory(oPC);
 | 
						|
    }
 | 
						|
 | 
						|
    //give gold and XP
 | 
						|
    GiveGoldToCreature(oPC, nGold);
 | 
						|
    GiveXPToCreature(oPC, nXP);
 | 
						|
    return TRUE;
 | 
						|
}
 |