forked from yutsuku/BuyPoisons
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRestock.lua
More file actions
46 lines (40 loc) · 2.21 KB
/
Restock.lua
File metadata and controls
46 lines (40 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function BuyPoisons_RestockPoisons()
BuyPoisonsRestock={};
BuyPoisonsRestock[BUYPOISONS_COMPONENT_FLASH_POWDER] = 0;
BuyPoisonsRestock[BUYPOISONS_COMPONENT_DEATHWEED] = 0;
BuyPoisonsRestock[BUYPOISONS_COMPONENT_DUST_OF_DECAY] = 0;
BuyPoisonsRestock[BUYPOISONS_COMPONENT_DUST_OF_DETERIORATION] = 0;
BuyPoisonsRestock[BUYPOISONS_COMPONENT_ESSENCE_OF_AGONY] = 0;
BuyPoisonsRestock[BUYPOISONS_COMPONENT_ESSENCE_OF_PAIN] = 0;
BuyPoisonsRestock[BUYPOISONS_COMPONENT_LETHARGY_ROOT] = 0;
BuyPoisonsRestock[BUYPOISONS_VIAL_EMPTY] = 0;
BuyPoisonsRestock[BUYPOISONS_VIAL_CRYSTAL] = 0;
BuyPoisonsRestock[BUYPOISONS_VIAL_LEADED] = 0;
BuyPoisonsRestock[BUYPOISONS_COMPONENT_MAIDENS_ANGUISH] = 0;
BuyPoisonsComponents = {};
BuyPoisonsComponents[1]=BUYPOISONS_VIAL_EMPTY;
BuyPoisonsComponents[2]=BUYPOISONS_VIAL_CRYSTAL;
BuyPoisonsComponents[3]=BUYPOISONS_VIAL_LEADED;
BuyPoisonsComponents[4]=BUYPOISONS_COMPONENT_FLASH_POWDER;
BuyPoisonsComponents[5]=BUYPOISONS_COMPONENT_DEATHWEED;
BuyPoisonsComponents[6]=BUYPOISONS_COMPONENT_DUST_OF_DECAY;
BuyPoisonsComponents[7]=BUYPOISONS_COMPONENT_DUST_OF_DETERIORATION;
BuyPoisonsComponents[8]=BUYPOISONS_COMPONENT_ESSENCE_OF_AGONY;
BuyPoisonsComponents[9]=BUYPOISONS_COMPONENT_ESSENCE_OF_PAIN;
BuyPoisonsComponents[10]=BUYPOISONS_COMPONENT_LETHARGY_ROOT;
BuyPoisonsComponents[11]=BUYPOISONS_COMPONENT_MAIDENS_ANGUISH;
for i = 1, 22 do
local VialType = BuyPoisonsItemInfo[i]["Vial_Type"];
local RestockQuantity = BuyPoisonsData[Server][User][i];
if (RestockQuantity > 0) then
BuyPoisonsRestock[(BuyPoisonsItemInfo[i]["Components"][1]["Item"])]=BuyPoisonsRestock[(BuyPoisonsItemInfo[i]["Components"][1]["Item"])] + (BuyPoisonsItemInfo[i]["Components"][1]["Quantity"] * RestockQuantity);
if (BuyPoisonsItemInfo[i]["Components"][2]["Item"]) then
BuyPoisonsRestock[(BuyPoisonsItemInfo[i]["Components"][2]["Item"])]=BuyPoisonsRestock[(BuyPoisonsItemInfo[i]["Components"][2]["Item"])] + (BuyPoisonsItemInfo[i]["Components"][2]["Quantity"] * RestockQuantity);
end
BuyPoisonsRestock[VialType] = BuyPoisonsRestock[VialType] + RestockQuantity;
end
end
for i = 1, 11 do
BuyPoisons_RestockItem( BuyPoisonsComponents[i] , BuyPoisonsRestock[(BuyPoisonsComponents[i])]);
end
end