Aschbourne_PRC8/_module/nss/_craft_brewvat.nss
GetOffMyYarn 69879d6957 Areas and Fixes
Added CCOH and missing areas
Changed some areas to be craftable,
Fixed some on death issues,
Fixed the Gaurd
2024-08-30 11:38:44 -04:00

1220 lines
49 KiB
Plaintext

#include "nw_i0_plot"
#include "aps_include"
int CheckComponent(object oPC, string sTag, int iMinimum);
void RemoveComponent(object oPC, string sTag, int iMinimum);
void SendMissingMessage(object oPC);
void CreateAnObject(string sResource, object oPC, int iProduct);
void main()
{
int iUseMode = 0;
if (GetInventoryDisturbType()!= INVENTORY_DISTURB_TYPE_ADDED)
{
iUseMode = 99;
if (GetLastDisturbed() == OBJECT_SELF)
{
DestroyObject(GetInventoryDisturbItem());
return;
}
}
object oPC = GetLastDisturbed();
object oItem = GetInventoryDisturbItem();
string sTag = GetTag(oItem);
string sMessage;
object oSelf = OBJECT_SELF;
if (iUseMode == 0)
{
// The following 3 lines are to ensure compatability with UOAbigal's Persistent Token System.
// You can replace them with whatever 'no-drop' code you have or comment them out.
string sNoDropFlag = (GetStringLeft(GetTag(oItem),6));
if (sNoDropFlag == "NoDrop" || sNoDropFlag == "TOKEN_"||sNoDropFlag=="_TBOX_")
return;
if (GetBaseItemType(oItem)==BASE_ITEM_LARGEBOX)
{
DestroyObject(oItem);
SendMessageToPC(oPC,"To avoid possible dupe exploits, the container placed in this bag may be destroyed.");
return;
}
FloatingTextStringOnCreature("You must select a recipe to brew anything.",oPC,FALSE);
return;
// End of compatability portion.
}
if (GetStringLeft(GetResRef(oItem),6)!="recipe")
{
if (sTag=="SWITCH_062"){SetLocalInt(oPC,"iUseBrewType",0);sMessage="Ciders.";}
if (sTag=="SWITCH_063"){SetLocalInt(oPC,"iUseBrewType",1);sMessage="Wines.";}
if (sTag=="SWITCH_064"){SetLocalInt(oPC,"iUseBrewType",2);sMessage="Lagers.";}
if (sTag=="SWITCH_065"){SetLocalInt(oPC,"iUseBrewType",3);sMessage="Ales.";}
if (sTag=="SWITCH_066"){SetLocalInt(oPC,"iUseBrewType",4);sMessage="Meads.";}
if (sTag=="SWITCH_067"){SetLocalInt(oPC,"iUseBrewType",5);sMessage="Whiskeys.";}
if (sTag=="SWITCH_068"){SetLocalInt(oPC,"iUseBrewType",6);sMessage="Rums.";}
if (GetStringLeft(sTag,7)=="SWITCH_")
{
FloatingTextStringOnCreature("Preparing to make "+sMessage,oPC,FALSE);
DestroyObject(oItem);
string sTagSelf = GetTag(oSelf);
AssignCommand(oPC,DoPlaceableObjectAction(oSelf,PLACEABLE_ACTION_USE));
AssignCommand(oPC,DelayCommand(1.5,DoPlaceableObjectAction(GetNearestObjectByTag(sTagSelf,oPC,1),PLACEABLE_ACTION_USE)));
}
return;
}
int iBrew = StringToInt(GetStringRight(sTag,3));
string sProduct = "INVALID";
string sSuccess;
string sFail;
int iMissing;
int iDifficulty;
int iByproduct1;
int iByproduct2;
int iByproduct3;
string sByproduct1;
string sByproduct2;
string sByproduct3;
string sFailKeg;
int iRandom;
int iSkillGain;
CopyItem(oItem,OBJECT_SELF);
DestroyObject(oItem,0.5);
if (iBrew==31) // Apple Cider
{
iDifficulty = -100;
if (CheckComponent(oPC,"item_juice_001",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_006",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_juice_001",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"item_cask_006",1);
sSuccess="You carefully combine the ingredients, and seal the jug.";
sFail = "The yeast fails to ferment the ingredients and the cider is ruined.";
sProduct = "item_fullkeg_001";
sByproduct1 = "glassbottle";
iByproduct1 = 1;
sFailKeg = "item_cask_006";
}
if (iBrew==32) // House Cider
{
if (CheckComponent(oPC,"item_juice_001",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_006",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_003",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_juice_001",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"item_cask_006",1);
RemoveComponent(oPC,"item_syrup_003",1);
sSuccess="You carefully combine the ingredients, and seal the jug.";
sFail = "The yeast fails to ferment the ingredients, and the cider is ruined.";
sProduct = "item_fullkeg_002";
sByproduct1 = "glassbottle";
iByproduct1 = 1;
sFailKeg = "item_cask_006";
}
if (iBrew==33) // Scrumpy
{
iDifficulty = 10;
if (CheckComponent(oPC,"item_juice_022",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_006",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_juice_022",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"item_cask_006",1);
sSuccess="You carefully combine the ingredients, and seal the jug.";
sFail = "The yeast fails to ferment the ingredients. The scrumpy is ruined.";
sProduct = "item_fullkeg_003";
sByproduct1 = "glassbottle";
iByproduct1 = 1;
sFailKeg = "item_cask_006";
}
if (iBrew==34) // Cyser
{
iDifficulty = 25;
if (CheckComponent(oPC,"item_juice_001",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_006",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_HONEY",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_juice_001",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"item_cask_006",1);
RemoveComponent(oPC,"ITEM_HONEY",1);
sSuccess="You carefully combine the ingredients, and seal the jug.";
sFail = "The yeast fails to ferment the ingredients. The cyser is ruined.";
sProduct = "item_fullkeg_004";
sByproduct1 = "glassbottle";
iByproduct1 = 1;
sFailKeg = "item_cask_006";
}
if (iBrew==35) // Blueberry Cider
{
iDifficulty = 50;
if (CheckComponent(oPC,"item_fullkeg_001",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_juice_007",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_fullkeg_001",1);
RemoveComponent(oPC,"item_juice_007",1);
sSuccess="You carefully combine the blueberry juice with the cider.";
sFail = "The mixture is contaminated as you attempt to add the blueberry juice.";
sProduct = "item_fullkeg_005";
sByproduct1 = "glassbottle";
iByproduct1 = 1;
sFailKeg = "item_cask_006";
}
if (iBrew==36) // Blackberry Cider
{
iDifficulty = 50;
if (CheckComponent(oPC,"item_fullkeg_001",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_juice_006",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_fullkeg_001",1);
RemoveComponent(oPC,"item_juice_006",1);
sSuccess="You carefully combine the blackberry juice with the cider.";
sFail = "The mixture is contaminated as you attempt to add the blackberry juice.";
sProduct = "item_fullkeg_006";
sByproduct1 = "glassbottle";
iByproduct1 = 1;
sFailKeg = "item_cask_006";
}
if (iBrew==37) // Grape Cider
{
iDifficulty = 50;
if (CheckComponent(oPC,"item_fullkeg_001",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_juice_003",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_fullkeg_001",1);
RemoveComponent(oPC,"item_juice_003",1);
sSuccess="You carefully combine the grape juice with the cider.";
sFail = "The mixture is contaminated as you attempt to add the grape juice.";
sProduct = "item_fullkeg_007";
sByproduct1 = "glassbottle";
iByproduct1 = 1;
sFailKeg = "item_cask_006";
}
if (iBrew==38) // Somerset Cider
{
iDifficulty = 100;
if (CheckComponent(oPC,"item_fullkeg_001",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_fullkeg_001",1);
RemoveComponent(oPC,"item_yeast002",1);
sSuccess="You carefully combine the top yeast with the cider.";
sFail = "The mixture is contaminated as you attempt to add the top yeast.";
sProduct = "item_fullkeg_008";
sFailKeg = "item_cask_006";
}
//wines
if (iBrew==39) // Red Wine
{
if (CheckComponent(oPC,"item_juice_004",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_001",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_003",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_juice_004",3);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"item_cask_001",1);
RemoveComponent(oPC,"item_syrup_003",1);
sSuccess="You carefully combine the ingredients, and seal the cask.";
sFail = "The yeast fails to ferment the ingredients, and the wine is ruined.";
sProduct = "item_fullkeg_009";
sByproduct1 = "glassbottle";
iByproduct1 = 3;
sFailKeg = "item_cask_001";
}
if (iBrew==40) // White Wine
{
if (CheckComponent(oPC,"item_juice_005",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_001",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_003",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_juice_005",3);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"item_cask_001",1);
RemoveComponent(oPC,"item_syrup_003",1);
sSuccess="You carefully combine the ingredients, and seal the cask.";
sFail = "The yeast fails to ferment the ingredients. The wine is ruined.";
sProduct = "item_fullkeg_010";
sByproduct1 = "glassbottle";
iByproduct1 = 3;
sFailKeg = "item_cask_001";
}
if (iBrew==41) // Sherry
{
iDifficulty = 150;
if (CheckComponent(oPC,"item_fullkeg_009",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_003",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_fullkeg_009",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"item_syrup_003",1);
sSuccess="You carefully combine the bottom yeast, sugar, and red wine and seal the cask.";
sFail = "The yeast fails to ferment the ingredients. The sherry is ruined.";
sProduct = "item_fullkeg_012";
sFailKeg = "item_cask_001";
}
if (iBrew==73) // Purple Wine
{
if (CheckComponent(oPC,"item_juice_003",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_001",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_003",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_juice_003",3);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"item_cask_001",1);
RemoveComponent(oPC,"item_syrup_003",1);
sSuccess="You carefully combine the ingredients, and seal the cask.";
sFail = "The yeast fails to ferment the ingredients. The wine is ruined.";
sProduct = "item_fullkeg_011";
sByproduct1 = "glassbottle";
iByproduct1 = 3;
sFailKeg = "item_cask_001";
}
//Lagers
if (iBrew==42) // Standard Lager
{
if (CheckComponent(oPC,"item_wort_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",5)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"SEED_HOPS",3);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",5);
RemoveComponent(oPC,"item_cask_002",1);
sSuccess="You combine the water, hops, barley wort, and bottom yeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The lager is ruined.";
sProduct = "item_fullkeg_013";
sByproduct1 = "item001";
iByproduct1 = 5;
sFailKeg = "item_cask_002";
}
if (iBrew==43) // Dry Lager
{
if (CheckComponent(oPC,"item_wort_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",5)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"SEED_HOPS",4);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",5);
RemoveComponent(oPC,"item_cask_002",1);
sSuccess="You combine the water, hops, barley wort, and bottom yeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The lager is ruined.";
sProduct = "item_fullkeg_014";
sByproduct1 = "item001";
iByproduct1 = 5;
sFailKeg = "item_cask_002";
}
if (iBrew==44) // Light Lager
{
iDifficulty = 100;
if (CheckComponent(oPC,"item_wort_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",6)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"SEED_HOPS",3);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",6);
RemoveComponent(oPC,"item_cask_002",1);
sSuccess="You combine the water, hops, barley wort, and bottom yeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The lager is ruined.";
sProduct = "item_fullkeg_015";
sByproduct1 = "item001";
iByproduct1 = 6;
sFailKeg = "item_cask_002";
}
if (iBrew==45) // Draught Lager
{
iDifficulty = 100;
if (CheckComponent(oPC,"item_wort_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"SEED_HOPS",3);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",1);
sSuccess="You combine the water, hops, barley wort, caramel, and bottom yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The draught is ruined.";
sProduct = "item_fullkeg_016";
sByproduct1 = "item001";
iByproduct1 = 4;
sFailKeg = "item_cask_002";
}
if (iBrew==46) // Red Malt Lager
{
iDifficulty = 150;
if (CheckComponent(oPC,"item_wort_005",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",6)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",2);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"SEED_HOPS",6);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
sSuccess="You combine the water, hops, barley wort, and bottom yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The red malt lager is ruined.";
sProduct = "item_fullkeg_017";
sByproduct1 = "item001";
iByproduct1 = 4;
sFailKeg = "item_cask_002";
}
if (iBrew==47) // Gold Malt Lager
{
iDifficulty = 150;
if (CheckComponent(oPC,"item_wort_005",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",2)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",2);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"SEED_HOPS",2);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",2);
sSuccess="You combine the water, hops, barley wort, caramel, and bottom yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The gold malt lager is ruined.";
sProduct = "item_fullkeg_018";
sByproduct1 = "item001";
iByproduct1 = 4;
sFailKeg = "item_cask_002";
}
if (iBrew==48) // Ice Lager
{
iDifficulty = 200;
if (CheckComponent(oPC,"item_wort_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_002",3)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"SEED_HOPS",3);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_002",3);
sSuccess="You combine the water, hops, barley wort, molasses, and bottom yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The ice lager is ruined.";
sProduct = "item_fullkeg_019";
sByproduct1 = "item001";
iByproduct1 = 4;
sFailKeg = "item_cask_002";
}
if (iBrew==49) // Stout Lager
{
iDifficulty = 300;
if (CheckComponent(oPC,"item_wort_005",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",3)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",2);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"SEED_HOPS",4);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",3);
sSuccess="You combine the water, hops, barley wort, caramel, and bottom yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The stout lager is ruined.";
sProduct = "item_fullkeg_020";
sByproduct1 = "item001";
iByproduct1 = 4;
sFailKeg = "item_cask_002";
}
//Ale
if (iBrew==50) // Standard Ale
{
iDifficulty = 50;
if (CheckComponent(oPC,"item_wort_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",5)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",1);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"SEED_HOPS",4);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",5);
RemoveComponent(oPC,"item_cask_002",1);
sSuccess="You combine the water, hops, barley wort, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The ale is ruined.";
sProduct = "item_fullkeg_021";
sByproduct1 = "item001";
iByproduct1 = 5;
sFailKeg = "item_cask_002";
}
if (iBrew==51) // Stout Ale
{
iDifficulty = 150;
if (CheckComponent(oPC,"item_wort_005",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",5)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",2)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",3);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"SEED_HOPS",5);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",2);
sSuccess="You combine the water, hops, barley wort, caramel, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The stout ale is ruined.";
sProduct = "item_fullkeg_022";
sByproduct1 = "item001";
iByproduct1 = 4;
sFailKeg = "item_cask_002";
}
if (iBrew==52) // Porter Ale
{
iDifficulty = 150;
if (CheckComponent(oPC,"item_wort_005",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_002",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",2);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"SEED_HOPS",4);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",2);
RemoveComponent(oPC,"item_syrup_004",1);
sSuccess="You combine the water, hops, barley wort, caramel, molasses, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The porter ale is ruined.";
sProduct = "item_fullkeg_023";
sByproduct1 = "item001";
iByproduct1 = 4;
sFailKeg = "item_cask_002";
}
if (iBrew==53) // Barleywine Ale
{
iDifficulty = 200;
if (CheckComponent(oPC,"item_wort_005",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_juice_003",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",3);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"SEED_HOPS",2);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",2);
RemoveComponent(oPC,"item_juice_003",1);
sSuccess="You combine the water, hops, barley wort, caramel, grape juice, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The barleywine ale is ruined.";
sProduct = "item_fullkeg_024";
sByproduct1 = "item001";
iByproduct1 = 4;
sByproduct2 = "glassbottle";
iByproduct2 = 1;
sFailKeg = "item_cask_002";
}
if (iBrew==54) // kolsch Ale
{
iDifficulty = 250;
if (CheckComponent(oPC,"item_wort_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_HOPS",5)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",3)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_005",1);
RemoveComponent(oPC,"item_yeast002",2);
RemoveComponent(oPC,"SEED_HOPS",5);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",3);
sSuccess="You combine the water, hops, barley wort, caramel, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The kolsch ale is ruined.";
sProduct = "item_fullkeg_025";
sByproduct1 = "item001";
iByproduct1 = 4;
sFailKeg = "item_cask_002";
}
//Mead
if (iBrew==55) // Honeymead
{
iDifficulty = -50;
if (CheckComponent(oPC,"ITEM_HONEY",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"ITEM_HONEY",4);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
sSuccess="You combine the water, honey, caramel, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The honeymead is ruined.";
sProduct = "item_fullkeg_026";
sByproduct1 = "item001";
iByproduct1 = 2;
sFailKeg = "item_cask_003";
}
if (iBrew==56) // Sackmead
{
if (CheckComponent(oPC,"ITEM_HONEY",6)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"ITEM_HONEY",6);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
sSuccess="You combine the water, honey, caramel, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The sackmead is ruined.";
sProduct = "item_fullkeg_027";
sByproduct1 = "item001";
iByproduct1 = 2;
sFailKeg = "item_cask_003";
}
if (iBrew==57) // Apple Muslin Mead
{
iDifficulty = 50;
if (CheckComponent(oPC,"ITEM_HONEY",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_REDAPPLE",3)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"ITEM_HONEY",4);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"ITEM_REDAPPLE",3);
sSuccess="You combine the water, honey, caramel, apples, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The apple muslin mead is ruined.";
sProduct = "item_fullkeg_028";
sByproduct1 = "item001";
iByproduct1 = 2;
sFailKeg = "item_cask_003";
}
if (iBrew==58) // Metheglin
{
iDifficulty = 200;
if (CheckComponent(oPC,"ITEM_HONEY",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_SPEARMINT",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_PEPPERMINT",2)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"ITEM_HONEY",4);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"SEED_SPEARMINT",2);
RemoveComponent(oPC,"SEED_PEPPERMINT",2);
sSuccess="You combine the water, honey, caramel, mint leaves, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The metheglin is ruined.";
sProduct = "item_fullkeg_029";
sByproduct1 = "item001";
iByproduct1 = 2;
sFailKeg = "item_cask_003";
}
if (iBrew==59) // Morat
{
iDifficulty = 200;
if (CheckComponent(oPC,"ITEM_HONEY",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_BLUEBERRY",4)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"ITEM_HONEY",4);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"SEED_BLUEBERRY",4);
sSuccess="You combine the water, honey, caramel, blueberries, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The morat is ruined.";
sProduct = "item_fullkeg_030";
sByproduct1 = "item001";
iByproduct1 = 2;
sFailKeg = "item_cask_003";
}
if (iBrew==60) // Hippocras
{
iDifficulty = 250;
if (CheckComponent(oPC,"ITEM_HONEY",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_GRAPE1",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_GINGER",2)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"ITEM_HONEY",4);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"SEED_GRAPE1",4);
RemoveComponent(oPC,"SEED_GINGER",2);
sSuccess="You combine the water, honey, caramel, grapes, ginger, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The hippocras is ruined.";
sProduct = "item_fullkeg_031";
sByproduct1 = "item001";
iByproduct1 = 2;
sFailKeg = "item_cask_003";
}
if (iBrew==61) // Pyment
{
iDifficulty = 250;
if (CheckComponent(oPC,"ITEM_HONEY",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_GRAPE3",4)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"ITEM_HONEY",4);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"SEED_GRAPE3",4);
sSuccess="You combine the water, honey, caramel, grapes, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The pyment is ruined.";
sProduct = "item_fullkeg_032";
sByproduct1 = "item001";
iByproduct1 = 2;
sFailKeg = "item_cask_003";
}
if (iBrew==62) // Braggot
{
iDifficulty = 250;
if (CheckComponent(oPC,"ITEM_HONEY",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_wort_001",2)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"ITEM_HONEY",4);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"item_wort_001",2);
sSuccess="You combine the water, honey, caramel, corn wort, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The braggot is ruined.";
sProduct = "item_fullkeg_033";
sByproduct1 = "item001";
iByproduct1 = 2;
sFailKeg = "item_cask_003";
}
if (iBrew==63) // Oxymel
{
iDifficulty = 300;
if (CheckComponent(oPC,"ITEM_HONEY",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_juice_041",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"ITEM_HONEY",4);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"item_juice_041",1);
sSuccess="You combine the water, honey, caramel, vinegar, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The oxymel is ruined.";
sProduct = "item_fullkeg_034";
sByproduct1 = "item001";
iByproduct1 = 2;
sByproduct2 = "glassbottle";
iByproduct2 = 1;
sFailKeg = "item_cask_003";
}
if (iBrew==64) // Rhodomel
{
iDifficulty = 300;
if (CheckComponent(oPC,"ITEM_HONEY",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast002",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"SEED_ORIENTALPOPPY",2)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"ITEM_HONEY",4);
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"SEED_ORIENTALPOPPY",2);
sSuccess="You combine the water, honey, caramel, poppies, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The rhodomel is ruined.";
sProduct = "item_fullkeg_035";
sByproduct1 = "item001";
iByproduct1 = 2;
sFailKeg = "item_cask_003";
}
//Whiskey
if (iBrew==65) // Corn Whiskey
{
iDifficulty = 300;
if (CheckComponent(oPC,"item_wort_010",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_004",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_010",2);
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_004",1);
sSuccess="You combine the distilled corn wort and caramel then seal the barrel.";
sFail = "The whiskey fails to age properly and is ruined.";
sProduct = "item_fullkeg_036";
sFailKeg = "item_cask_004";
}
if (iBrew==66) // Acorn Whiskey
{
iDifficulty = 400;
if (CheckComponent(oPC,"item_wort_013",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_004",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",2)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_013",2);
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_004",2);
sSuccess="You combine the distilled acorn wort and caramel then seal the barrel.";
sFail = "The whiskey fails to age properly and is ruined.";
sProduct = "item_fullkeg_037";
sFailKeg = "item_cask_004";
}
if (iBrew==67) // Sake
{
iDifficulty = 550;
if (CheckComponent(oPC,"item_wort_016",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_004",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_002",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_016",2);
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_002",1);
sSuccess="You combine the distilled rice wort and molasses then seal the barrel.";
sFail = "The sake fails to age properly and is ruined.";
sProduct = "item_fullkeg_038";
sFailKeg = "item_cask_004";
}
//Rum
if (iBrew==68) // Old Rum
{
iDifficulty = 250;
if (CheckComponent(oPC,"item_juice_031",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_002",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_juice_031",3);
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_002",2);
RemoveComponent(oPC,"item_yeast003",1);
sSuccess="You combine the sugarcane, molasses, and yeast then seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_039";
sByproduct1 = "glassbottle";
iByproduct1 = 3;
sFailKeg = "item_cask_005";
}
if (iBrew==69) // White Rum
{
iDifficulty = 300;
if (CheckComponent(oPC,"item_juice_031",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_002",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"drink_cup_010",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_juice_031",3);
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_002",2);
RemoveComponent(oPC,"item_yeast003",2);
RemoveComponent(oPC,"drink_cup_010",1);
sSuccess="You combine the sugarcane, molasses, wine, and yeast then seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_040";
sByproduct1 = "glassbottle";
iByproduct1 = 4;
sFailKeg = "item_cask_005";
}
if (iBrew==70) // Gold Rum
{
iDifficulty = 350;
if (CheckComponent(oPC,"item_juice_031",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_002",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_004",2)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_juice_031",3);
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_002",2);
RemoveComponent(oPC,"item_yeast003",2);
RemoveComponent(oPC,"item_syrup_004",2);
sSuccess="You combine the sugarcane, molasses, caramel, and yeast then seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_041";
sByproduct1 = "glassbottle";
iByproduct1 = 3;
sFailKeg = "item_cask_005";
}
if (iBrew==71) // Amber Rum
{
iDifficulty = 450;
if (CheckComponent(oPC,"item_juice_031",3)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_002",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_HONEY",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_001",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_juice_031",3);
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_002",2);
RemoveComponent(oPC,"item_yeast003",2);
RemoveComponent(oPC,"ITEM_HONEY",2);
RemoveComponent(oPC,"item_syrup_001",1);
sSuccess="You combine the sugarcane, molasses, honey, syrup, and yeast then seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_042";
sByproduct1 = "glassbottle";
iByproduct1 = 3;
sFailKeg = "item_cask_005";
}
if (iBrew==72) // Dark Rum
{
iDifficulty = 550;
if (CheckComponent(oPC,"item_syrup_003",6)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_005",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_002",4)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_yeast003",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",3)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_syrup_003",6);
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_002",4);
RemoveComponent(oPC,"item_yeast003",2);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",3);
sSuccess="You combine the sugar, molasses, water, molasses, and yeast then seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_043";
sByproduct1 = "glassbottle";
iByproduct1 = 3;
sByproduct2= "item001";
iByproduct2= 3;
sFailKeg = "item_cask_005";
}
//Other
if (iBrew==74) // Vodka
{
iDifficulty = 100;
if (CheckComponent(oPC,"item_wort_019",2)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_cask_006",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_syrup_003",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"ITEM_BUCKETOFWATER",2)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_wort_019",2);
RemoveComponent(oPC,"item_cask_006",1);
RemoveComponent(oPC,"item_syrup_003",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
sSuccess="You combine the distilled vodka base and sugar then seal the jug.";
sFail = "The vodka fails to mature properly and is ruined.";
sProduct = "item_fullkeg_045";
sByproduct1= "item001";
iByproduct1= 2;
sFailKeg = "item_cask_006";
}
if (iBrew==75) // Gin
{
iDifficulty = 100;
if (CheckComponent(oPC,"item_fullkeg_045",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_juice_017",1)==FALSE) iMissing=1;
if (CheckComponent(oPC,"item_juice_031",1)==FALSE) iMissing=1;
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_fullkeg_045",1);
RemoveComponent(oPC,"item_juice_017",1);
RemoveComponent(oPC,"item_juice_031",1);
sSuccess="You combine the vodka, juniper berry juice, and sugarcane extract then seal the jug.";
sFail = "The gin fails to mature properly and is ruined.";
sProduct = "item_fullkeg_046";
sFailKeg = "item_cask_006";
}
if (sProduct=="INVALID")
{
SendMessageToPC(oPC,"Invalid selection!");
return;
}
//nwn database
//int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
//external database
int iBrewSkill = GetPersistentInt(oPC,"iBrewSkill","UOACraft");
int iBrewChance = iBrewSkill;
if (iBrewChance<350)
{
iBrewChance = GetAbilityScore(oPC,ABILITY_DEXTERITY)*5;
iBrewChance = iBrewChance+(GetAbilityScore(oPC,ABILITY_WISDOM)*3);
iBrewChance = iBrewChance+(GetAbilityScore(oPC,ABILITY_INTELLIGENCE)*2);
iBrewChance = iBrewChance*3;
if (iBrewChance>350)iBrewChance=350;
if (iBrewSkill > iBrewChance) iBrewChance=iBrewSkill;
}
SetLocalInt(OBJECT_SELF,"iAmInUse",99);
DelayCommand(12.0,SetLocalInt(OBJECT_SELF,"iAmInUse",0));
PlaySound("as_cv_sewermisc3");
DelayCommand(2.5,PlaySound("al_na_lavapool1"));
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,12.0));
iBrewChance = iBrewChance-iDifficulty;
if (iBrewChance<1)iBrewChance=1;
iRandom = Random(1000)+Random(1000)+Random(800);//Adjusted difficulty downwards by a small percent to make lowlevel cooks succeed a bit more.
iRandom = iRandom/3;
if (iRandom<=iBrewChance)
{
if (Random(1000) >= iBrewSkill)
{
if (d10(1)+1 >= iBrewChance/100) iSkillGain = 1;
}
DelayCommand(10.0,PlaySound("as_cv_smithwatr2"));
AssignCommand(GetArea(oPC),DelayCommand(12.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE)));
AssignCommand(GetArea(oPC),DelayCommand(12.1,CreateAnObject(sProduct,oPC,1)));
if (iByproduct1>0) AssignCommand(GetArea(oPC),DelayCommand(12.2,CreateAnObject(sByproduct1,oPC,iByproduct1)));
if (iByproduct2>0) AssignCommand(GetArea(oPC),DelayCommand(12.3,CreateAnObject(sByproduct2,oPC,iByproduct2)));
if (iByproduct3>0) AssignCommand(GetArea(oPC),DelayCommand(12.4,CreateAnObject(sByproduct3,oPC,iByproduct3)));
}
else
{
AssignCommand(GetArea(oPC),DelayCommand(12.0,FloatingTextStringOnCreature(sFail,oPC,FALSE)));
AssignCommand(GetArea(oPC),DelayCommand(12.1,CreateAnObject(sFailKeg,oPC,1)));
if (iByproduct1>0) AssignCommand(GetArea(oPC),DelayCommand(12.2,CreateAnObject(sByproduct1,oPC,iByproduct1)));
if (iByproduct2>0) AssignCommand(GetArea(oPC),DelayCommand(12.3,CreateAnObject(sByproduct2,oPC,iByproduct2)));
if (iByproduct3>0) AssignCommand(GetArea(oPC),DelayCommand(12.4,CreateAnObject(sByproduct3,oPC,iByproduct3)));
DelayCommand(10.0,PlaySound("as_cv_sewermisc1"));
return;
}
//Ensure no more than 1 skill gain every 10 seconds to avoid token droppage.
if (iSkillGain ==1)
{
if (GetLocalInt(oPC,"iSkillGain")!= 0)
{
iSkillGain = 0;
}
else
{
SetLocalInt(oPC,"iSkillGain",99);
DelayCommand(10.0,SetLocalInt(oPC,"iSkillGain",0));
}
}
if (iSkillGain ==1)
{
string sOldSkill = "";
string sOldSkill2 = "";
iBrewSkill++;
sOldSkill2 = IntToString(iBrewSkill);
sOldSkill = "."+GetStringRight(sOldSkill2,1);
if (iBrewSkill > 9)
{
sOldSkill = GetStringLeft(sOldSkill2,GetStringLength(sOldSkill2)-1)+sOldSkill;
}
else
{
sOldSkill = "0"+sOldSkill;
}
if (iBrewSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iBrewSkill));
//nwn database
//DelayCommand(12.5,SetCampaignInt("UOACraft","iBrewSkill",iBrewSkill,oPC));
//external database
DelayCommand(12.5,SetPersistentInt(oPC,"iBrewSkill",iBrewSkill,0,"UOACraft"));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in brewing has gone up!"));
DelayCommand(12.5,SendMessageToPC(oPC,"Current brewing skill : "+ sOldSkill+"%"));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
if (GetLocalInt(GetModule(),"_UOACraft_XP")!=0) DelayCommand(12.4,GiveXPToCreature(oPC,GetLocalInt(GetModule(),"_UOACraft_XP")));
}
}
}
void SendMissingMessage(object oPC)
{
FloatingTextStringOnCreature("You are missing one or more items to brew this beverage!",oPC,FALSE);
return;
}
int CheckComponent(object oPC, string sTag, int iMinimum)
{
int iNum = GetNumItems(oPC,sTag);
if (iNum>=iMinimum) return TRUE;
return FALSE;
}
void RemoveComponent(object oPC, string sTag, int iMinimum)
{
object oTemp = GetItemPossessedBy(oPC,sTag);
int iStack = GetItemStackSize(oTemp);
if (iStack==1)
{
DestroyObject(oTemp);
iMinimum=iMinimum-1;
if (iMinimum>0) DelayCommand(1.0,RemoveComponent(oPC,sTag,iMinimum));
return;
}
if (iStack<iMinimum)
{
DestroyObject(oTemp);
iMinimum=iMinimum-iStack;
DelayCommand(1.0,RemoveComponent(oPC,sTag,iMinimum));
return;
}
if (iStack>iMinimum)
{
int iRemain = iStack-iMinimum;
if (iRemain>0)
{
SetItemStackSize(oTemp,iRemain);
}
else
{
DestroyObject(oTemp);
}
return;
}
DestroyObject(oTemp);
return;
}
void CreateAnObject(string sResource, object oPC, int iProduct)
{
CreateItemOnObject(sResource,oPC,1);
iProduct = iProduct - 1;
if (iProduct>0) DelayCommand(0.1,CreateAnObject(sResource,oPC,iProduct));
return;
}