Postado Agosto 3, 2018 6 anos Autor Spoiler 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 doChangeWeapon(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('Desculpe, voce precisa ter level ' .. parameters.level .. ' ou mais para forjar este item.', cid) elseif not doRemoveItemsFromList(cid,parameters.items) then npcHandler:say('Desculpe, mas voce não tem '..getItemsFromList(parameters.items)..' para forjar este item!', cid) else local r = parameters.chance local v = math.random(1, 100) if r > v then npcHandler:say('Sucesso! Aqui esta seu item.', cid) doPlayerAddEditedItem(cid, parameters.give, 1) doSendMagicEffect(getPlayerPosition(cid), math.random(28,30)) else npcHandler:say('Desculpe, mas seu item falho na forja!', cid) doSendMagicEffect(getPlayerPosition(cid), 2) end npcHandler:resetNpc() end else npcHandler:say('Desculpe, mas apenas forjo esse item para jogadores premium account.', cid) end npcHandler:resetNpc() return true end local list = { {"demon armor", items = {{2466,3},{2160,2}}, item_give = 101, chance = 30, level = 10, premium = false}, {"solar axe", items = {{2432,10},{2160,5},{8924,1}}, item_give = 8925, chance = 50, level = 15, premium = true}, {"broadsword", items = {{2376,10},{2160,2}}, item_give = 2413, chance = 90, level = 15, premium = false}, {"magic longsword", items = {{2400,5},{2393,5},{2160,5}}, item_give = 2390, chance = 90, level = 25, premium = false}, {"ice rapier", items = {{7449,2},{2160,5}}, item_give = 2396, chance = 10, level = 25, premium = false}, {"itens", text = "Eu posso te forjar alguns itens como: {demon armor},{solar axe},{broadsword} ou {magic longsword}!"} } for i = 1, #list do local get = list if type(get.items) == "table" then local node = keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Para forjar o item " .. get[1] .. " é necessário "..getItemsFromList(get.items)..". Você tem tudo isso para me dar?"}) node:addChildKeyword({"yes"}, doChangeWeapon, {items = get.items, give = get.item_give, chance = get.chance, level = get.level, premium = get.premium}) node:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "tudo bem entao.", reset = true}) else keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = get.text}) end end mounts = nil npcHandler:addModule(FocusModule:new())
Postado Agosto 3, 2018 6 anos é o xml do seu npc não o lua [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Agosto 3, 2018 6 anos Autor foi mau entendi errado Spoiler <?xml version="1.0"?> <npc name="Superior" script="Superior.lua" walkinterval="50000" floorchange="0"> <health now="100" max="100"/> <look type="129" head="95" body="116" legs="121" feet="115" addons="3"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|.Eu posso forjar alguns {itens} itens para voce!" /> </parameters> </npc>
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.