Aschbourne_PRC8/_module/nss/_seed_seed.nss

56 lines
1.9 KiB
Plaintext
Raw Permalink Normal View History

2024-06-14 10:48:20 -04:00
//#include "_persist_01a"
void main()
{
object oPC = OBJECT_SELF;
string sSeedBaseType=GetLocalString(oPC,"sItemActivated");
//int iFarmSkill = GetTokenPair(oPC,14,6);
int iFarmSkill = GetCampaignInt("UOACraft","iFarmSkill",oPC);
int iFarmChance = iFarmSkill;
if (iFarmChance <350)
{
iFarmChance = GetAbilityScore(oPC,ABILITY_WISDOM)*5;
iFarmChance = iFarmChance + (GetAbilityScore(oPC,ABILITY_INTELLIGENCE)*3);
iFarmChance = iFarmChance+ (GetAbilityScore(oPC,ABILITY_CHARISMA)*2);
iFarmChance = iFarmChance *3;
if (iFarmChance > 350) iFarmChance = 350;
if (iFarmSkill > iFarmChance) iFarmChance = iFarmSkill;
}
int iSeeds = 1;
string sSeed = "";
string sSeed2 = "";
if (sSeedBaseType == "FOOD_EAROFCORN") sSeed = "cornkernels";
if (sSeedBaseType == "FLOWER_COTTON")
{
sSeed = "cottonseeds";
sSeed2 = "cotton";
}
if (sSeedBaseType == "ITEM_PUMPKIN") sSeed = "pumpkinseeds";
if (sSeedBaseType == "ITEM_WATERMELON") sSeed = "watermelonseeds";
if (sSeedBaseType == "ITEM_SQUASH") sSeed = "wintersquashseed";
if (sSeedBaseType == "ITEM_ZUCCHINI") sSeed = "zucchinisquashse";
if (sSeedBaseType == "ITEM_INDIANCORN") sSeed = "indiancornkernel";
if (sSeedBaseType == "ITEM_EAROFPOPCORN") sSeed = "popcornkernels";
if (iFarmChance >=500) iSeeds++;
if (iFarmChance >=750) iSeeds++;
if (iFarmChance >=950) iSeeds++;
if (Random(1000)<=iFarmChance) iSeeds++;
int iLoop = 0;
for (iLoop = 1; iLoop<=iSeeds; iLoop++)
{
CreateItemOnObject(sSeed,oPC,1);
}
string sString = "You manage to get "+IntToString(iSeeds)+" seeds.";
if (sSeed2 != "")
{
sString = sString+" and some cotton.";
CreateItemOnObject(sSeed2,oPC,1); // move this line to the loop above to give 1 per successful seed, if so desired.
}
FloatingTextStringOnCreature(sString,oPC,FALSE);
AssignCommand(oPC,PlaySound("as_an_crittgnaw3"));
}