-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathPoisons.lua
executable file
·137 lines (128 loc) · 3.26 KB
/
Poisons.lua
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
local _, RS = ...;
RS.poisons = {
-- INSTANT POISONS
["Instant Poison VI"] = {
["Dust of Deterioration"] = 4,
["Crystal Vial"] = 1
},
["Instant Poison V"] = {
["Dust of Deterioration"] = 3,
["Crystal Vial"] = 1
},
["Instant Poison IV"] = {
["Dust of Deterioration"] = 2,
["Crystal Vial"] = 1
},
["Instant Poison III"] = {
["Dust of Deterioration"] = 1,
["Leaded Vial"] = 1
},
["Instant Poison II"] = {
["Dust of Decay"] = 3,
["Leaded Vial"] = 1
},
["Instant Poison"] = {
["Dust of Decay"] = 1,
["Empty Vial"] = 1
},
-- CRIPPLING POISONS
["Crippling Poison II"] = {
["Essence of Agony"] = 3,
["Crystal Vial"] = 1
},
["Crippling Poison"] = {
["Essence of Pain"] = 1,
["Empty Vial"] = 1
},
-- DEADLY POISONS
["Deadly Poison V"] = {
["Deathweed"] = 7,
["Crystal Vial"] = 1
},
["Deadly Poison IV"] = {
["Deathweed"] = 5,
["Crystal Vial"] = 1
},
["Deadly Poison III"] = {
["Deathweed"] = 3,
["Crystal Vial"] = 1
},
["Deadly Poison II"] = {
["Deathweed"] = 2,
["Leaded Vial"] = 1
},
["Deadly Poison"] = {
["Deathweed"] = 1,
["Leaded Vial"] = 1
},
-- MIND-NUMBING POISONS
["Mind-numbing Poison III"] = {
["Dust of Deterioration"] = 2,
["Essence of Agony"] = 2,
["Crystal Vial"] = 1
},
["Mind-numbing Poison II"] = {
["Dust of Decay"] = 4,
["Essence of Pain"] = 4,
["Leaded Vial"] = 1
},
["Mind-numbing Poison"] = {
["Dust of Decay"] = 1,
["Essence of Pain"] = 1,
["Empty Vial"] = 1
},
-- WOUND POISONS
["Wound Poison IV"] = {
["Essence of Agony"] = 2,
["Deathweed"] = 2,
["Crystal Vial"] = 1
},
["Wound Poison III"] = {
["Essence of Agony"] = 1,
["Deathweed"] = 2,
["Crystal Vial"] = 1
},
["Wound Poison II"] = {
["Essence of Pain"] = 1,
["Deathweed"] = 2,
["Leaded Vial"] = 1
},
["Wound Poison"] = {
["Essence of Pain"] = 1,
["Deathweed"] = 1,
["Leaded Vial"] = 1
}
}
function RS:getPoisonReagents()
if select(2, UnitClass("PLAYER")) ~= "ROGUE" then return {} end
local T = {}
for _, item in ipairs(Restocker.profiles[Restocker.currentProfile]) do
if string.find(item.itemName, "Poison") then
local poisonName = item.itemName
local poisonRestockAmount = item.amount
local inPossesion = GetItemCount(item.itemID, true)
local inBags = GetItemCount(item.itemID, false)
local poisonsMissing = poisonRestockAmount - inPossesion
local minDifference
local inBank = inPossesion - inBags
if inBank == 0 then
minDifference = 1
else
minDifference = poisonRestockAmount/2
end
if poisonsMissing >= minDifference and poisonsMissing > 0 then
for reagent, amount in pairs(RS.poisons[poisonName]) do
local amountToGet = amount * poisonsMissing
T[reagent] = T[reagent] and T[reagent] + amountToGet or amountToGet
end
end
end
end
for reagent, val in pairs(T) do
local inBags = GetItemCount(reagent, false)
if inBags > 0 then
T[reagent] = T[reagent] - inBags
end
end
return T
end