eu sei
eu to perguntando se a promote é essa que eu falei
5,6,7 e 8 vao pra 9,10,11 e 12!
Por lorenzoh20, 30 de jul. de 2012 em Scripts
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

eu sei
eu to perguntando se a promote é essa que eu falei
5,6,7 e 8 vao pra 9,10,11 e 12!
info
Grupo: Campones
Registrado: 27/07/12
Posts: 31
Reputação: 0
Char no Tibia: [ADM] FODauM

sim.
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

npc
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
msg = string.lower(msg)
local config = {
price = 1000,
promo = 1, -- n mexa pq sao voc 5,6,7,8 aki
level = 100
}
if isInArray({"promote","second promote","promover"}, msg) then
selfSay('Você quer ser promovido por '..config.price..' gps? {yes} ', cid)
talkState[talkUser] = 1
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
if getPlayerPromotionLevel(cid) == config.promo then
if getPlayerLevel(cid) >= config.level then
if doPlayerRemoveMoney(cid,config.price) == TRUE then
local new = (getPlayerPromotionLevel(cid)+1)
setPlayerPromotionLevel(cid, new)
setPlayerStorageValue(cid, 878974, new)
selfSay('Parabens! Voce tem sua segunda promocao. ', cid)
talkState[talkUser] = 0
else
selfSay('Você não tem ' .. config.price .. ' gps para ser promovido', cid)
talkState[talkUser] = 0
end
else
selfSay('Desculpe, você precisa ter level '.. config.level .. ' ou mais para se promover!', cid)
talkState[talkUser] = 0
end
else
selfSay('Desculpe, mais você não possui a '..config.promo..'° promotion.', cid)
talkState[talkUser] = 0
end
elseif msg == "no" and talkState[talkUser] >= 1 then
selfSay("Then not", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
em data/creaturescript/script/login.lua adc isso antes do último return true
if getPlayerStorageValue(cid, 878974) ~= -1 then setPlayerPromotionLevel(cid, getPlayerStorageValue(cid, 887979)) end
info
Grupo: Campones
Registrado: 27/07/12
Posts: 31
Reputação: 0
Char no Tibia: [ADM] FODauM

vo tentar aki e te dar rep + mano
cara , o executavel do meu ot começou a falar assim
[Warning - Vocations::getvocation] Vocation 4294967295 not found.
sem parar ficu aparecendo sem parar
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

então remove os script q te passei e tenta assim:
npc
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
msg = string.lower(msg)
local price = 1
local vocations = {5,6,7,8}
local level = 100
if isInArray({"promote","second promote","promover"}, msg) then
selfSay('Você quer ser promovido por '..price..' gps? {yes} ', cid)
talkState[talkUser] = 1
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
if isInArray(vocations, getPlayerVocation(cid)) then
if getPlayerLevel(cid) >= level then
if doPlayerRemoveMoney(cid,price) == TRUE then
local new = (getPlayerVocation(cid)+4)
doPlayerSetVocation(cid, new)
setPlayerStorageValue(cid, 878975, new)
selfSay('Parabens! Voce tem sua segunda promocao. ', cid)
talkState[talkUser] = 0
else
selfSay('Você não tem ' .. price .. ' gps para ser promovido', cid)
talkState[talkUser] = 0
end
else
selfSay('Desculpe, você precisa ter level '.. level .. ' ou mais para se promover!', cid)
talkState[talkUser] = 0
end
else
selfSay('Desculpe, mais você não possui a primeira promotion.', cid)
talkState[talkUser] = 0
end
elseif msg == "no" and talkState[talkUser] >= 1 then
selfSay("Then not", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
em data/creaturescript/script/login.lua adc isso antes do último return true
if getPlayerStorageValue(cid, 878975) ~= -1 then doPlayerSetVocation(cid, getPlayerStorageValue(cid, 878975)) end
SE BUGAR DE NOVO É PQ O ERRO É EM VOCATIONS.XML
info
Grupo: Campones
Registrado: 27/07/12
Posts: 31
Reputação: 0
Char no Tibia: [ADM] FODauM

MANO, FUNCIONOU, VALEU! VOU TE DA REP+ , só q uma pergunta antes, voce saberia fazer ficar o nome da vocation vip no site,
exemplo: -Soul Druid-
pq mesmo sendo promotion 2 , está elder druid
info
Grupo: Campones
Registrado: 27/07/12
Posts: 31
Reputação: 0
Char no Tibia: [ADM] FODauM
@Vodkart - Seguinte maninho, simplesmente quando o player paga a promotion, funciona de boa, dae quando ele desloga ele volta a ser master sorcerer, elder druid, etc
@tchubaka
vou tentar isso mais provavelmente não vai dar certo, não deu antes.