Go to Page... |
Compatibility: | Harrowstorm (5.3.5) Dragonhold (5.2.5) Scalebreaker (5.1.5) Elsweyr (5.0.5) |
Updated: | 02/23/20 07:09 PM |
Created: | 05/24/14 11:45 AM |
Monthly downloads: | 4,697 |
Total downloads: | 498,726 |
Favorites: | 363 |
MD5: |
LibResearch
## DependsOn: LibResearch>=042
## OptionalDependsOn: LibResearch>=042
LIBRESEARCH_REASON_ALREADY_KNOWN = "AlreadyKnown" LIBRESEARCH_REASON_WRONG_ITEMTYPE = "WrongItemType" LIBRESEARCH_REASON_ORNATE = "Ornate" LIBRESEARCH_REASON_INTRICATE = "Intricate" LIBRESEARCH_REASON_TRAITLESS = "Traitless"
-- returns true if the character knows or is in the process of researching the supplied trait; else returns false -- there are a few items, given to the character at the very beginning of the game, that are traited but unresearchable; -- these will present bugs when used with this function, but these items are very rare -- this function REPLACES the old function IsCraftingTraitKnownOrResearching() function libResearch:WillCharacterKnowTrait(craftingSkillType, researchLineIndex, traitIndex) -- returns three values: int traitKey, bool isResearchable, string reason -- traitKey will be 0 if item is ornate, intricate, or traitless; else it will be the result of GetTraitKey() -- if isResearchable, then reason will be nil -- otherwise, reason will be: "WrongItemType", "Ornate", "Intricate", "Traitless", "AlreadyKnown" -- this function REPLACES DetailedIsItemResearchable() and IsItemResearchable() function libResearch:GetItemTraitResearchabilityInfo(itemLink) -- Returns an integer representation of the parameters -- craftingSkillType * 10000 + researchLineIndex * 100 + traitIndex function libResearch:GetTraitKey( craftingSkillType, researchLineIndex, traitIndex ) -- returns the global enums CRAFTING_TYPE_BLACKSMITHING, CRAFTING_TYPE_CLOTHIER, CRAFTING_TYPE_WOODWORKING or CRAFTING_TYPE_JEWELRYCRAFTING -- if applicable; else returns -1 function libResearch:GetItemCraftingSkill( itemLink ) -- returns a trait index suitable for feeding to the global functions GetSmithingLineTraitInfo() et. al., -- or returns the string "Ornate" if the item is ornate, -- or returns the string "Intricate" if the item is intricate, -- or returns -1 if no trait exists function libResearch:GetResearchTraitIndex( itemLink ) -- returns an index that corresponds to the weapon or armor type within the given crafting skill -- or returns -1 if not applicable function libResearch:GetResearchLineIndex( itemLink ) -- returns three values: craftingSkill, researchLineIndex, traitIndex for the given item link function libResearch:GetItemResearchInfo( itemLink ) -- returns true if the craftingSkillType is one of the researchable crafts, false otherwise --> As we got 4 crafting skills now the name is wrong, but all are supported! function libResearch:IsBigThreeCrafting( craftingSkillType ) -- Returns true if the integer you pass in represents Blacksmithing, Clothier, or Woodworking; false otherwise function libResearch:IsBigThreeCrafting( craftingSkillType ) -- returns the below table "researchMap" function libResearch:GetResearchMap()
local researchMap = { [BLACKSMITH] = { WEAPON = { [WEAPONTYPE_AXE] = 1, [WEAPONTYPE_HAMMER] = 2, [WEAPONTYPE_SWORD] = 3, [WEAPONTYPE_TWO_HANDED_AXE] = 4, [WEAPONTYPE_TWO_HANDED_HAMMER] = 5, [WEAPONTYPE_TWO_HANDED_SWORD] = 6, [WEAPONTYPE_DAGGER] = 7, }, ARMOR = { [EQUIP_TYPE_CHEST] = 8, [EQUIP_TYPE_FEET] = 9, [EQUIP_TYPE_HAND] = 10, [EQUIP_TYPE_HEAD] = 11, [EQUIP_TYPE_LEGS] = 12, [EQUIP_TYPE_SHOULDERS] = 13, [EQUIP_TYPE_WAIST] = 14, }, }, --normal for light, +7 for medium [CLOTHIER] = { ARMOR = { [EQUIP_TYPE_CHEST] = 1, [EQUIP_TYPE_FEET] = 2, [EQUIP_TYPE_HAND] = 3, [EQUIP_TYPE_HEAD] = 4, [EQUIP_TYPE_LEGS] = 5, [EQUIP_TYPE_SHOULDERS] = 6, [EQUIP_TYPE_WAIST] = 7, }, }, [WOODWORK] = { WEAPON = { [WEAPONTYPE_BOW] = 1, [WEAPONTYPE_FIRE_STAFF] = 2, [WEAPONTYPE_FROST_STAFF] = 3, [WEAPONTYPE_LIGHTNING_STAFF] = 4, [WEAPONTYPE_HEALING_STAFF] = 5, }, ARMOR = { [EQUIP_TYPE_OFF_HAND] = 6, }, }, [JEWELRY_CRAFTING] = { ARMOR = { [EQUIP_TYPE_NECK] = 1, [EQUIP_TYPE_RING] = 2, }, } }
-- returns the below table "traitType2TraitIndex" function libResearch:GetTraitTypeToTraitIndex()
local ItemTraitType2TraitIndex = { --Weapons [ITEM_TRAIT_TYPE_WEAPON_POWERED] = 1, -- 1 [ITEM_TRAIT_TYPE_WEAPON_CHARGED] = 2, -- 2 [ITEM_TRAIT_TYPE_WEAPON_PRECISE] = 3, -- 3 [ITEM_TRAIT_TYPE_WEAPON_INFUSED] = 4, -- 4 [ITEM_TRAIT_TYPE_WEAPON_DEFENDING] = 5, -- 5 [ITEM_TRAIT_TYPE_WEAPON_TRAINING] = 6, -- 6 [ITEM_TRAIT_TYPE_WEAPON_SHARPENED] = 7, -- 7 [ITEM_TRAIT_TYPE_WEAPON_WEIGHTED] = 8, -- 8 --> Old, removed from game and exchanged by ITEM_TRAIT_TYPE_WEAPON_DECISIVE [ITEM_TRAIT_TYPE_WEAPON_DECISIVE] = 8, -- 8 [ITEM_TRAIT_TYPE_WEAPON_NIRNHONED] = 9, -- 26 [ITEM_TRAIT_TYPE_WEAPON_INTRICATE] = LIBRESEARCH_REASON_INTRICATE, -- 9 [ITEM_TRAIT_TYPE_WEAPON_ORNATE] = LIBRESEARCH_REASON_ORNATE, -- 10 --Armor [ITEM_TRAIT_TYPE_ARMOR_STURDY] = 1, -- 11 [ITEM_TRAIT_TYPE_ARMOR_IMPENETRABLE] = 2, -- 12 [ITEM_TRAIT_TYPE_ARMOR_REINFORCED] = 3, -- 13 [ITEM_TRAIT_TYPE_ARMOR_WELL_FITTED] = 4, -- 14 [ITEM_TRAIT_TYPE_ARMOR_TRAINING] = 5, -- 15 [ITEM_TRAIT_TYPE_ARMOR_INFUSED] = 6, -- 16 [ITEM_TRAIT_TYPE_ARMOR_EXPLORATION] = 7, -- 17 --> Old, removed from game and exchanged by ITEM_TRAIT_TYPE_ARMOR_PROSPEROUS [ITEM_TRAIT_TYPE_ARMOR_PROSPEROUS] = 7, -- 17 [ITEM_TRAIT_TYPE_ARMOR_DIVINES] = 8, -- 18 [ITEM_TRAIT_TYPE_ARMOR_NIRNHONED] = 9, -- 25 [ITEM_TRAIT_TYPE_ARMOR_INTRICATE] = LIBRESEARCH_REASON_INTRICATE, -- 20 [ITEM_TRAIT_TYPE_ARMOR_ORNATE] = LIBRESEARCH_REASON_ORNATE, -- 19 --Jewelry [ITEM_TRAIT_TYPE_JEWELRY_ARCANE] = 1, -- 22 [ITEM_TRAIT_TYPE_JEWELRY_HEALTHY] = 2, -- 21 [ITEM_TRAIT_TYPE_JEWELRY_ROBUST] = 3, -- 23 [ITEM_TRAIT_TYPE_JEWELRY_TRIUNE] = 4, -- 30 [ITEM_TRAIT_TYPE_JEWELRY_INFUSED] = 5, -- 33 [ITEM_TRAIT_TYPE_JEWELRY_PROTECTIVE] = 6, -- 32 [ITEM_TRAIT_TYPE_JEWELRY_SWIFT] = 7, -- 28 [ITEM_TRAIT_TYPE_JEWELRY_HARMONY] = 8, -- 29 [ITEM_TRAIT_TYPE_JEWELRY_BLOODTHIRSTY] = 9, -- 31 [ITEM_TRAIT_TYPE_JEWELRY_INTRICATE] = LIBRESEARCH_REASON_INTRICATE, -- 27 [ITEM_TRAIT_TYPE_JEWELRY_ORNATE] = LIBRESEARCH_REASON_ORNATE, -- 24 }
File Name |
Version |
Size |
Uploader |
Date |
4.0r1 |
3kB |
Baertram |
06/18/19 03:52 PM |
|
2.0r2 |
4kB |
katkat42 |
09/16/14 01:49 PM |
|
2.0 |
4kB |
katkat42 |
09/13/14 10:27 PM |
|
1.0r4 |
3kB |
katkat42 |
08/03/14 03:35 PM |
|
1.0r3 |
3kB |
katkat42 |
08/02/14 12:41 PM |
|
1.0r3 |
3kB |
katkat42 |
08/02/14 11:15 AM |
|
1.0r2 |
3kB |
ingeniousclown |
05/25/14 08:12 PM |
|
1.0r1 |
3kB |
05/24/14 11:45 AM |
Comment Options |
02/09/20, 01:56 PM | |
|
LibResearch will strip LibStub soon!
Be sure to use the globale variable LibResearch now and not LibStub("LibResearch") anymore! Current version 42 can be found here: https://github.com/Baertram/LibResearch
Last edited by Baertram : 02/09/20 at 01:59 PM.
|
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
08/04/14, 11:16 AM | |
hi there,
i get lua errors, with LibResearch mentioned in it. they dont stop, even if i turn tis lib off as an addon, anoying because i get tons of po ups. never ending. |
|
|
Morwo |
View Public Profile |
Send a private message to Morwo |
Find More Posts by Morwo |
Add Morwo to Your Buddy List |
katkat42 |
View Public Profile |
Send a private message to katkat42 |
Find More Posts by katkat42 |
Add katkat42 to Your Buddy List |
08/03/14, 03:35 PM | |
I think you forgot to raise the minor number for registering libResearch in libStub:
In libResearch.lua Currently: Lua Code:
Should be: Lua Code:
That causes your fix (r4) to not be used when r3 has already been registered in libStub
Last edited by Sephiroth018 : 08/03/14 at 03:36 PM.
|
|
|
Sephiroth018 |
View Public Profile |
Send a private message to Sephiroth018 |
Find More Posts by Sephiroth018 |
Add Sephiroth018 to Your Buddy List |
05/25/14, 02:33 AM | |
|
Thanks for making your work available in a library.
Last edited by b|m : 05/25/14 at 02:33 AM.
|
|
b|m |
View Public Profile |
Send a private message to b|m |
Find More Posts by b|m |
Add b|m to Your Buddy List |