@@ -126,8 +126,10 @@ local globalCacheList =
126
126
" GetPartyAssignment" ,
127
127
" GetPlayerInfoByGUID" ,
128
128
" GetPositionFromPosition" ,
129
+ " GetRaidTargetIndex" ,
129
130
" GetReadyCheckStatus" ,
130
131
" GetUnitName" ,
132
+ " GetUnitSpeed" ,
131
133
" InitiateTrade" ,
132
134
" IsItemInRange" ,
133
135
" IsSpellInRange" ,
@@ -196,6 +198,7 @@ local globalCacheList =
196
198
" UnitIsPVPFreeForAll" ,
197
199
" UnitIsPVPSanctuary" ,
198
200
" UnitIsSameServer" ,
201
+ " UnitIsTapDenied" ,
199
202
" UnitIsTrivial" ,
200
203
" UnitIsUnit" ,
201
204
" UnitIsVisible" ,
@@ -206,6 +209,8 @@ local globalCacheList =
206
209
" UnitPlayerControlled" ,
207
210
" UnitPlayerOrPetInParty" ,
208
211
" UnitPlayerOrPetInRaid" ,
212
+ " UnitPower" ,
213
+ " UnitPowerMax" ,
209
214
" UnitPowerType" ,
210
215
" UnitPVPName" ,
211
216
" UnitRace" ,
@@ -271,24 +276,29 @@ for i = 1, #globalCacheList do
271
276
local func = globalCacheList [i ]
272
277
globalFuncCopies [func ] = _G [func ]
273
278
end
279
+
274
280
-- print("NN File Called")
275
281
function br .unlock :NNUnlock ()
276
282
if not C_Timer .Nn then return false end
277
283
setfenv (1 , C_Timer .Nn )
278
284
-- print("NN Api Loaded")
285
+
279
286
---- ----------------------------
280
287
-- API unlocking
281
288
---- ----------------------------
289
+ ---
282
290
for k , v in pairs (funcCopies ) do
283
291
b [k ] = function (...) return Unlock (k , ... ) end
284
292
end
293
+
285
294
for _ , v in pairs (globalCacheList ) do
286
295
if C_Timer .Nn [v ] == nil then
287
296
print (" Function: " .. tostring (v ) .. " , was not provided." )
288
297
else
289
298
b [v ] = C_Timer .Nn [v ]
290
299
end
291
300
end
301
+
292
302
for k , v in pairs (globalFuncCopies ) do
293
303
if not b [k ] then
294
304
b [k ] = function (...) return v (... ) end
@@ -343,31 +353,31 @@ function br.unlock:NNUnlock()
343
353
return ObjectID (unit )
344
354
end
345
355
346
- -- b.UnitTarget = function(unit)
347
- -- return UnitTarget(unit)
348
- -- end
349
356
b .UnitCreator = function (unit )
350
357
return UnitCreator (unit )
351
358
end
359
+
352
360
b .UnitBoundingRadius = function (unit )
353
361
return ObjectBoundingRadius (unit )
354
362
end
363
+
355
364
b .UnitCombatReach = function (unit )
356
365
return CombatReach (unit )
357
366
end
358
367
359
-
360
368
---- ----------------------------
361
369
-- API conversions
362
370
---- ----------------------------
363
371
b .GetWoWDirectory = function ()
364
372
return " \\ scripts"
365
373
end
374
+
366
375
local om = {}
367
376
b .GetObjectCount = function ()
368
377
om = Objects ()
369
378
return # Objects ()
370
379
end
380
+
371
381
b .GetObjectWithIndex = function (index )
372
382
return om [index ]
373
383
end
@@ -382,6 +392,7 @@ function br.unlock:NNUnlock()
382
392
local castGUID = b .UnitTarget (select (1 , ... ))
383
393
return spellId1 , spellId2 , castGUID , castGUID
384
394
end
395
+
385
396
b .GetDirectoryFiles = function (...)
386
397
local str = ...
387
398
if str == nil or str == " *" then return " " end
@@ -412,9 +423,11 @@ function br.unlock:NNUnlock()
412
423
SetPlayerFacing (arg )
413
424
end
414
425
end
426
+
415
427
b .GetObjectWithGUID = function (...)
416
428
return ...
417
429
end
430
+
418
431
b .IsHackEnabled = function (...) return false end
419
432
420
433
---- ----------------------------
@@ -430,10 +443,12 @@ function br.unlock:NNUnlock()
430
443
return 0 , 0
431
444
end
432
445
end
446
+
433
447
b .GetPositionBetweenPositions = function (X1 , Y1 , Z1 , X2 , Y2 , Z2 , DistanceFromPosition1 )
434
448
local AngleXY , AngleXYZ = b .GetAnglesBetweenPositions (X1 , Y1 , Z1 , X2 , Y2 , Z2 )
435
449
return b .GetPositionFromPosition (X1 , Y1 , Z1 , DistanceFromPosition1 , AngleXY , AngleXYZ )
436
450
end
451
+
437
452
b .GetPositionBetweenObjects = function (unit1 , unit2 , DistanceFromPosition1 )
438
453
local X1 , Y1 , Z1 = b .ObjectPosition (unit1 )
439
454
local X2 , Y2 , Z2 = b .ObjectPosition (unit2 )
@@ -450,12 +465,8 @@ function br.unlock:NNUnlock()
450
465
degrees = degrees and b .rad (degrees ) / 2 or math.pi / 2
451
466
return ShortestAngle < degrees
452
467
end
468
+
453
469
---- --------------------- Miscellaneous -------------------
454
- -- b.AuraUtil = {}
455
- -- b.AuraUtil.FindAuraByName = function(name, unit, filter)
456
- -- -- return Eval("AuraUtil.FindAuraByName("..table.concat({...}, ", ")..")", "")
457
- -- return AuraUtil.FindAuraByName(name, ObjectUnit(unit), filter)
458
- -- end
459
470
b .ObjectIsGameObject = function (...)
460
471
local ObjType = ObjectType (... )
461
472
return ObjType == 8 or ObjType == 11
@@ -468,157 +479,33 @@ function br.unlock:NNUnlock()
468
479
return
469
480
end
470
481
end
482
+
471
483
b .InteractUnit = function (unit )
472
484
return ObjectInteract (Object (unit ))
473
485
end
486
+
474
487
---- --------------------------------------
475
488
--- API - Unit Function Object Handler ---
476
489
---- --------------------------------------
477
- -- b.CastSpellByName = function(spell, unit)
478
- -- return Unlock("CastSpellByName(\""..spell.."\", \""..ObjectUnit(unit).."\")", "")
479
- -- end
480
- b .GetRaidTargetIndex = function (...)
481
- return GetRaidTargetIndex (ObjectUnit (... ))
482
- end
483
- b .GetUnitSpeed = function (...)
484
- return GetUnitSpeed (ObjectUnit (... ))
485
- end
486
- b .InSpellInRange = function (spell , unit )
487
- return C_Spell .IsSpellInRange (spell , ObjectUnit (unit ))
488
- end
489
- b .UnitAffectingCombat = function (...)
490
- return UnitAffectingCombat (ObjectUnit (... ))
491
- end
492
- b .UnitAttackSpeed = function (...)
493
- return UnitAttackSpeed (ObjectUnit (... ))
494
- end
495
490
b .UnitAura = function (unit , index , filter )
496
491
return C_UnitAuras .GetAuraDataByIndex (ObjectUnit (unit ), index , filter )
497
492
end
493
+
498
494
b .UnitBuff = function (unit , index , filter )
499
495
return C_UnitAuras .GetBuffDataByIndex (ObjectUnit (unit ), index , filter )
500
496
end
501
- b .UnitCanAttack = function (unit1 , unit2 )
502
- return UnitCanAttack (ObjectUnit (unit1 ), ObjectUnit (unit2 ))
503
- end
504
- b .UnitCastingInfo = function (...)
505
- return UnitCastingInfo (ObjectUnit (... ))
506
- end
507
- b .UnitChannelInfo = function (...)
508
- return UnitChannelInfo (ObjectUnit (... ))
509
- end
510
- b .UnitClass = function (...)
511
- return UnitClass (ObjectUnit (... ))
512
- end
513
- b .UnitClassification = function (...)
514
- return UnitClassification (ObjectUnit (... ))
515
- end
516
- b .UnitCreatureFamily = function (...)
517
- return UnitCreatureFamily (ObjectUnit (... ))
518
- end
519
- b .UnitCreatureType = function (...)
520
- return UnitCreatureType (ObjectUnit (... ))
521
- end
497
+
522
498
b .UnitDebuff = function (unit , index , filter )
523
499
return C_UnitAuras .GetDebuffDataByIndex (ObjectUnit (unit ), index , filter )
524
500
end
525
- b .UnitExists = function (...)
526
- return UnitExists (ObjectUnit (... ))
527
- end
528
- b .UnitGetIncomingHeals = function (unit1 , unit2 )
529
- return UnitGetIncomingHeals (ObjectUnit (unit1 ), ObjectUnit (unit2 ))
530
- end
531
- b .UnitGUID = function (...)
532
- return UnitGUID (ObjectUnit (... ))
533
- end
534
- b .UnitHealth = function (...)
535
- return UnitHealth (ObjectUnit (... ))
536
- end
537
- b .UnitHealthMax = function (...)
538
- return UnitHealthMax (ObjectUnit (... ))
539
- end
540
- b .UnitLevel = function (...)
541
- return UnitLevel (ObjectUnit (... ))
542
- end
543
- b .UnitName = function (...)
544
- return UnitName (ObjectUnit (... ))
545
- end
546
- b .UnitInParty = function (...)
547
- return UnitInParty (ObjectUnit (... ))
548
- end
549
- b .UnitInRaid = function (...)
550
- return UnitInRaid (ObjectUnit (... ))
551
- end
552
- b .UnitInRange = function (...)
553
- return UnitInRange (ObjectUnit (... ))
554
- end
555
- b .UnitIsCharmed = function (...)
556
- return UnitIsCharmed (ObjectUnit (... ))
557
- end
558
- b .UnitIsConnected = function (...)
559
- return UnitIsConnected (ObjectUnit (... ))
560
- end
561
- b .UnitIsDeadOrGhost = function (...)
562
- return UnitIsDeadOrGhost (ObjectUnit (... ))
563
- end
564
- b .UnitIsEnemy = function (unit1 , unit2 )
565
- return UnitIsEnemy (ObjectUnit (unit1 ), ObjectUnit (unit2 ))
566
- end
567
- b .UnitIsFriend = function (unit1 , unit2 )
568
- return UnitIsFriend (ObjectUnit (unit1 ), ObjectUnit (unit2 ))
569
- end
570
- b .UnitIsPlayer = function (...)
571
- return UnitIsPlayer (ObjectUnit (... ))
572
- end
573
- b .UnitIsUnit = function (unit1 , unit2 )
574
- return UnitIsUnit (ObjectUnit (unit1 ), ObjectUnit (unit2 ))
575
- end
576
- b .UnitIsVisible = function (...)
577
- return UnitIsVisible (ObjectUnit (... ))
578
- end
579
- b .UnitOnTaxi = function (...)
580
- return UnitOnTaxi (ObjectUnit (... ))
581
- end
582
- b .UnitPhaseReason = function (...)
583
- return UnitPhaseReason (ObjectUnit (... ))
584
- end
585
- b .UnitPower = function (unit , powerType )
586
- return UnitPower (ObjectUnit (unit ), powerType )
587
- end
588
- b .UnitPowerMax = function (unit , powerType )
589
- return UnitPowerMax (ObjectUnit (unit ), powerType )
590
- end
591
- b .UnitRace = function (...)
592
- return UnitRace (ObjectUnit (... ))
593
- end
594
- b .UnitReaction = function (unit1 , unit2 )
595
- return UnitReaction (ObjectUnit (unit1 ), ObjectUnit (unit2 ))
596
- end
597
- b .UnitStat = function (unit , statIndex )
598
- return UnitStat (ObjectUnit (unit ), statIndex )
599
- end
600
- b .UnitIsTapDenied = function (...)
601
- return UnitIsTapDenied (ObjectUnit (... ))
602
- end
603
- b .UnitThreatSituation = function (unit1 , unit2 )
604
- return UnitThreatSituation (ObjectUnit (unit1 ), ObjectUnit (unit2 ))
605
- end
606
- b .UnitIsTrivial = function (...)
607
- return UnitIsTrivial (ObjectUnit (... ))
608
- end
609
501
610
502
---- ----------------------------
611
503
-- extra APIs
612
504
---- ----------------------------
613
- -- b.AuraUtil = {}
614
- -- b.AuraUtil.FindAuraByName = _G.AuraUtil["FindAuraByName"]
615
- -- b.ObjectIsGameObject = function(...)
616
- -- local ObjType = ObjectType(...)
617
- -- return ObjType == 8 or ObjType == 11
618
- -- end
619
505
b .GetMapId = function ()
620
506
return select (8 , b .GetInstanceInfo ())
621
507
end
508
+
622
509
---- ----------------------------
623
510
-- missing APIs
624
511
---- ----------------------------
0 commit comments