Ir para conteúdo
  • Cadastre-se

Posts Recomendados

bem legal, útil para Ot's, que por exemplo: tenha um sistema de se transformar em certa vocation para poder usar tal spell, ou item, ou como um avanço na "raça" de teu personagem ;x

bem explicado rep+ ^^

Link para o post
Compartilhar em outros sites
  • 4 months later...

Aonde eu adiciono isso??

Se me falar dou rep +

Amigo o primeiro script deve ficar em, data/npc/

Crie um arquivo .xml dentro dessa pasta e adicione o code informado, depois é só testar.

Link para o post
Compartilhar em outros sites
  • 4 years later...

Oi, foi mal ressucitar o post, mas no caso, se eu quiser que só promova se já tiver x vocation, no caso druid só se promover pra elder druid, e assim em diante, como faz?

Porque testei o script, e se eu for druid posso trocar pra sorc :x

 

#Edit
Consegui resolver, achei um script aqui no fórum e alterei para ficar "perfeito", no caso do meu script, o npc pede a quantidade de money configurada no script, e x item (configurável e você pode remover também)

Caso queira, basta criar um novo npc para sorcerer e assim vai, e se tiver um conhecimento maior de script basta adicionar mais linhas aí no mesmo script que vai servir para todas as vocs (sim esse npc aí só da promotion pra druids, pois no meu server eu separei a promotion entre quatro npcs.)
Ah, eu testei esse script em TFS 1.2 (10.98), acredito que ele só sirva pra 1.0 +

Script :

Citar

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
local prom = getPlayerVocation(cid)
local lvl = getPlayerLevel(cid)
local money = getPlayerMoney(cid)

    if(msgcontains(msg, 'promotion')) then -- aqui no caso é a promotion normal, mas se você quiser alterar para ser a segunda, e deixar o npc normal dando a primeira, e criar um novo npc pra segunda, que no caso é este
        selfSay('I can sell you the first promotion (elder druid), you will want?', cid)
    talkState[talkUser] = 1

    elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then 
            if (lvl >= 20) and (prom == 2) and (money >= 10000) and getPlayerItemCount(cid, 12399, 30) then
            doPlayerSetVocation(cid, 6) -- Id da promotion antiga, elder druid
            doPlayerRemoveMoney(cid, 10000)
            doPlayerRemoveItem(cid, 12399, 30)
            doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
            selfSay('Now you are Elder Druid.', cid)
            talkState[talkUser] = 0
            else
            selfSay('You don\'t have the right level, previous promotion, or money.', cid)
            talkState[talkUser] = 0
            end


    elseif(msgcontains(msg, 'shamanic')) then -- nome da segunda promotion
        selfSay('I can give you the second promotion (shamanic apprentice), you will want?', cid)
    talkState[talkUser] = 2

    elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
                if (lvl >= 150) and (prom == 6) and (money >= 100000) and getPlayerItemCount(cid, 11199, 100) then
            doPlayerSetVocation(cid, 10) -- Id da nova promotion, caso o player tenha a anterior, que é a 6 (elder druid) no meu caso            doPlayerRemoveMoney(cid, 100000)
            doPlayerRemoveItem(cid, 11199, 100)
            doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
            selfSay('Now you are Elder Druid (Shamanic).', cid)
            talkState[talkUser] = 0
            else
            selfSay('You don\'t have the right level, previous promotion, money, or items.', cid)
            talkState[talkUser] = 0
            end
        end
    return true
end

keywordHandler:addKeyword({"promote"}, StdModule.say, {npcHandler = npcHandler, text = "I can promote the adventurers with the vocation of druid, the vocations available are Elder Druid per {10.000 gps} and {30} {girlish hair decoration}. And Elder Druid Shamanic (apprentice) per {100.000 gps} and {100 hydra head}."})
keywordHandler:addKeyword({"help"}, StdModule.say, {npcHandler = npcHandler, text = "The Elder Druid promotion, gives you over 100 soul points, plus your life/mana regeneration go up more fast, Elder Druids have more endurance and unique spells. Just like Shamanic, who has unique spells for promotion (you can see when it's promoted), your soul points will increase to 300 when you promote to the Shamanic.."})

npcHandler:setMessage(MESSAGE_GREET, "Hello brave adventurer, are you missed on this side of the continent? It is not common to find warriors here. Do you want to {promote} your vocation? Or {Help}?")
npcHandler:setMessage(MESSAGE_FAREWELL, "Goodbye |PLAYERNAME|")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Goodbye |PLAYERNAME|")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 

 

Editado por Eduardo Dantas
Solucionado o problema. (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo