Postado Junho 1, 2018 6 anos Eu tenho uma script de promotion feito pelo amigo @Sttorm e eu queria adicionar mais uma coisa nela que é para quando o player fazer a promotion ele foce para o nivel 1 feito uma Reborn"reset" Script: local t = { [569] = {570, 1020, 3000, 3000}, } local itemid, count = 8306 , 1 local level = 1500 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) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local a = t[getPlayerVocation(cid)] if msgcontains(msg, "mystic promotion") then if a then if getPlayerLevel(cid) >= level then if doPlayerRemoveItem(cid, itemid, count) then local outfit = {lookType = a[2]} doPlayerSetVocation(cid, a[1]) doCreatureChangeOutfit(cid, outfit) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + a[3]) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + a[4]) addEvent(doRemoveCreature, 1000, cid) else selfSay('Voce precisa de '.. count ..' '.. getItemInfo(itemid).name ..' para fazer a Mystic Promotion.', cid) end else selfSay('Você precisa estar no level '.. level ..'.', cid) end else selfSay('Sua Vocation não tem Promotion disponivel, Voce Precisa estar na ultima Transform!', cid) end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Junho 1, 2018 6 anos @Jociel local t = { [569] = {570, 1020, 3000, 3000}, } local itemid, count = 8306 , 1 local level = 1500 local newlevel = 1 -- Level apos resetar 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) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local a = t[getPlayerVocation(cid)] local playerid = getPlayerGUID(cid) if msgcontains(msg, "mystic promotion") then if a then if getPlayerLevel(cid) >= level then if doPlayerRemoveItem(cid, itemid, count) then local outfit = {lookType = a[2]} doPlayerSetVocation(cid, a[1]) doCreatureChangeOutfit(cid, outfit) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + a[3]) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + a[4]) db.executeQuery("UPDATE `players` SET `level`="..newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid .."") addEvent(doRemoveCreature, 1000, cid) else selfSay('Voce precisa de '.. count ..' '.. getItemInfo(itemid).name ..' para fazer a Mystic Promotion.', cid) end else selfSay('Você precisa estar no level '.. level ..'.', cid) end else selfSay('Sua Vocation não tem Promotion disponivel, Voce Precisa estar na ultima Transform!', cid) end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Junho 1, 2018 6 anos Autor Em 01/06/2018 em 16:51, Sttorm disse: @Jociel local t = { [569] = {570, 1020, 3000, 3000}, } local itemid, count = 8306 , 1 local level = 1500 local newlevel = 1 -- Level apos resetar 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) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local a = t[getPlayerVocation(cid)] local playerid = getPlayerGUID(cid) if msgcontains(msg, "mystic promotion") then if a then if getPlayerLevel(cid) >= level then if doPlayerRemoveItem(cid, itemid, count) then local outfit = {lookType = a[2]} doPlayerSetVocation(cid, a[1]) doCreatureChangeOutfit(cid, outfit) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + a[3]) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + a[4]) db.executeQuery("UPDATE `players` SET `level`="..newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid .."") addEvent(doRemoveCreature, 1000, cid) else selfSay('Voce precisa de '.. count ..' '.. getItemInfo(itemid).name ..' para fazer a Mystic Promotion.', cid) end else selfSay('Você precisa estar no level '.. level ..'.', cid) end else selfSay('Sua Vocation não tem Promotion disponivel, Voce Precisa estar na ultima Transform!', cid) end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) O player faz a promotion normalmente porem nao reseta o lvl dele e nao consta nenhum erro na distro!
Postado Junho 1, 2018 6 anos Solução @Jociel local t = { [569] = {570, 1020, 3000, 3000}, } local itemid, count = 8306 , 1 local level = 1500 local newlevel = 1 -- Level apos resetar 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) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local a = t[getPlayerVocation(cid)] if msgcontains(msg, "mystic promotion") then if a then if getPlayerLevel(cid) >= level then if doPlayerRemoveItem(cid, itemid, count) then local outfit = {lookType = a[2]} doPlayerSetVocation(cid, a[1]) doCreatureChangeOutfit(cid, outfit) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + a[3]) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + a[4]) doPlayerAddLevel(cid, -(getPlayerLevel(cid) - newlevel)) addEvent(doRemoveCreature, 1000, cid) else selfSay('Voce precisa de '.. count ..' '.. getItemInfo(itemid).name ..' para fazer a Mystic Promotion.', cid) end else selfSay('Você precisa estar no level '.. level ..'.', cid) end else selfSay('Sua Vocation não tem Promotion disponivel, Voce Precisa estar na ultima Transform!', cid) end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Junho 1, 2018 6 anos Autor @Sttorm Perfeito so mais uma coisa tem como botar para o Max Level para poder fazer essa promotion seja extamente 1500. pq o 1500 ta como minimo
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.