Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local npcid = 190000
- local T = {
- ["Menu"] = {
- {"Headpiece", 0},
- {"Shoulders", 2},
- {"Chest", 4},
- {"Legs", 6},
- {"Boots", 7},
- {"Bracers", 8},
- {"Gloves", 9},
- {"Cloak", 14},
- -- {"Main-Hand Weapons", 15},
- -- {"Two-Handed Weapons", 151},
- -- {"Off-Hand Weapons", 16},
- -- {"Shields", 161};
- },
- [0] = { -- Headpiece
- {"Arcanum of Burning Mysteries", 3820},
- {"Arcanum of Blissful Mending", 3819},
- {"Arcanum of the Stalward Protector", 3818},
- {"Arcanum of Torment", 3817},
- {"Arcanum of the Savage Gladiator", 3842},
- {"Arcanum of Triumph", 3795},
- {"Arcanum of Dominance", 3797};
- },
- [2] = { -- Shoulders
- {"Inscription of Triumph", 3793},
- {"Inscription of Dominance", 3794},
- {"Greater Inscription of the Gladiator", 3852},
- {"Greater Inscription of the Axe", 3808},
- {"Greater Inscription of the Crag", 3809},
- {"Greater Inscription of the Pinnacle", 3811},
- {"Greater Inscription of the Storm", 3810};
- },
- [4] = { -- Chest
- {"Enchant Chest - Powerful Stats", 3832},
- {"Enchant Chest - Super Health", 3297},
- {"Enchant Chest - Greater Mana Restoration", 2381},
- {"Enchant Chest - Exceptional Resilience", 3245},
- {"Enchant Chest - Greater Defense", 1953};
- },
- [6] = { -- Legs
- {"Earthen Leg Armor", 3853},
- {"Frosthide Leg Armor", 3822},
- {"Icescale Leg Armor", 3823},
- {"Brilliant Spellthread", 3719},
- {"Sapphire Spellthread", 3721};
- },
- [7] = { -- Boots
- {"Enchant Boots - Greater Assault", 1597},
- {"Enchant Boots - Tuskars Vitality", 3232},
- {"Enchant Boots - Superior Agility", 983},
- {"Enchant Boots - Greater Spirit", 1147},
- {"Enchant Boots - Greater Vitality", 3244},
- {"Enchant Boots - Icewalker", 3826},
- {"Enchant Boots - Greater Fortitude", 1075};
- },
- [8] = { -- Bracers
- {"Enchant Bracers - Major Stamina", 3850},
- {"Enchant Bracers - Superior Spellpower", 2332},
- {"Enchant Bracers - Greater Assault", 3845},
- {"Enchant Bracers - Major Spirit", 1147},
- {"Enchant Bracers - Expertise", 3231},
- {"Enchant Bracers - Greater Stats", 2661},
- {"Enchant Bracers - Exceptional Intellect", 1119};
- },
- [9] = { -- Gloves
- {"Enchant Gloves - Greater Blasting", 3249},
- {"Enchant Gloves - Armsman", 3253},
- {"Enchant Gloves - Crusher", 1603},
- {"Enchant Gloves - Agility", 3222},
- {"Enchant Gloves - Precision", 3234},
- {"Enchant Gloves - Expertise", 3231},
- {"Enchant Gloves - Exceptional Spellpower", 3246};
- },
- [14] = { -- Cloak
- {"Enchant Cloak - Shadow Armor", 3256},
- {"Enchant Cloak - Wisdom", 3296},
- {"Enchant Cloak - Titan Weave", 1951},
- {"Enchant Cloak - Greater Speed", 3831},
- {"Enchant Cloak - Mighty Armor", 3294},
- {"Enchant Cloak - Major Agility", 1099},
- {"Enchant Cloak - Spell Piercing", 1262};
- },
- --[[
- [15] = {
- -- Main Hand
- {"Enchant Weapon - Titan Guard", 3851, 0},
- {"Enchant Weapon - Accuracy", 3788, 0},
- {"Enchant Weapon - Berserking", 3789, 0},
- {"Enchant Weapon - Black Magic", 3790, 0},
- {"Enchant Weapon - Mighty Spellpower", 3834, 0},
- {"Enchant Weapon - Superior Potency", 3833, 0},
- {"Enchant Weapon - Ice Breaker", 3239, 0},
- {"Enchant Weapon - Lifeward", 3241, 0},
- {"Enchant Weapon - Blood Draining", 3870, 0},
- {"Enchant Weapon - Blade Ward", 3869, 0},
- {"Enchant Weapon - Exceptional Agility", 1103, 0},
- {"Enchant Weapon - Exceptional Spirit", 3844, 0},
- {"Enchant Weapon - Executioner", 3225, 0},
- {"Enchant Weapon - Mongoose", 2673, 0},
- -- Twohanded
- },
- [16] = {
- -- Offhand
- {"Enchant Weapon - Titan Guard", 3851, 0},
- {"Enchant Weapon - Accuracy", 3788, 0},
- {"Enchant Weapon - Berserking", 3789, 0},
- {"Enchant Weapon - Black Magic", 3790, 0},
- {"Enchant Weapon - Mighty Spellpower", 3834, 0},
- {"Enchant Weapon - Superior Potency", 3833, 0},
- {"Enchant Weapon - Ice Breaker", 3239, 0},
- {"Enchant Weapon - Lifeward", 3241, 0},
- {"Enchant Weapon - Blood Draining", 3870, 0},
- {"Enchant Weapon - Blade Ward", 3869, 0},
- {"Enchant Weapon - Exceptional Agility", 1103, 0},
- {"Enchant Weapon - Exceptional Spirit", 3844, 0},
- {"Enchant Weapon - Executioner", 3225, 0},
- {"Enchant Weapon - Mongoose", 2673, 0},
- -- Shields
- },
- ]]
- };
- local pVar = {};
- function Enchanter(unit, _, plr)
- pVar[plr:GetName()] = nil;
- -- pVar[plr:GetName()] = {}; -- Wuts this
- unit:GossipCreateMenu(301, plr, 0)
- for _, v in ipairs(T["Menu"]) do
- unit:GossipMenuAddItem(3, "|cFF008000Enchant "..v[1]..".|R", v[2], 0)
- end
- unit:GossipSendMenu(plr)
- end
- function EnchanterSelect(unit, _, plr, id, intid, code)
- if (intid < 500) then
- pVar[plr:GetName()] = intid;
- unit:GossipCreateMenu(301, plr, 0)
- if(T[intid]) then
- for i, v in ipairs(T[intid]) do
- unit:GossipMenuAddItem(3, "|cFF008000"..v[1]..".|R", v[2], 0)
- end
- end
- unit:GossipMenuAddItem(3, "[Back]", 500, 0)
- unit:GossipSendMenu(plr)
- elseif (intid == 500) then
- Enchanter(unit, _, plr)
- elseif (intid >= 900) then
- for _, v in pairs(T[pVar[plr:GetName()]]) do
- if v[2] == intid then
- local item = plr:GetEquippedItemBySlot(pVar[plr:GetName()])
- if item ~= nil then
- item:AddEnchantment(intid, 0, 0)
- else
- plr:SendAreaTriggerMessage("You have no item to enchant in the selected slot!")
- end
- end
- end
- -- plr:GossipComplete()
- EnchanterSelect(unit, nil, plr, id, pVar[plr:GetName()], nil)-- Cause its cool to swap enchants after enchanting ;P
- -- pVar[plr:GetName()] = nil;
- end
- end
- RegisterUnitGossipEvent(npcid, 1, Enchanter)
- RegisterUnitGossipEvent(npcid, 2, EnchanterSelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement