Postado Julho 26, 2013 11 anos Funcional em: TFS 8.6 DEV 0.4 (REV3884) Creditos: Mdgabrielzim Em data/npc crie um arquivo resetador.xml e coloque dentro: <?xml version="1.0"?><npc name="Resetador" script="data/npc/scripts/reseter.lua" walkinterval="0" floorchange="0"> <health now="100" max="100"/> <look type="133" head="10" body="122" legs="19" feet="10"/> <parameters> <parameter key="message_greet" value="Ola, |PLAYERNAME|. Eu posso {resetar} seu level. "/> </parameters> </npc> Crie um arquivo chamado resetador.lua em data\npc\scripts e coloque dentro: -- config local minlevel = 50 -- level inical para resetar local price = 1000 -- preço inicial para resetar local newlevel = 8 -- level após reset local newexp = 4200 -- nova experiencia após reset local lvlByReset = 50 -- level acrescentado por reset local priceByReset = 100 -- preço acrescentado por reset local maxResets = 100 -- máximo de resets -- end config function addReset(cid) resets = getResets(cid) setPlayerStorageValue(cid,1020,resets+1) return true end function getResets(cid) resets = getPlayerStorageValue(cid,1020) if resets <= 0 then resets = 0 end return resets end 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 local needlvl = minlevel + (getResets(cid) * lvlByReset) local newPrice = price + (getResets(cid) * priceByReset) if msgcontains(msg, 'resetar') then if getResets(cid) <= maxResets then selfSay('Voce deseja reset seu char? Isto custará '..newPrice..' gp\'s!', cid) talkState[talkUser] = 1 else selfSay('Você ja alcançou seu limite de resets!', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerMoney(cid) <= newPrice then selfSay('É Necessario ter '..newPrice..' gp\'s para resetar!', cid) elseif getPlayerLevel(cid) <= needlvl then selfSay('O level minimo para reset é '..needlvl..'!', cid) else doPlayerRemoveMoney(cid,newPrice) if isInArray(vocs, getPlayerVocation(cid)) then doPlayerSetVocation(cid, getPlayerVocation(cid)+4) end addReset(cid) playerid = getPlayerGUID(cid) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level`="..newlevel..",`experience`="..newexp.." WHERE `players`.`id`= ".. playerid .."") end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then talkState[talkUser] = 0 selfSay('Ok.', cid) elseif msgcontains(msg, 'quant') then selfSay('Voce tem um total de '..getResets(cid)..' reset(s).', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Contato : under12451 (Skype) Meus Tutoriais O Que é DDoS ? como se Proteger Por Tony Criando Servidor Poketibia Sistemas de Vips com [VIP] No Nome Cyclops - Mistrock - 100% AFK Como Editar um NPC 8.6 [ Itens e Preços] Editando Swords 8.6 Como Editar um NPC 8.6 [VENDA]
Postado Julho 26, 2013 11 anos Boa cara rep+ e obrigado por compartilha aqui no TK !!! Att, Kluivert.
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.