New and Unique (Quest Reward) Items
#63
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!
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
/******************************************************************************/
}
Reply


Messages In This Thread
New and Unique (Quest Reward) Items - by Balanor - 12-18-2013, 11:11 AM
RE: New and Unique (Quest Reward) Items - by Muse - 12-19-2013, 09:50 AM
RE: New and Unique (Quest Reward) Items - by Muse - 12-19-2013, 11:26 AM
RE: New and Unique (Quest Reward) Items - by Nehetsrev - 12-20-2013, 10:22 AM
RE: New and Unique (Quest Reward) Items - by Bela - 12-20-2013, 04:20 PM
RE: New and Unique (Quest Reward) Items - by Bela - 12-26-2013, 05:30 AM
RE: New and Unique (Quest Reward) Items - by Muse - 01-01-2014, 03:06 AM
RE: New and Unique (Quest Reward) Items - by Muse - 01-21-2014, 04:38 PM
RE: New and Unique (Quest Reward) Items - by Nehetsrev - 03-13-2014, 10:06 AM
RE: New and Unique (Quest Reward) Items - by Bela - 03-14-2014, 03:06 PM
RE: New and Unique (Quest Reward) Items - by Wids - 11-18-2014, 07:01 AM
RE: New and Unique (Quest Reward) Items - by Wids - 01-13-2015, 11:19 AM
RE: New and Unique (Quest Reward) Items - by Wids - 01-15-2015, 01:28 AM
RE: New and Unique (Quest Reward) Items - by Balanor - 01-15-2015, 12:23 PM
RE: New and Unique (Quest Reward) Items - by Wids - 01-16-2015, 02:17 AM
RE: New and Unique (Quest Reward) Items - by Wids - 07-03-2015, 02:56 AM
RE: New and Unique (Quest Reward) Items - by Wids - 07-04-2015, 09:59 AM
RE: New and Unique (Quest Reward) Items - by Nehetsrev - 08-08-2015, 02:37 PM

Forum Jump:


Users browsing this thread: 53 Guest(s)