Thread Tools Display Modes
08/08/19, 03:14 AM   #1
Hydra9268
 
Hydra9268's Avatar
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 33
How to identify whether a character is in a particular Guild like Fighters or Mages?

Here's my code.

Lua Code:
  1. -- /dump d(ZGV.Utils.SkillLines(false,true,false,true,true))
  2. function Utils.SkillLines(showType,showLineInfo,showLineXP,showSkillAbilities,showAbilityInfo)
  3.     if showType then
  4.         d("Number of Skill Types: "..GetNumSkillTypes().."\n-----------------------------")
  5.     end
  6.     if showLineInfo then
  7.         for index = 0,GetNumSkillLines(SKILL_TYPE_GUILD) do
  8.             d(index..": "..GetSkillLineInfo(SKILL_TYPE_GUILD, index))
  9.         end
  10.         d("-----------------------------")
  11.     end
  12.     if showLineXP then
  13.         for index = 0,GetSkillLineXPInfo(SKILL_TYPE_GUILD) do
  14.             d(index..": "..GetSkillLineXPInfo(SKILL_TYPE_GUILD, index))
  15.         end
  16.         d("-----------------------------")
  17.     end
  18.     if showSkillAbilities then
  19.         for index = 0,GetNumSkillAbilities(SKILL_TYPE_GUILD) do
  20.             d(index..": "..GetNumSkillAbilities(SKILL_TYPE_GUILD, index))
  21.         end
  22.         d("-----------------------------")
  23.     end
  24.     if showAbilityInfo then
  25.         local hasProgression, progressionIndex, lastRankXP, nextRankXP, currentXP, atMorph = GetAbilityProgressionXPInfoFromAbilityId(abilityId)
  26.         local skillType, skillIndex, abilityIndex = GetSkillAbilityIndicesFromProgressionIndex(progressionIndex)
  27.         local abilityId2 = GetSkillAbilityId(skillType, skillIndex, abilityIndex)
  28.         d("GetSkillAbilityId: "..abilityId2)
  29.         d("skillType: "..skillType)
  30.         d("skillIndex: "..skillIndex)
  31.         d("abilityIndex: "..abilityIndex)
  32.         d("-----------------------------")
  33.         if hasProgression then d("hasProgression: true") else d("hasProgression: false") end
  34.         d("progressionIndex: "..progressionIndex)
  35.         d("lastRankXP: "..lastRankXP)
  36.         d("nextRankXP: "..nextRankXP)
  37.         d("currentXP: "..currentXP)
  38.         if atMorph then d("atMorph: true") else d("atMorph: false") end
  39.         d("-----------------------------")
  40.     end
  41. end

And what it outputs


It's based off of this text file. As far as I know, these appear to be the only public functions that provide skill line information. However, it does so in a generalized way and not in the way I need.



Basically what I am looking for is a simple boolean against a Guild to see if it appears in the list of Skills (e.g. false returned if player isn't in the Fighters guild, or true returned if player is in the Mages guild, etc.).

Any ideas?

Last edited by Hydra9268 : 08/08/19 at 03:19 AM.
  Reply With Quote
08/08/19, 06:34 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Code:
* GetSkillLineDynamicInfo(*[SkillType|#SkillType]* _skillType_, *luaindex* _skillLineIndex_)
** _Returns:_ *luaindex* _rank_, *bool* _advised_, *bool* _active_, *bool* _discovered_
*bool* _advised_
*bool* _active_
*bool* _discovered_
One of these should say true if you have it activated or discovered. Where discovered maybe also true if you have found a book of the mages guild but ar enot member of the mages guild? Not sure, you'd need to test this.

Skilltype = SKILL_TYPE_GUILD
skillLineIndex = The guild's index you want to check

Lua Code:
  1. local function checkIfInSkillGuild(guildSkillIndex)
  2.    if guildSkillIndex <= 0 then return end
  3.    local  rank, advised, active, discovered = GetSkillLineDynamicInfo(SKILL_TYPE_GUILD, guildSkillIndex)
  4.    return active
  5. end

Last edited by Baertram : 08/08/19 at 06:37 AM.
  Reply With Quote
08/08/19, 11:43 AM   #3
Hydra9268
 
Hydra9268's Avatar
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 33
Excellent. Thanks, Baertram.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » How do I identify whether a character is in a particular Guild like Fighters or Mages

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off