Postado Junho 30, 2014 10 anos Você sabe como faz pra alterar o rank? eu nunca joguei e muito menos vi um server de poketibia por dentro mas o resto acho que eu consigo fazer pra vcs 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 Junho 30, 2014 10 anos Eu vi varios servidores que tem este comando que no caso o cara usa o comando e altera o clan. Mais no servidor atualmente para você alterar o rank que você está no clan voce deve fazer algumas tasks que o NPC manda.
Postado Junho 30, 2014 10 anos não, tipo.. eu gostaria de saber se o rank é definido por uma storage ou se é alguma função ou uma tabela no mysql.. posta algum script que utilize uma alteração de rank que eu vejo oque dá pra fazer 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 Junho 30, 2014 10 anos ai um dos npc a função deve tar ai 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 ---------------------- Configs --------------------------- local clanNpcs = { ["Fist Trainer"] = { task1 = { ["Fist Trainer"] = {{"Graveler", 20}, {"Clefable", 20}, {"Wigglytuff", 25}}, }, task2 = { ["Fist Trainer"] = {{"Onix", 20}, {"Dewgong", 20}, {"Chansey", 25}}, }, itens = {{12173, 20}, {12179, 5}, {12192, 10}}, poke = "Primeape", level = 90, prevRank = 1, nextRank = 2, }, ["Tamer Trainer"] = { task1 = { ["Tamer Trainer"] = {{"Onix", 20}, {"Pupitar", 20}, {"Dewgong", 25}}, }, task2 = { ["Tamer Trainer"] = {{"Golem", 20}, {"Snorlax", 20}, {"Kangaskhan", 25}}, }, itens = {{12173, 20}, {12179, 5}, {12192, 10}}, poke = "Hitmonchan", level = 100, prevRank = 2, nextRank = 3, }, ["Fighter Trainer"] = { task1 = { ["Fighter Trainer"] = {{"Blissey", 20}, {"Onix", 20}, {"Chansey", 25}}, }, task2 = { ["Fighter Trainer"] = {{"Golem", 20}, {"Jynx", 20}, {"Kangaskhan", 25}}, }, itens = {{12173, 20}, {12179, 5}, {12192, 10}}, poke = "Machamp", level = 110, prevRank = 3, nextRank = 4, }, ["DeathHand Trainer"] = { task1 = { ["DeathHand Trainer"] = {{"Wigglytuff", 20}, {"Chansey", 20}, {"Blissey", 25}}, }, task2 = { ["DeathHand Trainer"] = {{"Golem", 20}, {"Steelix", 20}, {"Tyranitar", 25}}, }, itens = {{12173, 20}, {12179, 5}, {12192, 10}}, poke = "Snorlax", level = 120, prevRank = 4, nextRank = 5, }, } ------------------------------------------------------------------------------ local npc = clanNpcs[getNpcName()] if msgcontains(msg, 'help') or msgcontains(msg, 'Help') then if getPlayerLevel(cid) < npc.level or getPlayerClanName(cid) ~= 'Gardestrike' or getPlayerClanRank(cid) ~= npc.prevRank then selfSay("I don't need your help!", cid) talkState[talkUser] = 0 return true elseif getPlayerStorageValue(cid, 854789) <= -1 then selfSay("So you want to move up of rank on our clan... So, you need to bring some items to me... Do you wanna do it?", cid) talkState[talkUser] = 1 return true elseif getPlayerStorageValue(cid, 854789) == 1 then selfSay("So you brought to me the items what i asked for?", cid) talkState[talkUser] = 1 return true elseif getPlayerStorageValue(cid, 854789) == 2 then selfSay("The next step is you caught a pokemon to me... Do you wanna do it?", cid) talkState[talkUser] = 1 return true elseif getPlayerStorageValue(cid, 854789) == 3 then selfSay("So you caught the pokemon what i asked for?", cid) talkState[talkUser] = 1 return true elseif getPlayerStorageValue(cid, 854789) == 4 then selfSay("Now you need to do some tasks for me... Do you wanna do it?", cid) talkState[talkUser] = 1 return true elseif getPlayerStorageValue(cid, 854789) == 5 then selfSay("So you finished the first task what i asked for?", cid) talkState[talkUser] = 1 return true elseif getPlayerStorageValue(cid, 854789) == 6 then selfSay("And now comes the last task... Do you wanna to begin it?", cid) talkState[talkUser] = 1 return true elseif getPlayerStorageValue(cid, 854789) == 7 then selfSay("So you finished the last task what i asked for?", cid) talkState[talkUser] = 1 return true end elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, 854789) <= -1 then local str = "Ok then, you need bring to me: " for a = 1, #npc.itens do str = str..(a == #npc.itens and " and " or a ~= 1 and ", " or "{")..(npc.itens[a][2]).." "..(getItemNameById(npc.itens[a][1])) end str = str.."}, come back when you join those items!" selfSay(str, cid) setPlayerStorageValue(cid, 854789, 1) talkState[talkUser] = 0 return true elseif getPlayerStorageValue(cid, 854789) == 1 then local check = checkItensForTask(cid, npc.itens) if check == 0 then selfSay("Ok then, you completed the mission, talk to me again when you want to continue!", cid) setPlayerStorageValue(cid, 854789, 2) talkState[talkUser] = 0 return true else selfSay(check, cid) talkState[talkUser] = 0 return true end elseif getPlayerStorageValue(cid, 854789) == 2 then selfSay("Ok then, you need to caught a {"..(npc.poke).."}, and bring it to me... Come back when you do that!", cid) setPlayerStorageValue(cid, 854789, 3) setPlayerStorageValue(cid, 854788, npc.poke) talkState[talkUser] = 0 return true elseif getPlayerStorageValue(cid, 854789) == 3 then if getPlayerStorageValue(cid, 854788) == 'done' then selfSay("Very well, talk to me again when you want to continue!", cid) setPlayerStorageValue(cid, 854789, 4) setPlayerStorageValue(cid, 854788, -1) setPlayerStorageValue(cid, 854787, npc.poke) talkState[talkUser] = 0 return true else selfSay("You didn't caught the pokemon what i asked for! Go do it!", cid) talkState[talkUser] = 0 return true end elseif getPlayerStorageValue(cid, 854789) == 4 then local sto = getFreeTaskStorage(cid) local c = 0 if sto == -1 then selfSay("You can't get more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid) talkState[talkUser] = 0 return true end local str = "Ok then, now you need to kill: {" for e, f in pairs(npc.task1) do for a = 1, #f do str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1] c = c+1 end end str = str.."} with the {"..(npc.poke).."} which you caught!" selfSay(str, cid) setPlayerStorageValue(cid, 854789, 5) setStorageArray(cid, sto, npc.task1) talkState[talkUser] = 0 return true elseif getPlayerStorageValue(cid, 854789) == 5 then if isMyTaskComplete(cid, getNpcCid()) then selfSay("Very well, you have done my first task... Talk to me again when you want to continue!", cid) local sto = getMyTaskSto(cid, getNpcCid()) setPlayerStorageValue(cid, sto, -1) setPlayerStorageValue(cid, 854789, 6) talkState[talkUser] = 0 return true else selfSay("You didn't complete my task yet... Go end it!", cid) talkState[talkUser] = 0 return true end elseif getPlayerStorageValue(cid, 854789) == 6 then local sto = getFreeTaskStorage(cid) local c = 0 if sto == -1 then selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid) talkState[talkUser] = 0 return true end local str = "Ok then, now for your last task you need to kill: {" for e, f in pairs(npc.task2) do for a = 1, #f do str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1] c = c+1 end end str = str.."} with the {"..(npc.poke).."} which you caught!" selfSay(str, cid) setPlayerStorageValue(cid, 854789, 7) setStorageArray(cid, sto, npc.task2) talkState[talkUser] = 0 return true elseif getPlayerStorageValue(cid, 854789) == 7 then if isMyTaskComplete(cid, getNpcCid()) then --- local storages = {17000, 63215, 17001, 13008, 5700} --alterado v1.8 for s = 1, #storages do if getPlayerStorageValue(cid, storages) >= 1 then selfSay("You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!", cid) talkState[talkUser] = 0 return true end end if #getCreatureSummons(cid) >= 1 then --alterado v1.8 selfSay("Return your pokemon!", cid) talkState[talkUser] = 0 return true end --- if checkPokemonForTask(cid, npc.poke) then setPlayerClanRank(cid, npc.nextRank) selfSay("So you complete my last task! Congradulations! Now you move up of rank and become {"..lookClans[getPlayerClanNum(cid)][getPlayerClanRank(cid)].."}!", cid) setPlayerStorageValue(cid, 854789, -1) setPlayerStorageValue(cid, 854787, -1) local sto = getMyTaskSto(cid, getNpcCid()) setPlayerStorageValue(cid, sto, -1) talkState[talkUser] = 0 return true else selfSay("You aren't with the "..(npc.poke).." which you caught before in your pokebag! Go get it!", cid) talkState[talkUser] = 0 return true end else selfSay("You didn't complete my task yet... Go end it!", cid) talkState[talkUser] = 0 return true end end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Julho 1, 2014 10 anos ok, era exatamente oque eu precisava.. vou fazer hj quando voltar da aula local vocation = { ["sorcerer"] = 1, ["druid"] = 2, ["paladin"] = 3, ["knight"] = 4, ["master sorcerer"] = 5, ["elder druid"] = 6, ["royal paladin"] = 7, ["elite knight"] = 8 } local maxrank = 5 local minrank = 0 local price = 10000 function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Name the vocation and rank that you want separated by comma.") return true end local t = string.explode(param, ",", 1) if(not t[2]) or tonumber(t[2]) > maxrank or tonumber(t[2]) < minrank then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid rank number.") return true end if (not vocation[string.lower(t[1])]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[1].." is not a valid vocation name") return true end if doPlayerRemoveMoney(cid, price) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed your vocation to "..t[1].." in rank "..t[2]..".") doPlayerSetVocation(cid, vocation[string.lower(t[1])]) setPlayerClanRank(cid, t[2]) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't seem to have "..price.." gp's.") end return true end ajusta aqui: local maxrank = 5 -- rank máximo que o player pode escolher pela talkaction local minrank = 0 -- rank mínimo (coloquei pro cara não escolher rank - 999 e dar erro local price = 10000 -- preço pra trocar de classe/rank aqui são as vocações que dá pra você colocar.. escreva o nome (tudo minúsculo) entre aspas dentro do colchetes e o numero de lado de fora é o numero que aquela classe representa (veja em data\XML\vocations.xml) ["sorcerer"] = 1, ["druid"] = 2, ["paladin"] = 3, ["knight"] = 4, ["master sorcerer"] = 5, ["elder druid"] = 6, ["royal paladin"] = 7, ["elite knight"] = 8 em talkactions.xml adicione: <talkaction log="yes" words="/clan" event="script" value="clan.lua"/> 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.