-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.lua
360 lines (240 loc) · 9.39 KB
/
template.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
-- Luashitacast Original Generic Template v0.1 by @Mogul
-- License: Share it, change it, use it as you like, just don't change the first line
-- or claim you made it.
-- Originally created for the CatsEyeXI server but it will work on other private servers as well
-- as retail but for current retail it will need a lot of work.
-- Comments are left throughout the file to let you know what things do and what to do when editing it.
-- IMPORTANT: READ THE COMMENTS IN THE FILE! It will be helpeful to you. Comments have a double hyphen (--)
-- before then like these lines.
-- This file will change over time so if you have suggestions or comments or issues reach out to me on Discord.
local profile = {}; -- Don't touch this line
-- Name your profile sets when making them the same as the sets names below
local sets = {
['tp_lowacc'] = {
},
['tp_medacc'] = {
},
['tp_highacc'] = {
},
['ws_lowacc'] = {
},
['ws_medacc'] = {
},
['ws_highacc'] = {
},
['di_lowacc'] = {
},
['di_medacc'] = {
},
['di_highacc'] = {
},
['idle'] = {
},
['idle_town'] = {
},
['rest'] = {
},
['precast'] = {
},
['midcast'] = {
},
['preshot'] = {
},
['midshot'] = {
},
};
-- A list (or 'table' in Lua terms) of towns/cities
local towns = T{'Aht Urhgan Whitegate', 'Al Zahbi', 'Bastok Markets [S]', 'Bastok Markets', 'Bastok Mines', 'Bastok-Jeuno Airship', 'Celennia Memorial Library', 'Chateau d\'Oraguille', 'Eastern Adoulin', 'Heavens Tower', 'Kazham', 'Kazham-Jeuno Airship', 'Lower Jeuno', 'Metalworks', 'Mhaura', 'Mog Garden', 'Nashmau', 'Norg', 'Northern San d\'Oria', 'Port Bastok', 'Port Jeuno', 'Port San d\'Oria', 'Port Windurst', 'Rabao', 'Ru\'Lude Gardens', 'San d\'Oria-Jeuno Airship', 'Selbina', 'Southern San d\'Oria [S]', 'Southern San d\'Oria', 'Tavnazian Safehold', 'Upper Jeuno', 'Western Adoulin', 'Windurst Walls', 'Windurst Waters [S]', 'Windurst Waters', 'Windurst Woods', 'Windurst-Jeuno Airship',};
-- Some simple settings to keep track of things
local settings = {
tpvariant = 1,
diset = false,
};
-- Use these names when creating tp sets
-- like tp_lowacc when you add a set via the /lac addset command
-- ex. /lac addset tp_lowacc
-- This will allow you to switch between different tp gear sets
local tpvarianttable = {
[1] = 'lowacc',
[2] = 'medacc',
[3] = 'highacc',
--[4] = 'add_another_set_here'
};
profile.Sets = sets;
profile.Packer = {
};
profile.OnLoad = function()
gSettings.AllowAddSet = true;
local player = gData.GetPlayer();
-- Below code will change your macro book to the specified macro book when you load this job
-- Change the macro book # to your main jobs macro set
-- Change the macro set # to the palatte for the sub job
if (player.SubJob == 'WAR') then
AshitaCore:GetChatManager():QueueCommand(1, '/macro book 1');
AshitaCore:GetChatManager():QueueCommand(1, '/macro set 1');
elseif (player.SubJob == 'DNC') then
AshitaCore:GetChatManager():QueueCommand(1, '/macro book 1');
AshitaCore:GetChatManager():QueueCommand(1, '/macro set 1');
elseif (player.SubJob == 'RDM') then
AshitaCore:GetChatManager():QueueCommand(1, '/macro book 1');
AshitaCore:GetChatManager():QueueCommand(1, '/macro set 1');
elseif (player.SubJob == 'NIN') then
AshitaCore:GetChatManager():QueueCommand(1, '/macro book 1');
AshitaCore:GetChatManager():QueueCommand(1, '/macro set 1');
else
AshitaCore:GetChatManager():QueueCommand(1, '/macro book 1');
AshitaCore:GetChatManager():QueueCommand(1, '/macro set 1');
end
-- This will look at your current main job and make a /command for it
-- so you can type '/war tpset' if you were a WAR main job.
-- Also Alt+F1 allows you to change tp sets on the fly and
-- Alt+F2 allows for toggling diset on/off.
AshitaCore:GetChatManager():QueueCommand(-1, '/alias /' .. string.lower(player.MainJob) .. ' /lac fwd');
AshitaCore:GetChatManager():QueueCommand(-1, '/bind !F1 /lac fwd tpset');
AshitaCore:GetChatManager():QueueCommand(-1, '/bind !F2 /lac fwd diset');
end
profile.OnUnload = function()
local player = gData.GetPlayer();
-- This is just clean up so your binds and aliases don't get crossed
AshitaCore:GetChatManager():QueueCommand(-1, '/alias delete /' .. string.lower(player.MainJob));
AshitaCore:GetChatManager():QueueCommand(-1, '/unbind !F1');
AshitaCore:GetChatManager():QueueCommand(-1, '/unbind !F2');
end
profile.HandleCommand = function(args)
if (args[1] == 'tpset') then
settings.tpvariant = settings.tpvariant + 1;
if (settings.tpvariant > #tpvarianttable) then
settings.tpvariant = 1;
end
gFunc.Message('TP Set: ' .. string.upper(tpvarianttable[settings.tpvariant]));
elseif (args[1] == 'diset') then
-- This is a toggle and does if true then false or if false then true.
if (settings.diset == true) then
settings.diset = false;
else
settings.diset = true;
end
gFunc.Message('DI Set is now set to' .. string.upper(tostring(settings.diset)));
end
end
profile.HandleDefault = function()
local player = gData.GetPlayer(); -- This gets the players info and holds it all in 'player'
local place = gData.GetEnvironment();
if (player.Status == 'Engaged') then
gFunc.EquipSet('tp_' .. tpvarianttable[settings.tpvariant]);
if (settings.diset == true) then -- If you turned on DI mode
-- Make sets like tp_sets but use 'di_'
gFunc.EquipSet('di_' .. tpvarianttable[settings.tpvariant]);
end
elseif (player.Status == 'Resting') then
gFunc.EquipSet(sets.rest);
else -- If idle, dead, zoning, or unknown
if (towns:contains(place.Area)) then
gFunc.EquipSet(sets.idle_town);
else
gFunc.EquipSet(sets.idle);
end
end
end
profile.HandleAbility = function()
local player = gData.GetPlayer();
local ability = gData.GetAction();
if (ability.Name == 'Provoke') then
gFunc.EquipSet(sets.putsetnamehere);
--gFunc.Equip('Slot_Name', 'Item_Name'); -- Use something like this for a single piece of gear
elseif (ability.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (ability.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (ability.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (ability.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (ability.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (ability.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
else
-- This is a catch all/default set
gFunc.EquipSet(sets.putsetnamehere);
end
end
profile.HandleItem = function()
end
profile.HandlePrecast = function()
local player = gData.GetPlayer();
local spell = gData.GetAction();
-- A precast set
gFunc.EquipSet(sets.precast);
if string.match(spell.Name, 'Cure') then -- This works on ALL Cure spells
-- Add a Cure set below it will be used on all 'Cure' spells
gFunc.EquipSet(sets.putsetnamehere);
elseif string.match(spell.Name, 'Utsusemi') then -- Will work with all Utsusemi tiers
gFunc.EquipSet(sets.putsetnamehere);
elseif (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
else
-- This is a catch all/default set
gFunc.EquipSet(sets.putsetnamehere);
end
end
profile.HandleMidcast = function()
local player = gData.GetPlayer();
local spell = gData.GetAction();
if (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
elseif (spell.Name == '') then
gFunc.EquipSet(sets.putsetnamehere);
else
-- This is a catch all/default set
gFunc.EquipSet(sets.putsetnamehere);
end
end
profile.HandlePreshot = function()
--gFunc.EquipSet(sets.preshot);
end
profile.HandleMidshot = function()
--gFunc.EquipSet(sets.midshot);
end
profile.HandleWeaponskill = function()
local player = gData.GetPlayer(); -- Info about the player if needed
local wskill = gData.GetAction(); -- Determines the action you're taking
-- Removing the double hyphen to 'uncomment' the gFunc lines
if (wskill.Name == '') then
--gFunc.EquipSet(sets.putsetnamehere);
elseif (wskill.Name == '') then
--gFunc.EquipSet(sets.putsetnamehere);
elseif (wskill.Name == '') then
--gFunc.EquipSet(sets.putsetnamehere);
elseif (wskill.Name == '') then
--gFunc.EquipSet(sets.putsetnamehere);
elseif (wskill.Name == '') then
--gFunc.EquipSet(sets.putsetnamehere);
elseif (wskill.Name == '') then
--gFunc.EquipSet(sets.putsetnamehere);
elseif (wskill.Name == '') then
--gFunc.EquipSet(sets.putsetnamehere);
else
-- This is a catch all/default set
--gFunc.EquipSet(sets.putsetnamehere);
end
end
return profile;