-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem_purchase_lina.lua
54 lines (42 loc) · 1.22 KB
/
item_purchase_lina.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
--"item_flask" == heal flask
local tableItemsToBuy = {
"item_mantle",
"item_circlet",
"item_recipe_null_talisman",
"item_blight_stone",
"item_boots",
"item_staff_of_wizardry",
"item_wind_lace",
"item_void_stone",
"item_recipe_cyclone",
"item_robe",
"item_gloves",
"item_gloves",
"item_branches",
"item_ring_of_regen",
"item_recipe_headdress",
"item_recipe_helm_of_the_dominator",
"item_gloves",
"item_mithril_hammer",
"item_recipe_maelstrom",
"item_mithril_hammer",
"item_mithril_hammer"
};
----------------------------------------------------------------------------------------------------
function ItemPurchaseThink()
local npcBot = GetBot();
-- no hay items para comprar
if ( #tableItemsToBuy == 0 )
then
npcBot:SetNextItemPurchaseValue( 0 );
return;
end
local siguiente_item = tableItemsToBuy[1];
npcBot:SetNextItemPurchaseValue( GetItemCost( siguiente_item ) );
if ( npcBot:GetGold() >= GetItemCost( siguiente_item ) )
then
npcBot:Action_PurchaseItem( siguiente_item );
table.remove( tableItemsToBuy, 1 );
end
end
----------------------------------------------------------------------------------------------------