lotrointerface.com
Search Downloads

LoTROInterface SVN SortPack

[/] [trunk/] [JackdawPlugins/] [SortPack/] [List.lua] - Rev 104

Go to most recent revision | Compare with Previous | Blame | View Log

--Unrem around 286

import "Turbine.Gameplay";
import"JackdawPlugins.SortPack.functions";

ItemCategory={} 

--Trying to fill the holes in Item Category
--Revise this when Turbine fix the ItemCategory enumeration.
ItemCategory[89]="BarterReputation"
ItemCategory[173]= "Special"
ItemCategory[177]= "BarterSkirmish"
ItemCategory[178]= "Barter"
ItemCategory[179]= "ShieldSpikes"

ItemCategory[180]= "OutfitFeet"
ItemCategory[181]= "OutfitShoulder"
ItemCategory[182]= "OutfitUpperbody"
ItemCategory[183]= "OutfitHead"
ItemCategory[184]= "OutfitGloves"

ItemCategory[186]= "SkillScrolls"
ItemCategory[187]= "ChampionHorns"
ItemCategory[188]="CraftOptionalIngredient"
ItemCategory[189]= "Perks"
ItemCategory[191]= "TravelAndMaps"

ItemCategory[194]="RelicScroll"

ItemCategory[195]="WestfoldMetalworkScroll"
ItemCategory[196]="WestfoldJewellerScroll"
ItemCategory[197]="WestfoldWoodworkScroll"
ItemCategory[198]="WestfoldWeaponsmithScroll"
ItemCategory[199]="WestfoldTailorScroll"
ItemCategory[201]="WestfoldForesterScroll"
ItemCategory[203]="WestfoldCookScroll"
ItemCategory[204]="WestfoldScholarScroll"


for i,v in pairs(Turbine.Gameplay.ItemCategory) do ItemCategory[v]=i end

if Groups==nil then
        Turbine.Shell.WriteLine("<rgb=#00FF00>SortPack loaded. /Sort to sort the backpack, /SortOption to change the order</rgb>")
        
        CraftScroll={
        "ApprenticeCookScroll",
        "ApprenticeFarmerScroll",
        "ApprenticeForestryScroll",
        "ApprenticeJewellerScroll",
        "ApprenticeMetalworkScroll",
        "ApprenticeProspectingScroll",
        "ApprenticeScholarScroll",
        "ApprenticeTailorScroll",
        "ApprenticeWeaponsmithScroll",
        "ApprenticeWoodworkScroll",
        "ArtisanCookScroll",
        "ArtisanFarmerScroll",
        "ArtisanForestryScroll",
        "ArtisanJewellerScroll",
        "ArtisanMetalworkScroll",
        "ArtisanProspectingScroll",
        "ArtisanScholarScroll",
        "ArtisanTailorScroll",
        "ArtisanWeaponsmithScroll",
        "ArtisanWoodworkScroll",
        "ExpertCookScroll",
        "ExpertFarmerScroll",
        "ExpertForestryScroll",
        "ExpertJewellerScroll",
        "ExpertMetalworkScroll",
        "ExpertProspectingScroll",
        "ExpertScholarScroll",
        "ExpertTailorScroll",
        "ExpertWeaponsmithScroll",
        "ExpertWoodworkScroll",
        "JourneymanCookScroll",
        "JourneymanFarmerScroll",
        "JourneymanForestryScroll",
        "JourneymanJewellerScroll",
        "JourneymanMetalworkScroll",
        "JourneymanProspectingScroll",
        "JourneymanScholarScroll",
        "JourneymanTailorScroll",
        "JourneymanWeaponsmithScroll",
        "JourneymanWoodworkScroll",
        "MasterCookScroll",
        "MasterFarmerScroll",
        "MasterForestryScroll",
        "MasterJewellerScroll",
        "MasterMetalworkScroll",
        "MasterProspectingScroll",
        "MasterScholarScroll",
        "MasterTailorScroll",
        "MasterWeaponsmithScroll",
        "MasterWoodworkScroll",
        "SupremeCookScroll",
        "SupremeFarmerScroll",
        "SupremeForestryScroll",
        "SupremeJewellerScroll",
        "SupremeMetalworkScroll",
        "SupremeProspectingScroll",
        "SupremeScholarScroll",
        "SupremeTailorScroll",
        "SupremeWeaponsmithScroll",
        "SupremeWoodworkScroll"}
        CraftScroll.Name="CraftScroll"
        
        Tool={
        "Tool"}
        Tool.Name="Tool"

        Weapons={
        "Axe",
        "Bow",
        "Club",
        "Crossbow",
        "Dagger",
        "Book",
        "Halberd",
        "Hammer",
        "Instrument",
        "Javelin",
        "Mace",
        "Minstrel",
        "Spear",
        "Shield",
        "Staff",
        "Sword",
        "Thrown",
        "Weapon"}
        Weapons.Name="Weapons"
        
        Armor={
        "Armor",
        "GuardianBelt",
        "Back",
        "Chest",
        "Clothing",
        "CosmeticBack",
        "CosmeticHeld",
        "Feet",
        "Hands",
        "Head",
        "Jewelry",
        "Legs",
        "MinstrelBook",
        "Shoulders",
        "OutfitFeet",                                                                   --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
        "OutfitUpperbody",                                                      --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
        "OutfitHead",                                                                   --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
        "OutfitShoulder",                                                               --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
        "OutfitGloves"                                                                  --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
        }
        Armor.Name="Armor"
        
        Dye={
        "Dye"}
        Dye.Name="Dye"
        
        Fishing={
        "Fish",
        "FishingBait",
        "FishingOther",
        "FishingPole"}
        Fishing.Name="Fishing"
        
        Class={
        "Runekeeper",
        "Burglar",
        "Captain",
        "Guardian",
        "Champion",
         "ChampionHorns",                                                       --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
        "Loremaster",
        "Hunter",
        "Warden"}
        Class.Name="Class"
        
        Food={
        "Food",
        "LoremasterFood"}
        Food.Name="Food"
        
        Decoration={
        "CeilingDecoration",
        "Decoration",
        "FloorDecoration",
        "FurnitureDecoration",
        "MusicDecoration",
        "SpecialDecoration",
        "Trophy",
        "TrophyDecoration",
        "YardDecoration",
        "WallDecoration",
        "SurfacePaintDecoration"}
        Decoration.Name="Decoration"
        
        Legend={
        "LegendaryWeaponExperience",
        "LegendaryWeaponIncreaseMaxLevel",
        "LegendaryWeaponReplaceLegacy",
        "LegendaryWeaponReset",
        "LegendaryWeaponUpgradeLegacy"}
        Legend.Name="Legend"
        
        Potion={
        "Potion"}
        Potion.Name="Potion"
        
        Device={
        "Device"}
        Device.Name="Device"
        
        Craft={
        "Component",
        "Crafting",
        "Ingredient",
        "CraftOptionalIngredient"                               --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
        }
        Craft.Name="Craft"
        
        BuffItem={
        "Scroll",
        "Trap",
        "ShieldSpikes",                                                         --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
        "Oil"}
        BuffItem.Name="BuffItem"
        
        Misc={

        "CraftingTrophy",
        "Deconstructable",
        "Effect",
        "Healing",
        "Implement",

        "Key",
        "KinshipCharter",

        "Mounts",
        "NonInventory",

        "Orb",
        "Pennant",
        "Quest",
        "Relic",
        "Resource",

        "SpecialTrophy",


        "Treasure",
        "Undefined",

        "BarterReputation",                                             --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
         "Special",                                                                             --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
        "BarterSkirmish",                                                       --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
         "Barter",                                                                                      --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
        "SkillScrolls",                                                                 --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
         
         "Perks",                                                                                       --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
         "TravelAndMaps",                                                       --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
         "Misc"
        }
        Misc.Name="Misc"
        
        Groups={Tool,Device,Potion,BuffItem,Food,Legend,Weapons,Armor,Class,Craft,Dye,Fishing,Decoration,CraftScroll,Misc}
        
end

function BuildList()
        --Builds the list from the groups
        
        --Reset First
        list=nil
        list={}

        --Merge from current groups
        mergetable(list,Groups)

        listtonum()
end

--Now, change the way the table works.
--This changes the text list to a numbered list. so, for example, value["Tool"] would equal 150 or whatever.
function listtonum()
        value={}
        for i,v in pairs(list) do 
                value[v]=i                                      --This converts say, list[1]="Geoff" to value[Geoff]=1 Nice huh?
        end
end

--Get the list; Pass 1
        BuildList()

--Repair function if any new item categories have been added
local changed=false
for i,v in pairs(ItemCategory) do
        if value[ItemCategory[i]]==nil then
                if Unknown==nil then Unknown={} Unknown.Name="Unknown" end
                changed=true
                table.insert(Unknown,ItemCategory[i])
                listtonum()
        end
end
if changed then Turbine.Shell.WriteLine("Adding missing Categories to the 'Unknown' group ") table.insert(Groups,Unknown) end


--Get the list; Pass 2 Rebuild the list after now adding the items in the "Unknown" category
        BuildList()
                

Go to most recent revision | Compare with Previous | Blame


All times are GMT -5. The time now is 01:21 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui