Aschbourne_PRC8/_module/nss/_use_honeycomb.nss
GetOffMyYarn 69879d6957 Areas and Fixes
Added CCOH and missing areas
Changed some areas to be craftable,
Fixed some on death issues,
Fixed the Gaurd
2024-08-30 11:38:44 -04:00

123 lines
3.8 KiB
Plaintext

//#include "_persist_01a"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void main()
{
object oPC = GetItemActivator();
//int iBeeSkill = GetTokenPair(oPC,13,1);
int iBeeSkill = GetCampaignInt("UOACraft","iBeeSkill",oPC);
int iBeeChance = iBeeSkill;
int iSkillGain = 0;
SetLocalInt(oPC,"iUSeHoneyComb",99);
AssignCommand(oPC,DelayCommand(8.0,SetLocalInt(oPC,"iUseHoneyComb",0)));
if (iBeeChance <350)
{
iBeeChance = GetAbilityScore(oPC,ABILITY_WISDOM)*5;
iBeeChance = iBeeChance +(GetAbilityScore(oPC,ABILITY_DEXTERITY)*3);
iBeeChance = iBeeChance +(GetAbilityScore(oPC,ABILITY_CHARISMA)*2);
iBeeChance = iBeeChance * 3;
if (iBeeChance >350) iBeeChance = 350;
if (iBeeSkill>iBeeChance)iBeeChance=iBeeSkill;
}
if (Random(1000) <= iBeeChance)
{
iSkillGain = 97;
AssignCommand(oPC,DelayCommand(2.0,FloatingTextStringOnCreature("You gather the honey from the honeycomb.",oPC,FALSE)));
AssignCommand(oPC,DelayCommand(2.0,CreateAnObject("honey",oPC,1)));
}
else
{
AssignCommand(oPC,DelayCommand(2.0,FloatingTextStringOnCreature("You accidentally contaminate the honey as you try to collect it from the honeycomb.",oPC,FALSE)));
}
iBeeChance = iBeeChance-250;
if (Random(1000) <= iBeeChance)
{
iSkillGain = 98;
AssignCommand(oPC,DelayCommand(4.0,FloatingTextStringOnCreature("You gather up some beeswax from the honeycomb.",oPC,FALSE)));
AssignCommand(oPC,DelayCommand(4.0,CreateAnObject("beeswax",oPC,1)));
}
else
{
AssignCommand(oPC,DelayCommand(4.0,FloatingTextStringOnCreature("You fail to collect any beeswax from this honeycomb.",oPC,FALSE)));
}
iBeeChance = iBeeChance - 250;
if (Random(1000) <= iBeeChance)
{
if (Random(1000)<=400)
{
AssignCommand(oPC,DelayCommand(6.0,FloatingTextStringOnCreature("You have gathered some royal jelly!",oPC,FALSE)));
AssignCommand(oPC,DelayCommand(6.0,CreateAnObject("royaljelly",oPC,1)));
iSkillGain = 99;
}
else
{
AssignCommand(oPC,DelayCommand(6.0,FloatingTextStringOnCreature("There was no rayal jelly to collect..",oPC,FALSE)));
}
}
else
{
AssignCommand(oPC,DelayCommand(6.0,FloatingTextStringOnCreature("You accidentally contaminate the royal jelly, ruining it..",oPC,FALSE)));
}
if (iSkillGain >0)
{
if (Random(1000) > iBeeSkill)
{
if (d10(1)+1 >= iBeeSkill/100)
{
if (iSkillGain ==97)
{
if (d20(1) <5) iSkillGain =1; // 20% chance to gain if a gain is indicated
}
if (iSkillGain ==98)
{
if (d20(1) <8) iSkillGain =1; //approx 33% chance to gain if a gain is indicated
}
if (iSkillGain ==99) iSkillGain=1;
}
}
}
if (iSkillGain == 1)
{
string sOldSkill = "";
string sOldSkill2 = "";
iBeeSkill++;
sOldSkill2 = IntToString(iBeeSkill);
sOldSkill = "."+GetStringRight(sOldSkill2,1);
if (iBeeSkill > 9)
{
sOldSkill = GetStringLeft(sOldSkill2,GetStringLength(sOldSkill2)-1)+sOldSkill;
}
else
{
sOldSkill = "0"+sOldSkill;
}
if (iBeeSkill <= 1000)
{
//DelayCommand(6.0,SetTokenPair(oPC,13,1,iBeeSkill));
DelayCommand(6.0,SetCampaignInt("UOACraft","iBeeSkill",iBeeSkill,oPC));
DelayCommand(6.0,SendMessageToPC(oPC,"====================================="));
DelayCommand(6.0,SendMessageToPC(oPC,"Your skill in beekeeping has gone up!"));
DelayCommand(6.0,SendMessageToPC(oPC,"Current beekeeping skill : "+ sOldSkill+"%"));
DelayCommand(6.0,SendMessageToPC(oPC,"====================================="));
}
}
}
void CreateAnObject(string sResource, object oPC, int iStackSize)
{
CreateItemOnObject(sResource,oPC,iStackSize);
return;
}