Gostei, ficou bem legal meu resp+ pra tu, continue assim ;].
- Fórum
- OTServ
- Recursos
- Scripting
- NPCs, monsters e raids
- Promotion System 1.0 - By SmiX
SM
8
2k
info
Grupo: Marquês
Registrado: 18/05/11
Posts: 1.1k
Reputação: +333
Gênero: Masculino
Char no Tibia: Kyuzen

08 de janeiro de 2013 às 15:35
info
Grupo: Visconde
Registrado: 10/09/12
Posts: 476
Reputação: +2
Char no Tibia: Esqueci

12 de janeiro de 2013 às 14:44
@Smix é para poketibia ?
13 de janeiro de 2013 às 11:51
Não, fiz esse npc para dar uma enfase ao Tibia.
info
Grupo: Visconde
Registrado: 10/09/12
Posts: 476
Reputação: +2
Char no Tibia: Esqueci

13 de janeiro de 2013 às 13:01
@Smix aqui no Xtibia tem a promotion quest tipo do pxg ?Eu procurei e ainda não achei
13 de janeiro de 2013 às 17:20
Depois eu posso fazer. Mais esse npc pode servir de base.
info
Grupo: Campones
Registrado: 13/01/13
Posts: 7
Reputação: +1

14 de janeiro de 2013 às 20:56
Coloquei o NPC no jogo e ele pede pra eu falar ''info'' . Eu falo e nada acontece.. O que acontece??
Obrigado, já me ajudou demais com o script, tudo do q eu precisava ^^
1 mês depois...






info
Grupo: Conde
Registrado: 25/01/12
Posts: 963
Reputação: +265
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
<?xml version="1.0" encoding="UTF-8"?> <npc name="Cap. Oxinar" script="setPromotion.lua" walkinterval="1" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="158" head="50" body="113" legs="113" feet="113" corpse="2212"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|, you want to change your vocation? talk: {info}."/> </parameters> </npc>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) 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 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 cid local 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 end return true end npcHandler: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...