local config = {
['citizen'] = 1,
['hunter'] = 2,
['mage'] = 3,
['knight'] = 4,
['nobleman'] = 5,
['summoner'] = 6,
['warrior'] = 7,
['barbarian'] = 8,
['druid'] = 9,
['wizard'] = 10,
['oriental'] = 11,
['pirate'] = 12,
['assassin'] = 13,
['beggar'] = 14,
['shaman'] = 15,
['norseman'] = 16,
['nightmare'] = 17,
['jester'] = 18,
['brotherhood'] = 19,
['demonhunter'] = 20,
['yalaharian'] = 21,
['warmaster'] = 22,
['wayfarer'] = 23
}
function onSay(cid, words, param)
local outfitId = config[param:lower()]
if not outfitId then
return false
end
if canPlayerWearOutfitId(cid, outfitId, 3) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have already obtained the ' .. param .. ' addons.')
return false
end
if not doPlayerRemoveItem(cid, 8982, 1) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You need an addon doll.')
return false
end
doPlayerAddOutfitId(cid, outfitId, 3)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have received the ' .. param .. ' addons!')
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
return true
end