Battledale_PRC8/_module/nss/jw_fireoven_use.nss
Jaysyn904 7b9e44ebbb Initial upload
Initial upload.  PRC8 has been added.  Module compiles, PRC's default AI & treasure scripts have been integrated.  Started work on top hak for SLA / Ability / Scripting modifications.
2024-03-11 23:44:08 -04:00

195 lines
4.1 KiB
Plaintext

void Makemeat (int nTotal, object oPC, object oMeat);
void Makedragon (int nTotal, object oPC, object oMeat);
void MakeMagicMeat (int nTotal, object oPC, object oMeat, object oHerb);
object ReturnHerb ();
void main()
{
object oMeat;
object oPC;
int nIntbonus;
int nRoll;
int nTotal;
if (GetInventoryDisturbType()==INVENTORY_DISTURB_TYPE_ADDED)
{
oPC=GetLastDisturbed();
if (!GetIsObjectValid(oPC)||!GetIsPC(oPC))
{
return;
}
oMeat=GetInventoryDisturbItem();
if (GetTag(oMeat)=="jw_dragon_meat")
{
AssignCommand(oPC,SetFacingPoint(GetPosition(OBJECT_SELF)));
AssignCommand(oPC,PlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,5.0));
AssignCommand(oPC,FloatingTextStringOnCreature("Cooking",oPC));
PlaySound("al_cv_firesmldr1");
nIntbonus=GetAbilityModifier(ABILITY_INTELLIGENCE,oPC)+GetSkillRank(SKILL_LORE,oPC);
nRoll=d20(1);
nTotal=nRoll+nIntbonus;
SetLocalInt(oPC,"cooking",1);
DelayCommand(5.0,SendMessageToPC(oPC,"Rolled "+IntToString(nRoll)+" + lore and int bonus "+IntToString(nIntbonus)+" = "+IntToString(nTotal)+" vs minimum DC 15"));
DelayCommand(5.0, Makedragon ( nTotal, oPC, oMeat));
return;
}
if (GetTag(oMeat)=="jw_meat" || GetTag(oMeat)=="jw_berry")
{
AssignCommand(oPC,SetFacingPoint(GetPosition(OBJECT_SELF)));
AssignCommand(oPC,PlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,5.0));
AssignCommand(oPC,FloatingTextStringOnCreature("Cooking",oPC));
PlaySound("al_cv_firesmldr1");
nIntbonus=GetSkillRank(SKILL_LORE,oPC);
nRoll=d20(1);
nTotal=nRoll+nIntbonus;
SetLocalInt(oPC,"cooking",1);
object oHerb=ReturnHerb();
//if (oHerb==OBJECT_INVALID)
// For now, just do the normal meat
if (1)
{
DelayCommand(5.0,SendMessageToPC(oPC,"Rolled "+IntToString(nRoll)+" + lore bonus "+IntToString(nIntbonus)+" = "+IntToString(nTotal)+" vs minimum DC 6"));
DelayCommand(5.0, Makemeat ( nTotal, oPC, oMeat));
return;
}
else
{
DelayCommand(5.0,SendMessageToPC(oPC,"Rolled "+IntToString(nRoll)+" + lore bonus "+IntToString(nIntbonus)+" = "+IntToString(nTotal)+" vs minimum DC 20"));
DelayCommand(5.0, MakeMagicMeat ( nTotal, oPC, oMeat, oHerb));
return;
}
}
}
}
void Makemeat (int nTotal, object oPC, object oMeat)
{
if (nTotal<6)
{
SendMessageToPC(oPC,"The food is ruined");
DestroyObject(oMeat);
SetLocalInt(oPC,"cooking",0);
return;
}
if (nTotal<10)
{
SendMessageToPC(oPC,"You don't do the best job of cooking it, but you create an edible meal.");
DestroyObject(oMeat);
CreateItemOnObject("jw_food1",oPC);
SetLocalInt(oPC,"cooking",0);
return;
}
if (nTotal<14)
{
SendMessageToPC(oPC,"You're not a bad cook and make a meal that will last you some time.");
DestroyObject(oMeat);
CreateItemOnObject("jw_food2",oPC);
SetLocalInt(oPC,"cooking",0);
return;
}
SendMessageToPC(oPC,"You really know what you're doing and create some fine food.");
DestroyObject(oMeat);
CreateItemOnObject("jw_food3",oPC);
SetLocalInt(oPC,"cooking",0);
return;
}
void Makedragon (int nTotal, object oPC, object oMeat)
{
if (nTotal<15)
{
SendMessageToPC(oPC,"The meat is ruined");
DestroyObject(oMeat);
SetLocalInt(oPC,"cooking",0);
return;
}
{
SendMessageToPC(oPC,"This meat is now fit to eat.");
DestroyObject(oMeat);
CreateItemOnObject("jw_dragon_potion",oPC);
SetLocalInt(oPC,"cooking",0);
return;
}
}
object ReturnHerb ()
{
object oReturn=OBJECT_INVALID;
object oHerb;
oHerb=GetItemPossessedBy(OBJECT_SELF,"jw_harpherb1");
if (GetIsObjectValid(oHerb))
{
oReturn=oHerb;
}
else
oHerb=GetItemPossessedBy(OBJECT_SELF,"jw_harpherb2");
if (GetIsObjectValid(oHerb))
{
oReturn=oHerb;
}
else
oHerb=GetItemPossessedBy(OBJECT_SELF,"jw_harpherb3");
if (GetIsObjectValid(oHerb))
{
oReturn=oHerb;
}
else
oHerb=GetItemPossessedBy(OBJECT_SELF,"jw_harpherb4");
if (GetIsObjectValid(oHerb))
{
oReturn=oHerb;
}
else
oHerb=GetItemPossessedBy(OBJECT_SELF,"jw_harpherb5");
if (GetIsObjectValid(oHerb))
{
oReturn=oHerb;
}
else
oHerb=GetItemPossessedBy(OBJECT_SELF,"jw_harpherb6");
if (GetIsObjectValid(oHerb))
{
oReturn=oHerb;
}
else
oHerb=GetItemPossessedBy(OBJECT_SELF,"jw_harpherb7");
if (GetIsObjectValid(oHerb))
{
oReturn=oHerb;
}
return oReturn;
}
void MakeMagicMeat (int nTotal, object oPC, object oMeat, object oHerb)
{
}