-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDEV_API_Dummy.lua
559 lines (469 loc) · 16 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
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
---@diagnostic disable: lowercase-global, missing-return
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,
}
AceGUIWidgetLSMlists = {font={}};
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
---Get the itemLink for the specified item.
---@param unit string
---@param slotId number
---@return string itemLink
function GetInventoryItemLink(unit, slotId) end
---Get Rank or whatever of spell.
---@param spellId number
---@return string subtext
function GetSpellSubtext(spellId) end
---Unit damage returns information about your current damage stats.
---@param unit string
---@return number lowDmg
---@return number hiDmg
---@return number offlowDmg
---@return number offhiDmg
---@return number posBuff
---@return number negBuff
---@return number percentmod
function UnitDamage(unit) end
---Returns the unit's ranged damage and speed.
---@param unit string
---@return number speed
---@return number lowDmg
---@return number hiDmg
---@return number posBuff
---@return number negBuff
---@return number percentmod
function UnitRangedDamage(unit) 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
---@param self WoWFrame
---@param point string
---@param relativeFrame WoWFrame
---@param relativePoint string
---@param ofsx number
---@param ofsy number
---@overload fun(self:WoWFrame, point:string, relativeFrame:WoWFrame, relativePoint:string): boolean
---@overload fun(self:WoWFrame, point:string, ofsx:number, ofsy:number): boolean
local function SetPointDummy(self, point, relativeFrame, relativePoint, ofsx, ofsy) end
---@class WoWFrame
---@field GetParent fun(self:WoWFrame):WoWFrame|nil
---@field SetWidth fun(self:WoWFrame, w:number):nil
---@field SetHeight fun(self:WoWFrame, h:number):nil
---@field GetWidth fun(self:WoWFrame):number
---@field GetHeight fun(self:WoWFrame):number
---@field SetClampedToScreen fun(self:WoWFrame, enable:boolean):nil
---@field SetMovable fun(self:WoWFrame, enable:boolean):nil
---@field EnableMouse fun(self:WoWFrame, enable:boolean):nil
---@field RegisterForDrag fun(self:WoWFrame, button:string):nil
---@field SetScript fun(self:WoWFrame, handler:string, callback:nil|fun(frame:WoWFrame, ...)):nil
---@field Show fun(self:WoWFrame):nil
---@field Hide fun(self:WoWFrame):nil
---@field SetBackdrop fun(self:WoWFrame, def:table):nil
---@field SetBackdropColor fun(self:WoWFrame, red:number, green:number, blue:number, alpha:number):nil
---@field UnregisterEvent fun(self:WoWFrame, event:string):nil
---@field RegisterEvent fun(self:WoWFrame, event:string):nil
---@field StartMoving any
---@field StopMovingOrSizing any
---@field SetClipsChildren fun(self:WoWFrame, enable:boolean):nil
---@field ScrollBar WoWFrame
---@field SetSize fun(self:WoWFrame, w:number, h:number):nil
---@field SetScrollChild fun(self:WoWFrame, child:WoWFrame):nil
---@field ClearAllPoints fun(self:WoWFrame):nil
---@field CreateFontString fun(self:WoWFrame, name:string|nil, layer:any, inherits: any):FontString
local WoWFrameDummy = {
SetPoint = SetPointDummy
}
---@class WoWGameTooltip : WoWFrame
---@field SetOwner fun(self:WoWFrame, owner:WoWFrame, anchor:string):nil
---@field AddFontStrings fun(self:WoWFrame, ...:FontString):nil
---@field ClearLines fun(self:WoWFrame):nil
---@field NumLines fun(self:WoWFrame):integer
---@field SetHyperlink fun(self:WoWFrame, hl:string):nil
---@class FontString : WoWFrame
---@field SetText fun(self:WoWFrame, t:string):nil
---@field GetText fun(self:WoWFrame):string
---@field SetJustifyH fun(self:WoWFrame, j:string):nil
---@field SetWordWrap fun(self:WoWFrame, w:boolean):nil
---@field GetStringHeight fun(self:WoWFrame):number
---@field SetTextColor fun(self:WoWFrame, r:number, g:number, b:number):nil
---@field SetFont fun(self:WoWFrame, path:string, height:number, flags:string|nil);
local FontStringDummy = {
}
---Creates a Frame object.
---@param frameType string Type of the frame; e.g. "Frame" or "Button".
---@param frameName string|nil
---@param parentFrame WoWFrame|nil
---@param inheritsFrame string|nil
---@return WoWFrame
function CreateFrame(frameType, frameName, parentFrame, inheritsFrame) 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
---Get attack power.
---@param unit string
---@return number base The unit's base attack power
---@return number posBuff The total effect of positive buffs to attack power.
---@return number negBuff The total effect of negative buffs to the attack power (a negative number)
function UnitAttackPower(unit) end
---Get ranged attack power.
---@param unit string
---@return number base The unit's base ranged attack power (seems to give a positive number even if no ranged weapon equipped)
---@return number posBuff The total effect of positive buffs to ranged attack power.
---@return number negBuff The total effect of negative buffs to the ranged attack power (a negative number)
function UnitRangedAttackPower(unit) end
---Get melee haste.
---@return number haste in percent.
function GetHaste() end
---Get ranged haste.
---@return number haste in percent.
function GetRangedHaste() end
---Get blovk value.
---@return number
function GetShieldBlock() 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() end
function UnitPowerMax(unit, powerType)
return 123;
end
--- mainhand, offhand
function UnitAttackSpeed(unit)
return 1.5, 1.2;
end
--- Returns information about an item.
---@param itemID_itemString_itemName_itemLink string|number @ItemLink, Name or ID
---@return string itemName
---@return string itemLink
---@return integer 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 integer classID
---@return integer subclassID
---@return integer bindType
---@return integer expacID
---@return integer setID
---@return boolean isCraftingReagent
function GetItemInfo(itemID_itemString_itemName_itemLink) end
function GetInventoryItemID(unit, slot)
return 123;
end
function GetInventoryItemDurability(slot)
return 123;
end
---Returns information about a specified talent in a specified tab.
---@param tree any
---@param talent any
---@return string name
---@return string icon
---@return integer tier
---@return integer column
---@return integer currentRank
---@return integer maxRank
function GetTalentInfo(tree, talent) end
---Returns the buffs/debuffs for the unit.
---@param unit string
---@param index number
---@param filter string|nil What auras to iterate (HELPFUL, HARMFUL), defaults to HELPFUL.
---@return string name The localized name of the aura, otherwise nil if there is no aura for the index.
---@return integer icon FileID - The icon texture.
---@return integer count The amount of stacks, otherwise 0.
---@return string|nil dispelType The locale-independent magic type of the aura: Curse, Disease, Magic, Poison, otherwise nil.
---@return number duration The full duration of the aura in seconds.
---@return number expirationTime Time the aura expires compared to GetTime(), e.g. to get the remaining duration: expirationtime - GetTime()
---@return string source The unit that applied the aura.
---@return boolean isStealable If the aura may be stolen.
---@return boolean nameplateShowPersonal If the aura should be shown on the player/pet/vehicle nameplate.
---@return integer spellId The spell ID for e.g. GetSpellInfo()
---@return boolean canApplyAura If the player can apply the aura.
---@return boolean isBossDebuff If the aura was cast by a boss.
---@return boolean castByPlayer If the aura was applied by a player.
---@return boolean nameplateShowAll If the aura should be shown on nameplates.
---@return number timeMod The scaling factor used for displaying time left.
function UnitAura(unit, index, filter) 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 PowerType
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
function LibStub(libName) 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|nil @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
function GetWeaponEnchantInfo()
return true, 1, 1, 1, true, 1, 1, 1;
end
---Returns information on a glyph socket.
---@param socketID number glyph [Glyph SocketID|socket index]] (1 to GetNumGlyphSockets() )
---@param talentGroup number|nil (dual) specialization index (1 to GetNumTalentGroups(...)).
---@return boolean enabled
---@return integer type
---@return integer spellId
---@return string icon
function GetGlyphSocketInfo(socketID, talentGroup) end
---@return number
function GetNumGlyphSockets() end
C_Timer = {
---@param delay number Delay in seconds.
---@param callback fun():nil
After = function(delay, callback) end
}
---@return number expertise
---@return number offhandExpertise
function GetExpertise() end
---Returns the percentage of target's armory your physical attacks ignore due to armor penetration.
---@return number armorPenPct
function GetArmorPenetration() end
---Retrieves the number of combo points gained by a player.
---@param unit "player"|"vehicle"
---@param target "target"
---@return integer
function GetComboPoints(unit, target) end
---Are 2 units the same?
---@param unit1 string
---@param unit2 string
---@return boolean
function UnitIsUnit(unit1, unit2) end
---Retrieves information about a specific SpellBook item
---@param entryName string
---@return string skillType The type of the spell (known values: "SPELL", "PETACTION", "FUTURESPELL", "FLYOUT")
---@return integer contextualID For SPELL and FUTURESPELL this is the spellID. For PetAction is it an integer value that is troublesome to use outside of two functions related solely to the PetBarUI. For Flyout, it is the FlyoutID.
function GetSpellBookItemInfo(entryName) end
---@param delim string
---@param str string
---@return string[]
function strsplittable(delim, str) end
---@type string
WOW_PROJECT_ID = ""
WOW_PROJECT_CLASSIC = "CLASSIC";
WOW_PROJECT_WRATH_CLASSIC = "WRATH";
---@param spellID integer
---@param isPetSpell boolean|nil if true, will check if the currently active pet knows the spell; if false or omitted, will check if the player knows the spell
---@return boolean
function IsSpellKnown(spellID, isPetSpell) end
---@param spellID integer
---@return integer|nil
function FindBaseSpellByID(spellID) end
---@param spellID integer
---@return integer|nil
function FindSpellOverrideByID(spellID) end
---@param spellID integer
---@return boolean
function IsPlayerSpell(spellID) end