Postado Maio 25, 2018 7 anos Tenta mudar doSetCreatureOutfit(cid, a[2], -1) Para doSetCreatureOutfit(cid, { looktype = a[2] }, -1)
Postado Maio 25, 2018 7 anos @Jociel Cheque se configurou a tabela corretamente , cada vocation terá um tipo de looktype [255] = {256, 50, 3000, 3000} -- {old vocation} = {New vocation, looktype, life extra, mana extra}
Postado Maio 25, 2018 7 anos Autor @Sttorm na tabela ta tudo certo eu fiz 2 vocation ficou assim local t = { [569] = {570, 1006, 3000, 3000}, -- {old vocation} = {New vocation, looktype, life extra, mana extra} [174] = {571, 50, 3000, 3000} } testei o npc com as duas vocation e ele me da a mesma looktype no caso a looktype que ele me da e uma que eu nunca vi
Postado Maio 25, 2018 7 anos @Jociel Tenta assim local t = { [255] = {256, 50, 3000, 3000} -- {old vocation} = {New vocation, looktype, life extra, mana extra} } local itemid, count = 2150 , 5 -- ID do item que precisa local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local a = t[getPlayerVocation(cid)] local outfit = {lookType = a[2]} if msgcontains(msg, "yes") then if a then if doPlayerRemoveItem(cid, itemid, count) then doPlayerSetVocation(cid, a[1]) doCreatureChangeOutfit(cid, outfit) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + a[3]) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + a[4]) selfSay("Congratulations!!", cid) else selfSay("Sua vocation não tem promotion", cid) end else selfSay("Sua vocation não tem promotion", cid) end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.