View Single Post
05/08/24, 05:04 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,009
Thanks, have something similar in LibVampire I think, but have not updated it for a long while now

Hint
You can easeand speed-up such ifs
Code:
if (abilityId == VAMPIRE_STAGE_1) or (abilityId == VAMPIRE_STAGE_2) or (abilityId == VAMPIRE_STAGE_3) or (abilityId == VAMPIRE_STAGE_4) then
by the help of a simple table with key = abilityId and value = boolean true:

Lua Code:
  1. local vampireStages = {
  2.  [VAMPIRE_STAGE_1] = true,
  3.  [VAMPIRE_STAGE_2] = true,
  4.  [VAMPIRE_STAGE_3] = true,
  5.  [VAMPIRE_STAGE_4] = true,
  6. }
  7. if vampireStages[abilityId] then
  Reply With Quote