-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDEV_API_Dummy.lua
519 lines (436 loc) · 11 KB
/
DEV_API_Dummy.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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
SlashCmdList = {}
UIParent = CreateFrame();
WorldFrame = CreateFrame();
local function SetScript(self, eventName, func) end
GameTooltip = {
SetOwner = function(self, frame, anchor) end,
SetText = function(self, text, a, r, g, b, wrap) end,
AddLine = function(self, text, red, green, blue) end,
AddDoubleLine = function(self, textL, textR, rL, gL, bL, rR, gR, bR) end,
SetScript = SetScript,
}
bit = {
band = function(arg1, arg2) return 0 end,
}
LE_ITEM_CLASS_WEAPON = 2;
--- mhBase, mhMod, ohBase, ohMod
function UnitAttackBothHands(unit)
return 1, 1, 1, 1;
end
-- base, mod
function UnitRangedAttack(unit)
return 1, 1;
end
-- mhMin, mhMax, ohMin, ohMax
function UnitDamage(unit)
return 1, 2, 1, 2;
end
--- as percent
function GetCritChance()
return 2.5;
end
--- as percent
function GetRangedCritChance()
return 2.5;
end
--- classLoc, class
function UnitClass(unit)
return "Localized", "ENGLISH";
end
function GetAddOnMetadata(addonName, metaKey)
return "value";
end
--- UNIX timestamp
function time()
return 123;
end
-- ms since start
function debugprofilestop()
return 123;
end
--- Splits a string using a delimiter (optionally: into a specified number of pieces)
---@param delimiter string
---@param subject string
---@param pieces number|nil
function strsplit(delimiter, subject, pieces)
return "","","","","","","","","","";
end
function CreateFrame(frameType, frameName, parentFrame, inheritsFrame)
return {}
end
--- name, rank, icon, castTime, minRange, maxRange
function GetSpellInfo(spellId_spellName_spellLink)
return "name", "rank", "icon", 1, 1, 1;
end
function UIDropDownMenu_SetWidth(dropDown, width) end
function UIDropDownMenu_Initialize(dropDown, initFunc) end
function UIDropDownMenu_CreateInfo()
return {
arg1 = "",
arg2 = "",
checked = false,
func = function() end,
text = "",
}
end
function UIDropDownMenu_SetText(self, text) end
--- See UIDropDownMenu_CreateInfo
function UIDropDownMenu_AddButton(buttonInfo) end
function hooksecurefunc(table, key, func) end
--- actionType, actionId
function GetActionInfo(slot)
return "type", 123
end
function GetMacroSpell(actionId)
return 123;
end
function UnitName(unit)
return "name";
end
function UnitLevel(unit)
return 1;
end
function UnitIsPlayer(unit)
return true;
end
function GetSpellBonusDamage(schoolNum)
return 123;
end
function GetSpellBonusHealing()
return 123;
end
--- as percent
function GetSpellCritChance(schoolNum)
return 123;
end
---Gets the player's current mana regeneration rates (in mana per 1 seconds).
---@return number base @Full regen while outside the fsr
---@return number casting @Regen from mp5 and uninterrupted spirit/int regen
function GetManaRegen()
return;
end
function UnitPowerMax(unit, powerType)
return 123;
end
--- mainHand, offHand
function UnitAttackSpeed(unit)
return 1.5, 1.2;
end
--- speed, lowDmg, hiDmg, posBuff, negBuff, percent
function UnitRangedDamage(unit)
return 1.5, 0, 0, 0, 0, 0;
end
--- Returns information about an item.
---@param itemID_itemString_itemName_itemLink string|number @ItemLink, Name or ID
---@return string itemName
---@return string itemLink
---@return number itemQuality
---@return number itemLevel
---@return number itemMinLevel
---@return string itemType
---@return string itemSubType
---@return number itemStackCount
---@return string itemEquipLoc
---@return number itemTexture
---@return number sellPrice
---@return number classID
---@return number subclassID
---@return number bindType
---@return number expacID
---@return number setID
---@return boolean isCraftingReagent
function GetItemInfo(itemID_itemString_itemName_itemLink)
return;
end
function GetInventoryItemID(unit, slot)
return 123;
end
function GetInventoryItemDurability(slot)
return 123;
end
--- name, _, _, _, curRank, maxRank
function GetTalentInfo(tree, talent)
return "name", "_", "_", "_", 1, 2;
end
--- name, _, count, _, _, _, _, _, _, spellId
function UnitBuff(unit, i)
return "name", "_", 1, "_", "_", "_", "_", "_", "_", 123;
end
--- Wipe table
function wipe(table) end
function GetLocale()
return "enUS";
end
--- localized, english
function UnitRace(unit)
return "localized", "English";
end
---Returns info about one of the unit's stats (strength, agility, stamina, intellect, spirit).
---@param unit string
---@param statID number
---@return number base @The unit's base stat.
---@return number stat @The unit's current stat.
---@return number posBuff @Any positive buffs applied to the stat.
---@return number negBuff @Any negative buffs applied to the stat.
function UnitStat(unit, statID) end
---@class SpellPowerEntry
local SpellPowerEntry = {
hasRequiredAura = true,
type = 1,
name = "name",
cost = 1,
minCost = 0,
requiredAuraID = 0,
costPercent = 0,
costPerSec = 0
}
---@return table<number,SpellPowerEntry>
function GetSpellPowerCost(spellName_spellID)
end
function GetShapeshiftForm()
return 0;
end
function GetRealmName()
return "";
end
---@param libName string
---@return table|nil
function LibStub(libName)
return {};
end
Bartender4 = {}
Bartender4DB = {
namespaces = {},
profileKeys = {},
}
DominosDB = {
profileKeys = {},
profiles = {},
}
ElvUISpellBookTooltip = {};
ElvDB = {
profileKeys = {},
profiles = {},
}
--- initpos is optional. Returns the matched substring(s) found within string. Multiple return values can occur.
function strmatch(string, pattern, initpos)
return "", "", "", "";
end
--- icon, active, castable, spellId
function GetShapeshiftFormInfo(index)
return "", true, true, 1;
end
function GetHitModifier()
return 1;
end
function GetSpellHitModifier()
return 1;
end
CR_WEAPON_SKILL = 1;
CR_DEFENSE_SKILL = 2;
CR_DODGE = 3;
CR_PARRY = 4;
CR_BLOCK = 5;
CR_HIT_MELEE = 6;
CR_HIT_RANGED = 7;
CR_HIT_SPELL = 8;
CR_CRIT_MELEE = 9;
CR_CRIT_RANGED = 10;
CR_CRIT_SPELL = 11;
CR_MULTISTRIKE = 12;
CR_READINESS = 13;
CR_SPEED = 14;
COMBAT_RATING_RESILIENCE_CRIT_TAKEN = 15;
COMBAT_RATING_RESILIENCE_PLAYER_DAMAGE_TAKEN = 16;
CR_LIFESTEAL = 17;
CR_HASTE_MELEE = 18;
CR_HASTE_RANGED = 19;
CR_HASTE_SPELL = 20;
CR_AVOIDANCE = 21;
CR_WEAPON_SKILL_OFFHAND = 22;
CR_WEAPON_SKILL_RANGED = 23;
CR_EXPERTISE = 24;
CR_ARMOR_PENETRATION = 25;
CR_MASTERY = 26;
CR_PVP_POWER = 27;
CR_VERSATILITY_DAMAGE_DONE = 29;
CR_VERSATILITY_DAMAGE_TAKEN = 31;
---Returns the bonus, in percent (or other converted units, such as skill points), of a specific combat rating for the player.
---@param combatRatingId number
---@return number bonusPct
function GetCombatRatingBonus(combatRatingId)
end
--- Returns the current power of the specified unit.
---@param unitId string
---@param powerType number @Type of resource (mana/rage/energy/etc) to query
---@param unmodified boolean @Return the higher precision internal value (for graphical use only)
---@return number
function UnitPower(unitId, powerType, unmodified)
return 1;
end
--- Returns the GUID of the specified unit.
---@param unitId string
---@return string
function UnitGUID(unitId)
return "Creature-0-1133-870-141-71953-0000432FBD";
end
--- Returns the creature type of the specified unit.
---@param unitId string
---@return string
function UnitCreatureType(unitId)
return "Beast";
end
function InterfaceOptionsFrame_OpenToCategory(panelName) end
function InterfaceOptions_AddCategory(frame) end
InterfaceOptionsFrameAddOns = {};
function OptionsListButtonToggle_OnClick() end
function ChatConfigFrame_PlayCheckboxSound() end
function EditBox_ClearFocus() end
function GameTooltip_Hide() end
---@class SpellBaseInfo
local SpellBaseInfo = {
---@type number
school = math.random(),
---@type boolean|nil
isChannel = nil,
---@type boolean|nil
isBinary = nil,
---@type number|nil
GCD = nil,
---@type number
defType = math.random(),
---@type boolean|nil
cantDogeParryBlock = nil,
---@type number|nil
equippedWeaponMask = nil,
---@type boolean|nil
noCrit = nil,
---@type boolean|nil
forceHeal = nil,
}
---@class SpellRankEffectData
local SpellRankEffectData = {
effectType = math.random(),
---@type number|nil
auraType = nil,
---@type boolean|nil
forceScaleWithHeal = nil,
valueBase = math.random(),
---@type number|nil
valueRange = nil,
---@type number|nil
valuePerLevel = nil,
coef = math.random(),
---@type number|nil
weaponCoef = nil,
---@type number|nil
tickPeriod = nil,
---@type number|nil
charges = nil,
---@type number|nil
chains = nil,
---@type number|nil
chainMult = nil,
---@type number|nil
auraStacks = nil,
}
---@class SpellRankInfo
local SpellRankInfo = {
spellLevel = math.random(),
maxLevel = math.random(),
---@type number|nil
duration = math.random(),
---@type number|nil
baseCost = nil,
---@type table<number, SpellRankEffectData|nil>
effects = {}
}
---@type SettingsTable
SpellCalc_settings = SpellCalc_settings;
function GetWeaponEnchantInfo()
return true, 1, 1, 1, true, 1, 1, 1;
end
SpellCalcStatScreen = {}
---@type AddonEnv
local _addon = select(2, ...);
---@return table<string,table>
_addon.ClassSettings = function()
return {};
end
---@type table<string, SpellBaseInfo>
_addon.spellBaseInfo = {};
---@type table<integer, SpellRankInfo>
_addon.spellRankInfo = {};
_addon.spellClassSet = {
---@type table<number, number[]>
[1] = {},
---@type table<number, number[]>
[2] = {},
---@type table<number, number[]>
[3] = {},
---@type table<number, number[]>
[4] = {},
};
---@class AuraEffectBase
local AuraEffectBase = {
type = 0,
---@type number|nil
affectMask = 0,
---@type number[]|nil
affectSpell = {0,0,0,0},
---@type number|nil
neededWeaponMask = nil
}
---@class UnitAuraEffect : AuraEffectBase
local UnitAuraEffect = {
---@type number
value = 0,
}
---@class SetBonusAuraEffect : UnitAuraEffect
local SetBonusAuraEffect = {
---@type number
need = 0
}
---@class ItemSetData
local ItemSetData = {
---@type string
name = "Bloodsoul Embrace",
---@type SetBonusAuraEffect[]
effects = {}
}
---@type table<number, ItemSetData>
_addon.itemSetData = {}
---@type table<number, UnitAuraEffect[]>
_addon.itemEffects = {};
-- TODO: fix this stupid structure
---@class PlayerAuraEffect : UnitAuraEffect
local PlayerAura = {
---@type nil|UnitAuraEffect[]
effects = {},
---@type nil|number
condition = 0
}
---@type table<number, PlayerAuraEffect>
_addon.aurasPlayer = {};
---@class EnchantData : UnitAuraEffect
local EnchantData = {
---@type string
name = "",
}
---@type table<number, EnchantData>
_addon.enchantData = {};
---@class TalentEffect : AuraEffectBase
local TalentEffect = {
---@type integer|nil
base = nil,
perPoint = math.random(),
}
---@class TalentDataEntry
local TalentDataEntry = {
tree = math.random(),
talent = math.random(),
---@type TalentEffect[]
effects = {}
}
---@type TalentDataEntry[]
_addon.talentData = {}