-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem_purchase_lina.lua
82 lines (74 loc) · 1.83 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
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
require( GetScriptDirectory().."/item_purchase_generic" )
local tableItemsToBuy = {
"item_tango",
"item_faerie_fire",
"item_enchanted_mango",
"item_flask",
"item_clarity",
"item_courier",
"item_boots",
"item_ring_of_protection",
"item_ring_of_regen",
"item_flying_courier",
"item_wind_lace",
"item_void_stone",
"item_staff_of_wizardry",
"item_recipe_cyclone",
"item_blink",
"item_staff_of_wizardry",
"item_ring_of_regen",
"item_recipe_force_staff",
"item_sobi_mask",
"item_robe",
"item_quarterstaff",
"item_sobi_mask",
"item_robe",
"item_quarterstaff",
"item_recipe_orchid",
"item_recipe_travel_boots",
"item_boots",
"item_ogre_axe",
"item_mithril_hammer",
"item_recipe_black_king_bar",
"item_broadsword",
"item_blades_of_attack",
"item_recipe_lesser_crit",
"item_recipe_bloodthorn",
"item_ogre_axe",
"item_boots_of_elves",
"item_boots_of_elves",
"item_recipe_hurricane_pike",
"item_recipe_travel_boots",
};
function ItemPurchaseThink()
local npcBot = GetBot();
if ( #tableItemsToBuy == 0 ) then
npcBot:SetNextItemPurchaseValue( 0 );
return;
end
local sNextItem = tableItemsToBuy[1];
npcBot:SetNextItemPurchaseValue( GetItemCost( sNextItem ) );
if ( npcBot:GetGold() >= GetItemCost( sNextItem ) ) then
if ( sNextItem == "item_boots" ) then
if ( BootsProtocol() ) then
npcBot:Action_PurchaseItem( sNextItem );
table.remove( tableItemsToBuy, 1 );
else
-- print("awaiting boots protocol");
-- print(npcBot:GetUnitName());
end
elseif ( sNextItem == "item_ogre_axe" ) then
if ( TravelsDone() ) then
npcBot:Action_PurchaseItem( sNextItem );
table.remove( tableItemsToBuy, 1 );
else
-- print("awaiting travels");
-- print(npcBot:GetUnitName());
end
else
npcBot:Action_PurchaseItem( sNextItem );
table.remove( tableItemsToBuy, 1 );
end
end
DoStuff();
end