Postado Março 21, 2014 11 anos se não funcionar agora: desisto. Só trabalho com as versões que eu tenho aqui em casa, isso daí é oque, 9.1? Tenta isso daqui, talvez a parte de skills funcione agora (mas só se o level funcionar tb) --[[Script made 100% by Nogard and Night Wolf. You can feel free to edit anything you want, but don't remove the credits]] local config = { minlevel = 50, --- level inical para resetar price = 10000, --- preço inicial para resetar newlevel = 20, --- level após reset priceByReset = 10000, --- preço acrescentado por reset mlnew = 20, --- quanto de ml vai adicionar ao resetar skillnew = 25 --- quanto de skill vai dar (axe, club, sword, shield, distance) } --- end config function addReset(cid) resets = getResets(cid) setPlayerStorageValue(cid, 378378, resets+1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) ------------------------------------ MUDE AQUI A % DE VIDA QUE GANHA AO RESETAR --------------------- local hp = getCreatureMaxHealth(cid) local resethp = hp*0.25 setCreatureMaxHealth(cid, resethp) local differencehp = (hp - resethp) doCreatureAddHealth(cid, -differencehp) local mana = getCreatureMaxMana(cid) local resetmana = mana*0.25 setCreatureMaxMana(cid, resetmana) local differencemana = (mana - resetmana) doCreatureAddMana(cid, -differencemana) ------------------------------------ FIM ---------------------------- ------------------------------ EDIÇÃO DAS SKILLS -------------------- if isInArray({1,5,2,6}, getPlayerVocation(cid)) then local magic = getPlayerSkillLevel(cid, SKILL__MAGLEVEL) db.executeQuery("UPDATE `player_skills` SET `value` = " .. (magic + config.mlnew) .. ", `count` = 0 WHERE `skillid` = 7 and `player_id` = " .. playerid .. ";") end if isInArray({4,8}, getPlayerVocation(cid)) then local club = getPlayerSkillLevel(cid, SKILL_CLUB) local sword = getPlayerSkillLevel(cid, SKILL_SWORD) local axe = getPlayerSkillLevel(cid, SKILL_AXE) local shield = getPlayerSkillLevel(cid, SKILL_SHIELD) db.executeQuery("UPDATE `player_skills` SET `value` = " .. (shield + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (axe + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 3 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (sword + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (club + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 1 and `player_id` = " .. playerid .. ";") end if isInArray({3,7}, getPlayerVocation(cid)) then local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE) local shield = getPlayerSkillLevel(cid, SKILL_SHIELD) db.executeQuery("UPDATE `player_skills` SET `value` = " .. (shield + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (distance + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 4 and `player_id` = " .. playerid .. ";") end ------------------------FIM ---------------------------------- doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `description` = ' [Reset: "..resets.."]' WHERE `players`.`id`= ".. playerid .."") db.executeQuery("UPDATE `players` SET `level`="..config.newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid .."") return TRUE end function getResets(cid) resets = getPlayerStorageValue(cid, 378378) 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local newPrice = config.price + (getResets(cid) * config.priceByReset) if msgcontains(msg, 'reset') then if getResets(cid) == resets then selfSay('You want to reset your character? It will cost '..newPrice..' gp\'s!', cid) talkState[talkUser] = 1 else selfSay('I couldnt acess your bank of acess!', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerMoney(cid) < newPrice then selfSay('Its necessary to have at least '..newPrice..' gp\'s for reseting!', cid) elseif getPlayerLevel(cid) < config.minlevel then selfSay('The minimum level for reseting is '..config.minlevel..'!', cid) else doPlayerRemoveMoney(cid,newPrice) playerid = getPlayerGUID(cid) addEvent(addReset, (5*1000), cid) local msg ="---[Reset: "..getResets(cid).."]-- You have reseted! You'll be disconnected in 5 seconds." if doPlayerPopupFYI(cid, msg) then end end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then talkState[talkUser] = 0 selfSay('Ok.', cid) elseif msgcontains(msg, 'quantity') then selfSay('You have a total of '..getResets(cid)..' reset(s).', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Março 22, 2014 11 anos comente alguma coisa.... funcionou? não funcionou? eu dediquei muito tempo fazendo isso pra você e eu gostaria de um feedback. Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Março 22, 2014 11 anos Solução Talvez se nao de certo tente trocar o db.executeQuery pelo db.query,pois tenho um servidor 8.6 rev3884 e só aceita o db.query! Quanto ao script,ficou bom vou testar se funcionar,reputarei devidamente,vlw
Postado Março 22, 2014 11 anos Autor trocando o db.executeQuery por db.query deu sim, obrigado a ajuda dos dois.. muito obrigado mesmo (L) rep ++++ Duvida sanada. Editado Março 22, 2014 11 anos por azzouks (veja o histórico de edições)
Postado Março 23, 2014 11 anos @Lyon @azzouks o script funcinou até na parte de editar as skills? é que eu nunca havia mexido com npc antes, foi realmente um "desafio". Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
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.