local outfits = {
{136, 128, "Citizen"},
{137, 129, "Hunter"},
{138, 130, "Mage"},
{139, 131, "Knight"}
}
local randOutfit = CreatureEvent("RandomOutfitForNewPlayers")
function randOutfit.onLogin(player)
if player:getLastLoginSaved() <= 0 then
local outfit = outfits[math.random(1, #outfits)]
local addon = math.random(1, 2)
player:addOutfitAddon(outfit[1], addon)
player:addOutfitAddon(outfit[2], addon)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You obtained the %s outfit with addon %d.", outfit[3], addon))
end
return true
end
randOutfit:register()