[DiscordArchive] thoughts on if this would work?
[DiscordArchive] thoughts on if this would work?
Archived author: Harrina • Posted: 2023-01-28T21:51:54.302000+00:00
Original source
thoughts on if this would work?
Archived author: Harrina • Posted: 2023-01-28T21:51:54.582000+00:00
Original source
-- Create the NPC
CREATE NPC 'Gear Master' (entry = 12345);
-- Create the GOSSIP menu for the NPC
local function GearMaster_Gossip(event, player, creature)
player:GossipMenuAddItem(0, "Select armor for my class and spec", 0, 1)
player:GossipSendMenu(1, creature)
end
-- Handle the GOSSIP selection
local function GearMaster_GossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
local class = player:GetClass()
local spec = player:GetSpecialization()
local level = player:GetLevel()
if (level == 80) then
if (class == 1) then -- Warrior
if (spec == 71) then -- Arms
player:AddItem(12345, 1) -- Example item for Arms Warrior
elseif (spec == 72) then -- Fury
player:AddItem(67890, 1) -- Example item for Fury Warrior
elseif (spec == 73) then -- Protection
player:AddItem(24680, 1) -- Example item for Protection Warrior
end
elseif (class == 2) then -- Paladin
if (spec == 65) then -- Holy
player:AddItem(13579, 1) -- Example item for Holy Paladin
elseif (spec == 66) then -- Protection
player:AddItem(97531, 1) -- Example item for Protection Paladin
elseif (spec == 70) then -- Retribution
player:AddItem(85214, 1) -- Example item for Retribution Paladin
end
-- Add more elseif statements for other classes here
end
else
player:SendBroadcastMessage("You must be level 80 to access this gear.")
end
player:GossipComplete()
end
end
-- Register the events for the NPC
RegisterCreatureGossipEvent(12345, 1, GearMaster_Gossip)
RegisterCreatureGossipEvent(12345, 2, GearMaster_GossipSelect)