Nathallia 0 #1 Posted January 8, 2013 Oi galerinha, tudo bem? Queria dizer que é uma honra fazer scripts para todos vocês, aproveitando quero pedir avaliação de todos sobre o sistema. Bom, me espelhando no RPG perdido, utimamamente, pelos otservidores criei esse sistema. Que funciona basicamente assim: Há 5 tipos de promotions para cada vocação, cada uma com o seu nível, como podem ver a baixo a tabela de Promotions existentes no sistema:////////////////////////////////////////////////////////////////// |Sorcerer -> Pyromantic -> Incendiary -> Cloud Walker -> Skyer Mage |Druid -> Lightbringer -> God Hands -> Bloody Priest -> Death Disciple |Paladin -> Hunter -> Head Hunter -> Ninja -> Strong Assassin |Knights -> Barbarians -> Hellborn -> Gladiators -> Imperial Gladiators |////////////////////////////////////////////////////////////////// |O player pode trocar de vocação dando certo(s) item(s) ao npc(configurável). Vale lembrar que a cada nível de vocação é multiplicado pelo quantidade de itens que o player tem que entregar; ou seja, se o player estiver no nível 1 e a quantidade de itens a ser entregue for igual a "5" na próxima troca de vocação ele terá que entregar "10" itens e na terceira troca "15" e assim por diante.Vamos a instalação: (Substitua todo) data/XML/vocations.xml: Agora em: data/npc/setPromotion.xml Agora crie: data/npc/scripts/setPromotion.lua local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endfunction creatureSayCallback(cid, type, msg)if(not npcHandler:isFocused(cid)) thenreturn falseendlocal config = { [1] = {itemNeeded = 2160, count = 1, new={"Sorcerer", "Pyromantic", "Incendiary", "Cloud Walker", "Skyer Mage"}}, [2] = {itemNeeded = 2160, count = 2, new={"Druid", "Lightbringer", "God Hands", "Bloody Priest", "Death Disciple"}}, [3] = {itemNeeded = 2160, count = 1, new={"Paladin", "Hunter", "Head Hunter", "Ninja", "Strong Assassin"}}, [4] = {itemNeeded = 2160, count = 1, new={"Knight", "Barbarians", "Hellborn", "Gladiators", "Imperial Gladiators"}},}---------------local novoc = {17,18,19,20}local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cidlocal msg, x = string.lower(msg), config[getPlayerStorageValue(cid, 1893)] if(msgcontains(msg, 'info'))then if getPlayerStorageValue(cid, 1893) < 1 then setPlayerStorageValue(cid, 1893, getPlayerVocation(cid)) end if isInArray(novoc, getPlayerVocation(cid)) then selfSay("Sorry, you're on your last level of his vocation.", cid) talkState[talkUser] = 0 return true else selfSay("--Info-- \nYou can go from ["..getPlayerVocationName(cid).."] to ["..x.new[getPlayerStorageValue(cid, 1894)+1].."]", cid) talkState[talkUser] = 1 return true end elseif(msgcontains(msg, 'set vocation')and talkState[talkUser] == 1) then if(doPlayerRemoveItem(cid, x.itemNeeded, x.count*getPlayerStorageValue(cid, 1894))) then doPlayerSetVocation(cid, getPlayerVocation(cid)+4) selfSay("Congratulations, your new vocation was changed to: "..getPlayerVocationName(cid).."", cid) setPlayerStorageValue(cid, 1894, getPlayerStorageValue(cid, 1894)+1) else selfSay("Sorry, you need a "..x.count*getPlayerStorageValue(cid, 1894).." "..getItemNameById(x.itemNeeded)..""..(x.count == 1 and "" or "s")..".", cid) talkState[talkUser] = 0 return true end endreturn trueendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new()) Lembrando, eu não balanciei as vocações, deixei isso a seu gosto. Só isso, fui... Share this post Link to post Share on other sites
Willbhor 18 #2 Posted January 8, 2013 Cadê o código? Share this post Link to post Share on other sites
luishtfs 1 #3 Posted January 9, 2013 Hehe, fail no primeiro código, dá uma editadinha aí depois, valeu! Share this post Link to post Share on other sites
Eventide 7 #4 Posted July 19, 2013 Essa seção é para discussões não para códigos prontos, utilize a seção Quero postar meu script pra isso. Tópico fechado. Share this post Link to post Share on other sites