//::////////////////////////////////////////////// //:: Name: farm_include //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Include script housing all necessary functions for the farming system. Note: Do NOT modify this script - for internal use only. */ //::////////////////////////////////////////////// //:: Created By: Adam Walenga //:: Created On: August 30th, 2004 //::////////////////////////////////////////////// //============================================================================\\ #include "mn_dblocation" //Returns the maximum farm number. Used in loops to retrieve all farms. int Farm_GetMaxFarm() { return GetCampaignInt ("Farm_Main_Database", "Max_Farm_Number"); } //Sets the current max farm number. void Farm_SetMaxFarm (int iNewMax) { SetCampaignInt ("Farm_Main_Database", "Max_Farm_Number", iNewMax); } //Return the current owner ("FARM" + login) for the specified farm. string Farm_GetOwner (int iFarmNumber) { return GetCampaignString ("Farm" + IntToString (iFarmNumber) + "_Database", "Farm_Owner"); } //Set the owner for specified farm. // iFarmNumber: This corresponds to the exact farm. // oOwner: The PC with which to have the farm belong to. void Farm_SetOwner (int iFarmNumber, object oOwner) { SetCampaignString ("Farm" + IntToString (iFarmNumber) + "_Database", "Farm_Owner", "FARM_" + GetPCPlayerName (oOwner)); } //Return the specified plant resref for the farm. // iFarmNumber: Refers to the specific farm. // iPlant: This is the plant number, for easy finding/storing. string Farm_GetPlantResRef (int iFarmNumber, int iPlant) { return GetCampaignString ("Farm" + IntToString (iFarmNumber) + "_Database", "Plant" + IntToString (iPlant) + "_ResRef"); } //Store the specified plant resref for the farm. // iFarmNumber: Refers to the specific farm. // iPosition: Refers to the position in the DB on where to store the resref. // sResRef: The resref to store. void Farm_SetPlantResRef (int iFarmNumber, int iPosition, string sResRef) { SetCampaignString ("Farm" + IntToString (iFarmNumber) + "_Database", "Plant" + IntToString (iPosition) + "_ResRef", sResRef); } //Return the location for the specified plant on the farm. // iFarmNumber: Refers to the specific farm. // iPlant: Plant number for the specified farm. location Farm_GetPlantLocation (int iFarmNumber, int iPlant) { return mn_GetCampaignLocation ("Farm" + IntToString (iFarmNumber) + "_Database", "Plant" + IntToString (iPlant) + "_Location"); } //Store the specified plant location for the farm. // iFarmNumber: Refers to the specified farm. // iPlant: Plant number for the specific farm. // lLoc: Location of the specified plant. void Farm_SetPlantLocation (int iFarmNumber, int iPlant, location lLoc) { mn_SetCampaignLocation ("Farm" + IntToString (iFarmNumber) + "_Database", "Plant" + IntToString (iPlant) + "_Location", lLoc); } //Returns the maximum plant count for the specified farmland. // iFarmNumber: Refers to the specified farm. int Farm_GetMaxPlantNumber (int iFarmNumber) { return GetCampaignInt ("Farm" + IntToString (iFarmNumber) + "_Database", "Max_Plant_Number"); } //Set the maximum plant number for the specified farm. // iFarmNumber: Refers to the specific farm. // iMaxPlant: This is the value for the maximum plant count. void Farm_SetMaxPlantNumber (int iFarmNumber, int iMaxPlant) { SetCampaignInt ("Farm" + IntToString (iFarmNumber) + "_Database", "Max_Plant_Number", iMaxPlant); } //Returns TRUE or FALSE for if the specified farm is for same or not. // iFarmNumber: Refers to the specified farm. int Farm_GetIsForSale (int iFarmNumber) { return GetCampaignInt ("Farm" + IntToString (iFarmNumber) + "_Database", "For_Sale"); } //Set whether or not the specified farm is for sale. // iFarmNumber: Refers to the specified farm. // iStatus: TRUE or FALSE void Farm_SetIsForSale (int iFarmNumber, int iStatus) { SetCampaignInt ("Farm" + IntToString (iFarmNumber) + "_Database", "For_Sale", iStatus); } //Return the current asking price for the specified farm. // iFarmNumber: Refers to the specific farm. int Farm_GetSellPrice (int iFarmNumber) { return GetCampaignInt ("Farm" + IntToString (iFarmNumber) + "_Database", "Sell_Price"); } //Set the sell price for the specified farm. // iFarmNumber: Refers to the specific farm. // iSellPrice: This is the sell price for the farm (or what would be needed // to buy it). void Farm_SetSellPrice (int iFarmNumber, int iSellPrice) { SetCampaignInt ("Farm" + IntToString (iFarmNumber) + "_Database", "Sell_Price", iSellPrice); }