01-15-2015, 12:23 PM
The helm/whip sounds easy enough. I'd like someone to do a description for it though. That's among the most important part, for me.
Here's the cooking script. If you/anyone want to improve it to rely on something other than wisdom (without requiring a bunch of modifications outside of this script), please feel free!
Here's the cooking script. If you/anyone want to improve it to rely on something other than wisdom (without requiring a bunch of modifications outside of this script), please feel free!
Code:
////////////////////////////////////////////////////////////////////////////////
//
// Cooking Oven
// cf_oven_onclose
// By Don Anderson
// [email protected]
//
// Cooks Fresh Meat into Cooked Meat
//
// To add more meats follow the examples below
//
////////////////////////////////////////////////////////////////////////////////
void main()
{
object oPC = GetLastClosedBy();
object oSelf = OBJECT_SELF;
object oItem = GetFirstItemInInventory(oSelf);
//End if it's empty
if (!GetIsObjectValid(oItem)) return;
string sName = GetName(oItem);
string sFBear = "Fresh Bear";
string sRBear = "roastbear";
string sFBeef = "Fresh Beef";
string sRBeef = "roastbeef";
string sFChicken = "Fresh Chicken";
string sRChicken = "roastchicken";
string sFPork = "Fresh Pork";
string sRPork = "roastpork";
string sFVenison = "Fresh Venison";
string sRVenison = "roastvenison";
string sFTrout = "Fresh Trout";
string sFBass = "Fresh Bass";
string sFCod = "Fresh Cod";
string sFPike = "Fresh Pike";
string sRFillet = "roastfish";
string sFMeat = "Fresh Meat"; //Thayan 9/22/07
string sRMeat = "roastmeat"; //Thayan 9/22/07
//Burned Types
string sBMeat = "burnedmeat";
string sBFish = "burnedfish";
string sRBread = "burnedbread";
int nWis = GetAbilityModifier(ABILITY_WISDOM,oPC);
if(nWis < 0) nWis = 0;
//int nSkill = GetLocalInt(oPC,"COOKING_SKILL");
int nSkill = 0;
int nBurn = Random(4);//9 when Cooking Skill is Implemented
//Wisdom Based Cooking is Turn On from opw_mod_onload
int nWISCOOK = GetLocalInt(GetModule(),"WISCOOK");
if(nWISCOOK == 0) nSkill = 100; //Equal to d100 Roll...Guaranteed Cooking
/******************************************************************************/
//: UNBURNED FOOD
//Success
if((nWis + nSkill) >= nBurn)
{
while(GetIsObjectValid(oItem))
{
if (sName == sFBear)
{ //Bear 3
CreateItemOnObject(sRBear, oPC, 1);
CreateItemOnObject(sRBear, oPC, 1);
CreateItemOnObject(sRBear, oPC, 1);
DestroyObject(oItem);
SpeakString("Good Cooking!");
}
if (sName == sFBeef)
{ //Beef 3
CreateItemOnObject(sRBeef, oPC, 1);
CreateItemOnObject(sRBeef, oPC, 1);
CreateItemOnObject(sRBeef, oPC, 1);
DestroyObject(oItem);
SpeakString("Good Cooking!");
}
if (sName == sFChicken)
{ //Chicken 1
CreateItemOnObject(sRChicken, oPC, 1);
DestroyObject(oItem);
SpeakString("Good Cooking!");
}
if (sName == sFPork)
{ //Pork 2
CreateItemOnObject(sRPork, oPC, 1);
CreateItemOnObject(sRPork, oPC, 1);
DestroyObject(oItem);
SpeakString("Good Cooking!");
}
if (sName == sFVenison)
{ //Venison 2
CreateItemOnObject(sRVenison, oPC, 1);
CreateItemOnObject(sRVenison, oPC, 1);
DestroyObject(oItem);
SpeakString("Good Cooking!");
}
if (sName == sFTrout || sName == sFBass || sName == sFPike || sName == sFCod)
{ //Trout, Bass, Pike, Cod 1
CreateItemOnObject(sRFillet, oPC, 1);
DestroyObject(oItem);
SpeakString("Good Cooking!");
}
if (sName == sFMeat)
{ //Diseased Meat 1
CreateItemOnObject(sRMeat, oPC, 1);
DestroyObject(oItem);
SpeakString("Good Cooking!");
}
oItem = GetNextItemInInventory(oSelf);
}
}
//: UNBURNED FOOD
/******************************************************************************/
/******************************************************************************/
//: BURNED FOOD
if((nWis + nSkill) < nBurn)
{
oItem = GetFirstItemInInventory(oSelf);
while(GetIsObjectValid(oItem))
{
if (sName == sFBear || sName == sFBeef || sName == sFChicken || sName == sFPork || sName == sFVenison)
{ //Bear, Beef, Chicken, Pork, Venison, Diseased Meat
CreateItemOnObject(sBMeat, oPC, 1);
DestroyObject(oItem);
SpeakString("You burned the meat.");
}
if (sName == sFTrout || sName == sFBass || sName == sFPike || sName == sFCod)
{ ///Trout, Bass, Pike, Cod 1
CreateItemOnObject(sBFish, oPC, 1);
DestroyObject(oItem);
SpeakString("You burned the meat.");
}
oItem = GetNextItemInInventory(oSelf);
}
}
//: BURNED FOOD
/******************************************************************************/
}