Well the documentation that I read on GetPlayerClass() was actually wrong, I tried this and it worked like a charm.
Code:
if(player:GetPlayerClass() == "Shaman") then
unit:GossipMenuAddItem(1, "Totems please!", 12, 0)
end
and to answer your question the "1" is the icon next to the option on the menu and "12" is a value thats being passed to a variable so that the script knows which option was clicked and therefore knows what operations to perform and so this is what 12 is.
Code:
if(intid == 12) then
player:RemoveItem(5177,1)
player:RemoveItem(5178,1)
player:RemoveItem(5175,1)
player:RemoveItem(5176,1)
player:AddItem(5177,1)
player:AddItem(5178,1)
player:AddItem(5175,1)
player:AddItem(5176,1)
player:GossipComplete()
end
Basically removes the four totems and then gives them back. This is so a player does not get more of the totem, Cause as you may or may not be aware, Totems cant be deleted or destroyed from your inventory. At least not when I tried which was why I did it like that.