galera keria um npc de outift igual do tibia global, tipo se da 5k e ele da uma outfit em troca, ja tentei todos os npc de outfit aki do xtibia e nao deu certo.
se alguem puder me fazer 1, ou mostra um q funfe certinho eu do rep + vlwwww
galera keria um npc de outift igual do tibia global, tipo se da 5k e ele da uma outfit em troca, ja tentei todos os npc de outfit aki do xtibia e nao deu certo.
se alguem puder me fazer 1, ou mostra um q funfe certinho eu do rep + vlwwww
Voce quer receber outfit ou addon?
Se for outfit voce precisa colocar uma storage no XML/outfits.xml
Vou dar um exemplo com assassin outfit:
<outfit id="14" quest="10023"> premium="yes"> <list gender="0" lookType="156" name="Assassin"/> <list gender="1" lookType="152" name="Assassin"/> </outfit>
A storage é quest="10023">
Entao voce tem que criar um npc que de essa storage, entao o player poderá usar a outfit.
Vai em data/npc e crie um npc chamado Assassin Brother.xml e coloque isso dentro:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Assassin Brother" script="assassin.lua" floorchange="0" speed="460"> <health now="100" max="100"/> <look type="152" head="40" body="126" legs="114" feet="0" addons="2"/> </npc>
Agora vá em npc/scripts e crie um arquivo chamado assassin.lua e coloque isso dentro:
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) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'itens')) then selfSay('Me traga 5k que lhe fa\ço a {outfit}.', cid) elseif(msgcontains(msg, 'outfit')) then selfSay('Voc\ê me trouxe 5k para o assassin outfit?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerStorageValue(cid, 10023) == -1 then if(doPlayerRemoveMoney(cid, 5000) == true) then selfSay('Sua roupa esta pronta, pode vestir!', cid) setPlayerStorageValue(cid, 10023,1) talkState[talkUser] = 0 else selfSay('Voc\ê n\ão tem dinheiro.', cid) talkState[talkUser] = 0 end else selfSay('Voc\ê ja tem essa roupa.', cid) talkState[talkUser] = 0 end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Ajudei?
REP+
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 AddOutfit(cid, message, keywords, parameters, node) --by vodka if(not npcHandler:isFocused(cid)) then return false end if (isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) then if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then npcHandler:say('You must reach level ' .. parameters.level .. ' to buy this mount.', cid) elseif getPlayerStorageValue(cid, parameters.storage[getPlayerSex(cid)]) ~= -1 then npcHandler:say('you already have this outfit!', cid) elseif not doPlayerRemoveMoney(cid, parameters.price) then npcHandler:say('Sorry You need '..parameters.price..' gps to buy this mount!', cid) else doPlayerAddOutfit(cid, parameters.outfit[getPlayerSex(cid)], 1) setPlayerStorageValue(cid, parameters.storage[getPlayerSex(cid)], 1) npcHandler:say('Here is your outfits!', cid) npcHandler:resetNpc() end else npcHandler:say('I can only allow premium players to buy this outfit.', cid) end npcHandler:resetNpc() return true end local outs = { {"assassin", outfitID = {[0] = 156,[1] = 152}, price = 2000, stor = {[0] = 51001,[1] = 52001}, level = 10, premium = true}, {"pirate", outfitID = {[0] = 156,[1] = 152}, price = 5000,stor = {[0] = 51002,[1] = 52002}, level = 15, premium = false}, {"outfits", text = "I sell these outfits: {assassin},{pirate}, or {beggar}!"} } for i = 1, #outs do local get = outs[i] if type(get.outfitID) == "table" then local node = keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "You want to buy the oufit " .. get[1] .. " for "..get.price.." ?"}) node:addChildKeyword({"yes"}, AddOutfit, {price = get.price, outfit = get.outfitID, storage = get.stor, level = get.level, premium = get.premium}) node:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ok, then.", reset = true}) else keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = get.text}) end end mounts = nil npcHandler:addModule(FocusModule:new())
outfitID = {
[0] = 156, -- 0 significa sexo feminino, logo é o id da outfit female
[1] = 152 -- 1 significa sexo masculino, logo é o id da outfit male
}
stor = {
[0] = 51002, -- storage pro sexo feminino
[1] = 52002 -- storage pro sexo masculino
}
storage serve para ele não comprar a mesma outfits várias vezes.
num deu certo, eu axo q eh pq eu colokei pra cada vocation começar com sua propria outfit, tem como por pra ganhar + outfit?
Como eu vou saber?
O pedido foi de npc, eu testei e funcionou.
e outra, acho que não é nem outfit, você se confundiu, você quis dizer addon?
eh outfit sim, pq meu servidor eh de narutibia nao tem addon.
mais entao...
por favor cara eu preciso disso urgente me da uma mão
pod fexar o topico o do lucas funfo
vlw a todos ai rep+
Galera preciso arrumar este script alquem ajuda ai, ao invez de ser grana q o npc retira, gostaria q ele retirasse itens, ajudem ai plx, valendo +REP
Lek voce que um scripts que o player ja começe com a outfit e
Em Creaturescripts Em Scrpits Copie Um Arquivo.lua e renomei pra Outfit E cole Esse Tag Abaixo Dentro Do Arquivo function onLogin(cid) local config = { [1] = {71}, -- dentro do [ ] coloque o numero da vocaçao e { } coloque o numero da looktype [13] = {2}, [3] = {193}, [25] = {1}, [50] = {52}, [70] = {101}, [170] = {96}, [200] = {11}, [90] = {50}, [110] = {424}, [130] = {370}, [150] = {309} } local voc = config[getPlayerVocation(cid)] if voc then if getPlayerStorageValue(cid, 13000) < 0 then local newtype = {lookType = voc[1]} doCreatureChangeOutfit(cid, newtype) setPlayerStorageValue(cid, 13000, 1) end end return TRUE end
Em Login Lua Adicione Esse Codigo registerCreatureEvent(cid, "Outfit")
<event type="login" name="Outfit" event="script" value="outfit.lua"/> Nao sei se Foi uq Vc que fazer mas isso e pra player ja inicia com outfit criada pelo account maneger Se for Da um Rap ai