Once it hits the max Honey of 20 it will not produce any more honey and you can extract the honey by going to the production gump and clicking on the honey jar. if you have empty bottles in you backpack.
Takes 3 honey to make a jar of honey.
Drop it in your js folder any where and add script number 5032 to your js file if it is not used.
First you will need both of this items for.
[beehive]
{
get=base_item
name=Bee Hive
id=2330
weight=100
script=5032
}
[bees]
{
get=base_item
name=Bee's
id=0x91b
weight=100
}
{
get=base_item
name=Bee Hive
id=2330
weight=100
script=5032
}
[bees]
{
get=base_item
name=Bee's
id=0x91b
weight=100
}
///////////////////////////////////////////
// Apiculture Version 0.1 //
// Written by Dragon Slayer //
///////////////////////////////////////////
var hivestage = 0; //growth stage
var honey = 0; //amount of Honey
var maxhoney = 20; // Max Amount of Honey it can hold Chnage this number to your liking
const scriptID = 5032;
const BeeHiveTimer = 82800000; // This is 23 Hours before it will go to the next stage and produce honey.
function onUseChecked(pUser, iUsed)
{
var socket = pUser.socket;
socket.tempObj = iUsed;
var BeeHiveGump = new Gump;
var gumpID = scriptID + 0xffff;
socket.CloseGump(gumpID, 0);
iUsed.StartTimer(BeeHiveTimer, 0, true);
BeeHiveGump.AddPage(0);
BeeHiveGump.AddBackground(37, 26, 205, 161, 3600);
//vines
BeeHiveGump.AddPicture(12, 91, 3307);
BeeHiveGump.AddPicture(11, 24, 3307);
BeeHiveGump.AddPicture(206, 87, 3307);
BeeHiveGump.AddPicture(205, 20, 3307);
BeeHiveGump.AddGump(101, 66, 1417); //circle thing
BeeHiveGump.AddPicture(118, 89, 2330); //beehive
//status icons
BeeHiveGump.AddPicture(44, 49, 5154);//honey
//corner boxes
BeeHiveGump.AddGump(34, 20, 210);
BeeHiveGump.AddGump(228, 20, 210);
BeeHiveGump.AddGump(34, 172, 210);
BeeHiveGump.AddGump(228, 172, 210);
AddLevel(BeeHiveGump)
BeeHiveGump.AddButton(58, 46, 212, 212, 1, 0, 1);//Button to open production gump
BeeHiveGump.Send(pUser);
BeeHiveGump.Free();
}
function AddLevel(BeeHiveGump)
{
BeeHiveGump.AddText(30, 20, 0x481, " " + hivestage );
}
function BeeHiveProductionGump(pUser, iUsed)
{
var socket = pUser.socket;
socket.tempObj = iUsed;
var BeeHiveGump = new Gump;
var gumpID = scriptID + 0xffff;
socket.CloseGump(gumpID, 0);
BeeHiveGump.AddPage(0);
BeeHiveGump.AddBackground(37, 133, 205, 54, 3600);
BeeHiveGump.AddBackground(37, 67, 205, 80, 3600);
BeeHiveGump.AddBackground(37, 26, 205, 55, 3600);
BeeHiveGump.AddPicture(12, 91, 3307);
BeeHiveGump.AddPicture(11, 24, 3307);
BeeHiveGump.AddPicture(206, 87, 3307);
BeeHiveGump.AddPicture(205, 20, 3307);
BeeHiveGump.AddPicture(76, 99, 5154);
BeeHiveGump.AddPicture(149, 97, 2540);
if (hivestage == 0)
{//too early to produce
BeeHiveGump.AddText(185, 97, 37, "X");
}
else
{
BeeHiveGump.AddText(185, 97, 0x481, " " + honey);
}
BeeHiveGump.AddText(110, 43, 92, "Production");
BeeHiveGump.AddPicture(44, 47, 6256);
BeeHiveGump.AddPicture(191, 151, 2540);
BeeHiveGump.AddPicture(42, 153, 5154);
BeeHiveGump.AddGump(162, 96, 212);
BeeHiveGump.AddGump(90, 96, 212);
BeeHiveGump.AddButton(204, 150, 212, 212, 1, 0, 2);//get honey
BeeHiveGump.AddButton(57, 43, 212, 212, 1, 0, 3);//exit back to home gump
BeeHiveGump.Send(pUser);
BeeHiveGump.Free();
}
function onTimer(myObj, timerID)
{
var basehoney = 0;
if (!ValidateObject(myObj))
return;
switch (timerID)
{
case 0:
myObj.SetTag("BeeStatus", 1)
myObj.StartTimer(BeeHiveTimer, 1, true);
break;
case 1:
hivestage = 1;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 2, true);
break;
case 2:
hivestage = 2;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 3, true);
break;
case 3:
hivestage = 3;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 4, true);
break;
case 4:
hivestage = 4;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 5, true);
break;
case 5:
hivestage = 5;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 6, true);
break;
case 6:
hivestage = 6;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 7, true);
break;
case 7:
hivestage = 7;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 8, true);
break;
case 8:
hivestage = 8;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 8, true);
break;
}
}
function onGumpPress(socket, pButton, gumpData)
{
var pUser = socket.currentChar;
var iUsed = socket.tempObj;
switch (pButton)
{
case 0:
break;
case 1:
TriggerEvent(scriptID, "BeeHiveProductionGump", pUser, iUsed);
break;
case 2:
var iMakeResource = pUser.ResourceCount(0x0F0E);
if (honey < 3)
{
socket.SysMessage("There isn't enough honey in the hive to fill a bottle!");
TriggerEvent(scriptID, "BeeHiveProductionGump", pUser, iUsed);
break;
}
if (iMakeResource)
{
honey -= 3;
CreateDFNItem(socket, pUser, "0x09EC", 1, "ITEM", true);
socket.SysMessage("You fill a bottle with golden honey and place it in your pack.");
pUser.UseResource(1, 0x0F0E);
TriggerEvent(scriptID, "BeeHiveProductionGump", pUser, iUsed);
break;
}
else
{
socket.SysMessage("You need a bottle to fill with honey!");
TriggerEvent(scriptID, "BeeHiveProductionGump", pUser, iUsed);
break;
}
case 3:
TriggerEvent(scriptID, "onUseChecked", pUser, iUsed);
break;
}
}
// Apiculture Version 0.1 //
// Written by Dragon Slayer //
///////////////////////////////////////////
var hivestage = 0; //growth stage
var honey = 0; //amount of Honey
var maxhoney = 20; // Max Amount of Honey it can hold Chnage this number to your liking
const scriptID = 5032;
const BeeHiveTimer = 82800000; // This is 23 Hours before it will go to the next stage and produce honey.
function onUseChecked(pUser, iUsed)
{
var socket = pUser.socket;
socket.tempObj = iUsed;
var BeeHiveGump = new Gump;
var gumpID = scriptID + 0xffff;
socket.CloseGump(gumpID, 0);
iUsed.StartTimer(BeeHiveTimer, 0, true);
BeeHiveGump.AddPage(0);
BeeHiveGump.AddBackground(37, 26, 205, 161, 3600);
//vines
BeeHiveGump.AddPicture(12, 91, 3307);
BeeHiveGump.AddPicture(11, 24, 3307);
BeeHiveGump.AddPicture(206, 87, 3307);
BeeHiveGump.AddPicture(205, 20, 3307);
BeeHiveGump.AddGump(101, 66, 1417); //circle thing
BeeHiveGump.AddPicture(118, 89, 2330); //beehive
//status icons
BeeHiveGump.AddPicture(44, 49, 5154);//honey
//corner boxes
BeeHiveGump.AddGump(34, 20, 210);
BeeHiveGump.AddGump(228, 20, 210);
BeeHiveGump.AddGump(34, 172, 210);
BeeHiveGump.AddGump(228, 172, 210);
AddLevel(BeeHiveGump)
BeeHiveGump.AddButton(58, 46, 212, 212, 1, 0, 1);//Button to open production gump
BeeHiveGump.Send(pUser);
BeeHiveGump.Free();
}
function AddLevel(BeeHiveGump)
{
BeeHiveGump.AddText(30, 20, 0x481, " " + hivestage );
}
function BeeHiveProductionGump(pUser, iUsed)
{
var socket = pUser.socket;
socket.tempObj = iUsed;
var BeeHiveGump = new Gump;
var gumpID = scriptID + 0xffff;
socket.CloseGump(gumpID, 0);
BeeHiveGump.AddPage(0);
BeeHiveGump.AddBackground(37, 133, 205, 54, 3600);
BeeHiveGump.AddBackground(37, 67, 205, 80, 3600);
BeeHiveGump.AddBackground(37, 26, 205, 55, 3600);
BeeHiveGump.AddPicture(12, 91, 3307);
BeeHiveGump.AddPicture(11, 24, 3307);
BeeHiveGump.AddPicture(206, 87, 3307);
BeeHiveGump.AddPicture(205, 20, 3307);
BeeHiveGump.AddPicture(76, 99, 5154);
BeeHiveGump.AddPicture(149, 97, 2540);
if (hivestage == 0)
{//too early to produce
BeeHiveGump.AddText(185, 97, 37, "X");
}
else
{
BeeHiveGump.AddText(185, 97, 0x481, " " + honey);
}
BeeHiveGump.AddText(110, 43, 92, "Production");
BeeHiveGump.AddPicture(44, 47, 6256);
BeeHiveGump.AddPicture(191, 151, 2540);
BeeHiveGump.AddPicture(42, 153, 5154);
BeeHiveGump.AddGump(162, 96, 212);
BeeHiveGump.AddGump(90, 96, 212);
BeeHiveGump.AddButton(204, 150, 212, 212, 1, 0, 2);//get honey
BeeHiveGump.AddButton(57, 43, 212, 212, 1, 0, 3);//exit back to home gump
BeeHiveGump.Send(pUser);
BeeHiveGump.Free();
}
function onTimer(myObj, timerID)
{
var basehoney = 0;
if (!ValidateObject(myObj))
return;
switch (timerID)
{
case 0:
myObj.SetTag("BeeStatus", 1)
myObj.StartTimer(BeeHiveTimer, 1, true);
break;
case 1:
hivestage = 1;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 2, true);
break;
case 2:
hivestage = 2;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 3, true);
break;
case 3:
hivestage = 3;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 4, true);
break;
case 4:
hivestage = 4;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 5, true);
break;
case 5:
hivestage = 5;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 6, true);
break;
case 6:
hivestage = 6;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 7, true);
break;
case 7:
hivestage = 7;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 8, true);
break;
case 8:
hivestage = 8;
if (honey < maxhoney)
{
basehoney++;
honey += basehoney;
}
myObj.StartTimer(BeeHiveTimer, 8, true);
break;
}
}
function onGumpPress(socket, pButton, gumpData)
{
var pUser = socket.currentChar;
var iUsed = socket.tempObj;
switch (pButton)
{
case 0:
break;
case 1:
TriggerEvent(scriptID, "BeeHiveProductionGump", pUser, iUsed);
break;
case 2:
var iMakeResource = pUser.ResourceCount(0x0F0E);
if (honey < 3)
{
socket.SysMessage("There isn't enough honey in the hive to fill a bottle!");
TriggerEvent(scriptID, "BeeHiveProductionGump", pUser, iUsed);
break;
}
if (iMakeResource)
{
honey -= 3;
CreateDFNItem(socket, pUser, "0x09EC", 1, "ITEM", true);
socket.SysMessage("You fill a bottle with golden honey and place it in your pack.");
pUser.UseResource(1, 0x0F0E);
TriggerEvent(scriptID, "BeeHiveProductionGump", pUser, iUsed);
break;
}
else
{
socket.SysMessage("You need a bottle to fill with honey!");
TriggerEvent(scriptID, "BeeHiveProductionGump", pUser, iUsed);
break;
}
case 3:
TriggerEvent(scriptID, "onUseChecked", pUser, iUsed);
break;
}
}