Á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>






info
Grupo: Campones
Registrado: 27/02/13
Posts: 12
Reputação: 0
Char 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.txtOBS4: NÃO USEM AS VOC DO MEU SERV OKS.