Postado Agosto 31, 2014 10 anos Este é um post popular. Nome: Outfit por vocação Função: A pedidos de um membro do forum (@Jose Peterson). Aqui está um script que caso vocês sigam passo a passo irá funcionar como o nome já diz. Exemplo: Se for (Mago, Sorcerer) usará a outfit de Mage. Versão: Testada somente na "10.31". (OTX Server - Galaxy) Créditos: Kazuza - (eu) Por ter criado. @Jose Peterson - Pela Ideia. "Pasta Servidor > Data > XML > ABRA o "Outfits.xml". <outfit id="1"> <list gender="0" lookType="136" name="Citizen"/> <list gender="1" lookType="128" name="Citizen"/> </outfit> Vai ser assim certo? Preciso que você deixe desta forma TODOS os outifit: <outfit id="1" storageId="1415" storageValue="1"> <list gender="0" lookType="136" name="Citizen"/> <list gender="1" lookType="128" name="Citizen"/> </outfit> <outfit id="2" storageId="1416" storageValue="1"> <list gender="0" lookType="137" name="Hunter"/> <list gender="1" lookType="129" name="Hunter"/> </outfit> Notou a diferença? reparou que tem (storageId="1415" storageValue="1") e no outro (storageId="1416" storageValue="1"). Continue, acrescentando isto a todos outfits e aumentando o número da storageID, quando acabar vá para o próximo passo. "Pasta Servidor > Data > Creaturescripts > ABRA o "creaturescripts.xml". <event type="login" name="Outfit" event="script" value="Outfit.lua"/> "Pasta Servidor > Data > Creaturescripts > Scripts > ABRA o "login.lua". Adicione a seguinte linha antes do return true. registerCreatureEvent(cid, "Outfit") "Pasta Servidor > Data > Creaturescripts > Scripts > CRIE o arquivo "outfit.lua". function onLogin(cid) local r = getCreatureOutfit(cid) local roupa = {lookHead = r.lookHead, lookBody = r.lookBody, lookLegs = r.lookLegs , lookFeet = r.lookFeet} if (getPlayerAccess(cid) <= 2) then if isPlayer(cid) then if getPlayerStorageValue(cid, 1415) == -1 then if getPlayerVocation(cid) == 0 then -- Sem vocação setPlayerStorageValue(cid,1415 ,1) -- Citzen if getPlayerSex(cid) == 0 then -- Se for homem doCreatureChangeOutfit(cid,{lookType = 136, roupa}) -- Roupa Masculina else doCreatureChangeOutfit(cid, {lookType = 128, roupa}) -- Roupa Feminina end end end if getPlayerStorageValue(cid, 1417) == -1 then if getPlayerVocation(cid) == 1 then -- Sorcerer? setPlayerStorageValue(cid,1417 ,1) -- Storage da roupa que voce quer, esta no XML/Outfits if getPlayerSex(cid) == 0 then -- Se for homem doCreatureChangeOutfit(cid,{lookType = 138, roupa}) -- Roupa Masculina else doCreatureChangeOutfit(cid, {lookType = 130, roupa}) -- Roupa Feminina end end end end end return true end Adicionando Vocacoes/Outfits Aqui não consta todos os Outfits para todas vocações, mas você pode adicionar. É que estava com preguiça, seguindo o exemplo: if getPlayerStorageValue(cid, 1415) == -1 then -- A STORAGE DA ROUPA QUE VOCE QUER, XML/OUTFIT if getPlayerVocation(cid) == 0 then -- O NUMERO DA VOCACAO setPlayerStorageValue(cid,1415 ,1) -- A STORAGE DA ROUPA QUE VOCE QUER, XML/OUTFIT if getPlayerSex(cid) == 0 then doCreatureChangeOutfit(cid,{lookType = 136, roupa}) -- Roupa Masculina else doCreatureChangeOutfit(cid, {lookType = 128, roupa}) -- Roupa Feminina end end end PS: O script tava formatado certo, essa bosta tirou a formatação. Editado Agosto 31, 2014 10 anos por Ka zuza (veja o histórico de edições)
Postado Agosto 31, 2014 10 anos Muito bom, curti mesmo. Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito. Aristóteles
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.