ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Whole bunch of ItemLink and Ability functions on PTS 1.3.0 (https://www.esoui.com/forums/showthread.php?t=1943)

Garkin 07/10/14 05:43 AM

Whole bunch of ItemLink and Ability functions on PTS 1.3.0
 
ItemLinks (source: EsoUI\Ingame\Tooltip\ItemTooltips.lua):
Lua Code:
  1. local name = GetItemLinkName(itemLink)
  2. local quality = GetItemLinkQuality(itemLink)
  3. local itemType = GetItemLinkItemType(itemLink)
  4. local equipType = GetItemLinkEquipType(itemLink)
  5. local siegeType = GetItemLinkSiegeType(itemLink)
  6. local maxHP = GetItemLinkSiegeMaxHP(itemLink)
  7. local weaponType = GetItemLinkWeaponType(itemLink)
  8. local armorType = GetItemLinkArmorType(itemLink)
  9. local title = GetItemLinkBookTitle(itemLink)
  10. local craftingSkillType = GetItemLinkCraftingSkillType(itemLink)
  11. local runeClassification = GetItemLinkEnchantingRuneClassification(itemLink)
  12. local bindType = GetItemLinkBindType(itemLink)
  13. local weaponPower = GetItemLinkWeaponPower(itemLink)
  14. local armorRating = GetItemLinkArmorRating(itemLink, CONSIDER_CONDITION) --CONSIDER_CONDITION is boolean
  15. local requiredLevel = GetItemLinkRequiredLevel(itemLink)
  16. local requiredVeteranRank = GetItemLinkRequiredVeteranRank(itemLink)
  17. local value = GetItemLinkValue(itemLink, CONSIDER_CONDITION)
  18. local condition = GetItemLinkCondition(itemLink)
  19. local charges = GetItemLinkNumEnchantCharges(itemLink)
  20. local maxCharges = GetItemLinkMaxEnchantCharges(itemLink)
  21. local hasEnchant, enchantHeader, enchantDescription = GetItemLinkEnchantInfo(itemLink)
  22. local hasAbility, abilityHeader, abilityDescription, cooldown = GetItemLinkOnUseAbilityInfo(itemLink)
  23. local hasTraitAbility, traitAbilityDescription, traitCooldown = GetItemLinkTraitOnUseAbilityInfo(itemLink, i) --for i = 1, GetMaxTraits() do
  24. local traitType, traitDescription = GetItemLinkTraitInfo(itemLink)
  25. local hasSet, setName, numBonuses, numEquipped, maxEquipped = GetItemLinkSetInfo(itemLink)
  26. local numRequired, bonusDescription = GetItemLinkSetBonusInfo(itemLink, equipped, i) --for i = 1, numBonuses do
  27. local flavorText = GetItemLinkFlavorText(itemLink)
  28. local minLevel, maxLevel, minVeteranRank, maxVeteranRank = GetItemLinkGlyphMinMaxLevels(itemLink)
  29.  
  30. local unique = IsItemLinkUnique(itemLink)
  31. local uniqueEquipped = IsItemLinkUniqueEquipped(itemLink)
  32. local consumable = IsItemLinkConsumable(itemLink)
  33. local rune = IsItemLinkEnchantingRune(itemLink)
  34. local bound = IsItemLinkBound(itemLink)
  35. local crafted = IsItemLinkCrafted(itemLink)
  36. local known = IsItemLinkBookKnown(itemLink)
  37. local trash = IsItemLinkVendorTrash(itemLink)
  38.  
  39. local creator = GetItemCreatorName(bagId, slotIndex)


Abilities (source: EsoUI\Ingame\Tooltip\AbilityTooltips.lua):
Lua Code:
  1. local abilityName = GetAbilityName(abilityId)
  2. local rank = GetAbilityProgressionRankFromAbilityId(abilityId)
  3. local hasProgression, progressionIndex, lastRankXP, nextRankXP, currentXP, atMorph = GetAbilityProgressionXPInfoFromAbilityId(abilityId)
  4. local channeled, castTime, channelTime = GetAbilityCastInfo(abilityId)
  5. local targetDescription = GetAbilityTargetDescription(abilityId)
  6. local minRangeCM, maxRangeCM = GetAbilityRange(abilityId)
  7. local radiusCM = GetAbilityRadius(abilityId)
  8. local distanceCM = GetAbilityAngleDistance(abilityId)
  9. local durationMS = GetAbilityDuration(abilityId)
  10. local cost, mechanic = GetAbilityCost(abilityId)
  11. local descriptionHeader = GetAbilityDescriptionHeader(abilityId)
  12. local description = GetAbilityDescription(abilityId)
  13.  
  14. local exists = DoesAbilityExist(abilityId)

CrazyDutchGuy 07/10/14 06:09 AM

I put in a request to extract more information from itemLinks, seems they are doing it :P

farangkao 07/10/14 06:28 AM

Very Nice :)

Allows to write some Addons a little bit cleaner :)

Garkin 07/10/14 07:49 AM

A small change in itemlink format:
Code:

|H0:item:45040:3:12:26848:3:12:0:0:0:0:0:0:0:0:0:4:0:0:153:0|hp^n|h
It means that function ZO_LinkHandler_ParseLink() does not return empty string but p^ and some code.

Also zo_strformat() leaves one space before link, so the old bug is fixed. By the way if you want to have more then one space before itemlink you should use "X" in the pattern:
Lua Code:
  1. zo_strformat("Text            <<t:1>>", itemLink)
  2. --returns "Text itemLink"
  3.  
  4. zo_strformat("Text            <<X:1>>", itemLink)
  5. --returns "Text            itemLink")

merlight 07/10/14 09:32 AM

Lua Code:
  1. local requiredLevel = GetItemLinkRequiredLevel(itemLink)
  2. local requiredVeteranRank = GetItemLinkRequiredVeteranRank(itemLink)
Great, I've been trying to figure these out for so long :D Plus GetItemLinkName, finally :banana:

Harven 07/10/14 09:44 AM

Changes to the keybindstrip:
  • callback function argument changed - was descriptor table, now is boolean (true if the callback was called on key up, false otherwise),
  • handlesKeyUp - new entry in the descriptor table - if set to true, callback will be called on key down and up

Changes to FRAGMENT_GROUP table (used in ZO_Scene:AddFragmentGroup()):
  • changed UI_WINDOW to MOUSE_DRIVEN_UI_WINDOW,
    - keybindstrip frament is now MOUSE_DRIVEN_UI_WINDOW.KEYBIND_STRIP_FADE_FRAGMENT,
  • changed UI_WINDOW_NO_COMBAT_OVERLAY to MOUSE_DRIVEN_UI_WINDOW_NO_COMBAT_OVERLAY,
    - keybindstrip frament is now MOUSE_DRIVEN_UI_WINDOW_NO_COMBAT_OVERLAY.KEYBIND_STRIP_FADE_FRAGMENT,
  • added GAMEPAD_DRIVEN_UI_WINDOW

Khaibit 07/10/14 02:55 PM

Hallelujah! Comparison of item names when all you have is links will be possible again, quite pleased :)

Sasky 07/10/14 03:04 PM

Ability functions get more than just player skills. One amusing one I ran across:

GM AOE Death Touch
Hits all targets for 100,000 Direct Damage, in a 1000 meter radius from the caster.

Separate ranks of an ability have separate ability IDs. The IDs range from 3 to about 58,000, with about 27k values returning something.

Halja 07/10/14 04:35 PM

Quote:

Originally Posted by Sasky (Post 10413)
Ability functions get more than just player skills. One amusing one I ran across:

GM AOE Death Touch
Hits all targets for 100,000 Direct Damage, in a 1000 meter radius from the caster.

Separate ranks of an ability have separate ability IDs. The IDs range from 3 to about 58,000, with about 27k values returning something.

lol I remember back in DAoC early days the GM Ashay on Pendragon test server was give a custom golden hockey stick animation when GM AOE Death Touch was used. It was funny to see the stick come out and spin when testing encounters bugged out.

Flagrick 07/11/14 09:18 AM

Quote:

Originally Posted by Khaibit (Post 10411)
Hallelujah! Comparison of item names when all you have is links will be possible again, quite pleased :)

Lua Code:
  1. local name = GetItemLinkName(itemLink)

I hope it works with items from EVENT_LOOT_RECEIVED

katkat42 07/12/14 08:14 PM

Quote:

Originally Posted by Flagrick (Post 10442)
Lua Code:
  1. local name = GetItemLinkName(itemLink)

I hope it works with items from EVENT_LOOT_RECEIVED

I hope the functions work with the GetCraftingResultLink links.

Xrystal 07/12/14 09:00 PM

Quote:

Originally Posted by Flagrick (Post 10442)
Lua Code:
  1. local name = GetItemLinkName(itemLink)

I hope it works with items from EVENT_LOOT_RECEIVED

Me too .. once addons are activated I'll be testing that in my addon amongst others.


All times are GMT -6. The time now is 09:00 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI