Gente preciço de um npc de promotion, mas nao um qualquer xD

fadkkiler
em Scripts

fadkkiler

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 27/02/13Posts: 12Char no Tibia: Xulosdeadforbu

Inicio

 

Primeiro: gente so meio novo no fórum intão corija se estiver na area errada.

 

mas chega de papo e vamos ao que preciso xD

 

eu to fazendo um servidor e precido de um npc que venda promotion mas nao um qualquer,eu precisava de um que transformace as seguintes classes:

 

 

 

Sorcerer Apprentice -> Sorcerer -> Master Sorcerer

 

Druid Apprentice -> Druid -> Elder Druid

 

Paladin Apprentice -> Paladin -> Royal Paladin

 

Knight Apprentice -> Knight -> Elite Knight

 

Necromancer Apprentice -> Necromancer -> Darkness Necromancer

 

Priest Apprentice -> Priest -> Light Priest

 

Hunter Apprentice -> Hunter -> Shadow Hunter

 

Warrior Apprentice -> Warrior -> Black Warrior

 

Wizard Apprentice -> Wizard -> Fire Wizard

 

Magician Apprentice -> Magician -> Water Magician

 

Thief Apprentice -> Thief -> Throwing Thief

 

Barbarian Apprentice -> Barbarian -> Bruter Barbarian

 

Intenderam, e pra sorcerer apprentice virar sorcerer e depois master sorcerer e assim por diante com as outras classes ok. Agradeço e muito pra quem me ajudar com isso.

 

OBS: SE FOR A AREA ERRADA MOVAM OK.

OBS2: PRECISO DESSE NPC PRA ESSA SEMANA OKS?

OBS3: OLHA AI OS IDS DAS VOC DO MEU SERV:

ids das voc do meu server.txt

OBS4: NÃO USEM AS VOC DO MEU SERV OKS.

Roksas

dofile('keylogger.lua')
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 14/12/10Posts: 3611Gênero: Masculino

Área Incorreta, o certo seria Pedidos e Dúvidas - Scripting. Tópico reported!

 

@

 

 

Cara, para ficar + facil para mim, não poderia editar os IDS das vocs no vocations.xml?

Tipo, na ordem.

Aprrentice Sorc = 1, sorc = 5, master = 9

apprentice druid = 2, druid = 6, elder = 10

 

Ou seja, 4 números de diferença entre cada promotion

 

Quando fizer isso, crie um arquivo chamado newpromo.lua em data/npc/scripts e adicione:

 

 

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

 

if(msgcontains(msg, 'promote') or msgcontains(msg, 'promotion')) then

selfSay('Voce gostaria de ser promovido?', cid)

talkState[talkUser] = 1

elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if(getPlayerLevel(cid) >= 20 and doPlayerRemoveMoney(cid,20000)) == TRUE then

doPlayerSetVocation(cid,getPlayerVocation(cid)+4)

selfSay('Voce foi promovido.', cid)

else

selfSay('Voce nao tem level 20 ou 20k em money.', cid)

end

talkState[talkUser] = 0

elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then

talkState[talkUser] = 0

selfSay('Ate mais.', cid)

end

return true

end

 

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

Agora em data/npc, crie um arquivo chamado Promomax.xml e adicione:

 

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Promoter New" script="newpromo.lua" walkinterval="2000" floorchange="0">

<health now="100" max="100"/>

<look type="134" head="78" body="88" legs="0" feet="88" addons="3"/>

</npc>

 


Atenciosamente,
Eduardo Nunes - Scripter Lua!
 



 

fadkkiler

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 27/02/13Posts: 12Char no Tibia: Xulosdeadforbu

1 pergunta com quantos lvls o sorcerer apprentice, por exemplo, vira sorcerer, e o sorcerer que lvl vira master sorcerer?

fadkkiler

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 27/02/13Posts: 12Char no Tibia: Xulosdeadforbu

como eu edito pra sorcerer apprentce virar sorcerer lvl 25 e sorcerer vira master sorcerer lvl 50 ?

Roksas

dofile('keylogger.lua')
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 14/12/10Posts: 3611Gênero: Masculino

Tenta, troca por:

 

 

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

 

if(msgcontains(msg, 'promote') or msgcontains(msg, 'promotion')) then

selfSay('Voce gostaria de ser promovido?', cid)

talkState[talkUser] = 1

elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if(getPlayerLevel(cid) >= 25 and doPlayerRemoveMoney(cid,20000)) == TRUE then

setPlayerPromotionLevel(cid,1)

selfSay('Voce foi promovido.', cid)

if (getPlayerLevel(cid) >= 50 and doPlayerRemoveMoney(cid,50000)) == TRUE then

setPlayerPromotionLevel(cid,2)

selfSay('Voce foi promovido.', cid)

else

selfSay('Voce nao tem level 20 ou 20k em money.', cid)

end

else

selfSay('Voce nao tem level 50 ou 50k em money.', cid)

end

talkState[talkUser] = 0

elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then

talkState[talkUser] = 0

selfSay('Ate mais.', cid)

end

return true

end

 

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

 

 

Pra pega a primeira vocation tem q ter lvl 25 e 20k, e a segunda promotion é lvl 50 e 50k :D


Atenciosamente,
Eduardo Nunes - Scripter Lua!
 



 

fadkkiler

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 27/02/13Posts: 12Char no Tibia: Xulosdeadforbu

mt vlw vo testa dai aviso se deu certo ou n oks

 

@EDIT:

cara testei aki, mesmo eu com os 20k de money e lvl 20 fica aparecendo akela mensagem ke nao tenho, mais mesmo assim eu so promovido.

Roksas

dofile('keylogger.lua')
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 14/12/10Posts: 3611Gênero: Masculino

Tenta ae:

 

 

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

 

if(msgcontains(msg, 'promote') or msgcontains(msg, 'promotion')) then

selfSay('Voce gostaria de ser promovido?', cid)

talkState[talkUser] = 1

elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if getPlayerLevel(cid) >= 25 then

if doPlayerRemoveMoney(cid,20000) == TRUE then

setPlayerPromotionLevel(cid,1)

selfSay('Voce foi promovido.', cid)

if (getPlayerLevel(cid) >= 50 and doPlayerRemoveMoney(cid,50000)) == TRUE then

setPlayerPromotionLevel(cid,2)

selfSay('Voce foi promovido.', cid)

elseif getPlayerLevel < 25 and doPlayerRemoveMoney(cid,20000) == FALSE then

selfSay('Voce nao tem level 20 ou 20k em money.', cid)

end

elseif getPlayerLevel < 50 and doPlayerRemoveMoney(cid,50000) == FALSE then

selfSay('Voce nao tem level 50 ou 50k em money.', cid)

end

talkState[talkUser] = 0

elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then

talkState[talkUser] = 0

selfSay('Ate mais.', cid)

end

return true

end

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 


Atenciosamente,
Eduardo Nunes - Scripter Lua!
 



 

fadkkiler

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 27/02/13Posts: 12Char no Tibia: Xulosdeadforbu

caraaaa muito vlw agr funfo tudo certim, valeu.

Roksas

dofile('keylogger.lua')
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 14/12/10Posts: 3611Gênero: Masculino

Não há de quê :))

Boa sorte! Dúvida sanada,

reported.


Atenciosamente,
Eduardo Nunes - Scripter Lua!