Aew galera
primeiramente quero falar que num lindo dia tive a ideia de escolher as promoções xD
agora vc pode escolher sim!!
knight vira master sorcerer??
tbm não xD
a unica dificuldade é que vc tera q criar algumas classes extras(normalmente 4,depende quantas classes vc quer fazer)
bem agora a script essa e uma script de npc portanto data/npc/scripts
alem disso para vc fazer ela funcionar no npc
tera q ter isso dentro dele
<?xml version="1.0" encoding="UTF-8"?><npc name="Addon Seller" script="data/npc/scripts/promotsadvanced.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="134" head="78" body="88" legs="0" feet="88" addons="3"/>
</npc>
bem copia ali na pasta citada assima um arquivo .lua renomeio para:promotsadvanced
e cole isso \/
(Feita TOTALMENTE POR MIN)
-- MAKE by ViniTheCrazzylocal focus = 0
local talk_start = 0
local target = 0
local days = 0
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') or msgcontains(msg, 'oi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Ola ' .. creatureGetName(cid) .. '! Eu vendo premium e promotions(promotion1 e 2 mais infos no quadro ao lado).')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') or msgcontains(msg, 'oi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Desculpe, ' .. creatureGetName(cid) .. '! Falarei com voce em alguns instantes.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'promotion1') or msgcontains(msg, 'promote1') then
if getPlayerVocation(cid) > 3 then
selfSay('Desculpe, voce ja esta promovido, procure o principe do deserto para ser promovido novamente.')
talk_state = 0
elseif getPlayerLevel(cid) < 30 then
selfSay('Voce precisa ter no minimo level 30...')
talk_state = 0
elseif getPlayerPremiumDays(cid) <1 then
selfSay('Compre uma premium antes, depois eu lhe promoverei.')
talk_state = 0
else
selfSay('Voce quer ser promovido por 20k?')
talk_state = 1
end
elseif msgcontains(msg, 'promotion2') or msgcontains(msg, 'promote2') then
if getPlayerVocation(cid) > 3 then
selfSay('Desculpe, voce ja esta promovido, procure o principe do deserto para ser promovido novamente.')
talk_state = 0
elseif getPlayerLevel(cid) < 30 then
selfSay('Voce precisa ter no minimo level 30...')
talk_state = 0
elseif getPlayerPremiumDays(cid) <1 then
selfSay('Compre uma premium antes, depois eu lhe promoverei.')
talk_state = 0
else
selfSay('Voce quer ser promovido por 20k?')
talk_state = 15
end
elseif msgcontains(msg, 'premium') or msgcontains(msg, 'premmy') then
selfSay('Voce quer comprar 30 dias de premium por 10k?')
talk_state = 2
elseif talk_state == 1 then
if msgcontains(msg, 'yes') then
if pay(cid,20000) then
doPlayerSetVocation(cid, getPlayerVocation(cid)+3)
selfSay('Voce foi promovido!')
else
selfSay('Voce nao tem dinheiro suficiente.')
end
end
talk_state = 0
elseif talk_state == 15 then
if msgcontains(msg, 'yes') then
if pay(cid,20000) then
doPlayerSetVocation(cid, getPlayerVocation(cid)+6)
selfSay('Voce foi promovido!')
else
selfSay('Voce nao tem dinheiro suficiente.')
end
end
talk_state = 0
elseif talk_state == 2 then
if msgcontains(msg, 'yes') then
if pay(cid,10000) then
doPlayerAddPremiumDays(cid, 30)
selfSay('Voce recebeu 30 dias de premium!')
else
selfSay('Sorry, you do not have enough money.')
end
end
talk_state = 0
elseif msgcontains(msg, 'bye') or msgcontains(msg, 'tchao') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 10 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
end
agora para seu melhor entendimento \/
vermelho aki e o preço
verde aki vc coloca o numero de classes q vc tem
laranja aki vc coloca o dobro de classes q vc tem
azul aki e o que tenque fala para a promoção 1(se muda um muda o outro tbm)
rosa aki e oque tenque falar para o promoção 2(se muda um muda o outro tbm)
roxo aki e o level
salmao e colo a ultima classe sem promoção ex com as classes normais seria o knight id 4
musgo e a mensagem q aparece ao falar com o npc
agora q ja expliquei isso tudo seguinte
voce pode editar essas coisas lembrando
tenque fazer as classes iniciais com os ids mais baixos olhe o ex:\/
Classe----|ID|Promoção1--|ID|Promoção2|ID|
Guerreiro-|1-|Cavaleiro----|4-|Ninja--------|7-|
Lansador--|2-|Bestiador----|5-|Arqueiro----|8-|
Mago------|3-|Mago Branco|6-|Mago Negro-|9-|
lembrando tenque fazer assim para funcionar o verde tenque ser 3 nesse ex por ter 3 basses classe o laranja nesse ex ficara 6 por ser o drobro das classes basses e o salmão 3 pois assim so classe 1,2 e 3 podem podem ser promividos
se tiver 4 classes basicas vc tenque por 4 no verde e 8 no laranja e 4 no salmao pois so as 4 classes basses poderão ser promovidas xD
e assim termino meu tutorial
de como inovar o jeito das classes no ot
espero q gostei e desculpa se cometi algum erro minha intesão e soh ajudar
e trazer novidades para o xtibia