Cara, o que você procura é um sistema de "second promotion", creio que já existam alguns tópicos a respeito. Mas tudo bem.
Tenta o seguinte:
ANTES DE QUALQUER MUDANÇA, FAÇA UM BACKUP COMPLETO.
1º No seu arquivo vocations.xml, adicione isso:
<vocation id="9" name="Epic Master Sorcerer" description="an epic master sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="50"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="10" name="Epic Elder Druid" description="an epic elder druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="6" lessloss="50"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="11" name="Epic Royal Paladin" description="an epic royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="10" gainmanaticks="3" gainmanaamount="10" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="50"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="12" name="Epic Elite Knight" description="an epic elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="8" gainhpamount="10" gainmanaticks="4" gainmanaamount="10" manamultiplier="3.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="50"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation>
2º procure por algo tipo 031-vocations.lua (no meu tá assim, no seu pode estar um pouco diferente), edite-o e deixe assim:
function isSorcerer(cid)
return isInArray({1, 5, 9}, getPlayerVocation(cid))
end
function isDruid(cid)
return isInArray({2, 6, 10}, getPlayerVocation(cid))
end
function isPaladin(cid)
return isInArray({3, 7, 11}, getPlayerVocation(cid))
end
function isKnight(cid)
return isInArray({4, 8, 12}, getPlayerVocation(cid))
end
function isRookie(cid)
return isInArray({0}, getPlayerVocation(cid))
end
3º nas pasta onde ficam os scripts dos npcs, crie um arquivo chamado promotion.lua (ou edite-o caso já exista):
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, 'first promot')) then
selfSay('You need to pay 20000 to be promoted. Is it ok for you?', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if(getPlayerPremiumDays(cid) >= 1) then
if getPlayerPromotionLevel(cid) < 1 then
if(doPlayerRemoveMoney(cid, 20000) == TRUE) then
setPlayerPromotionLevel(cid, 1)
doSendMagicEffect(getPlayerPosition(cid), 49)
selfSay('Congratulations! You are now promoted.', cid)
else
selfSay('Sorry, you dont have enough money.', cid)
end
else
selfSay('You alredy have a promotion.', cid)
end
else
selfSay('Sorry, you need to be premium.', cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'second promot')) then
selfSay('You need to pay 100000 to be promoted. Is it ok for you?', cid)
talkState[talkUser] = 2
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
if(getPlayerPremiumDays(cid) >= 1) then
if getPlayerPromotionLevel(cid) == 1 then
if(doPlayerRemoveMoney(cid, 100000) == TRUE) then
setPlayerPromotionLevel(cid, 2)
doSendMagicEffect(getPlayerPosition(cid), 49)
selfSay('Congratulations! You are now promoted.', cid)
else
selfSay('Sorry, you dont have enough money.', cid)
end
else
selfSay('You you dont have the first promotion.', cid)
end
else
selfSay('Sorry, you need to be premium.', cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1,2,3}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Ok then.', cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
4º agora o seu npc, nesse caso, ele tem a mesma aparecia do oraculo de rook (mude se quiser):
<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Oracle" script="data/npc/scripts/promotion.lua" walkinterval="0" floorchange="0">
<health now="100" max="100"/>
<look typeex="1448"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|! How can I {help} you?" />
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="help" />
<parameter key="keyword_reply1" value="I can give you the {first promotion} and {second promotion}." />
</parameters>
</npc>
Acho que é isso... não sei se vai funcionar, mas tenta ai ![]()
Quanto ao spell, acho que não deve ser difícil mas como nunca criei um, não vou poder ajudar mt ^^
Dá uma pesquisada na comu, deve ter tutorial explicando como criar novos spells
PS.: COMO QUE FAÇO PARA ADICIONAR AQUELE BOTÃO DE SPOILER???? NÃO CONSEGUI.





info
Grupo: Visconde
Registrado: 27/10/12
Posts: 323
Reputação: +46
Char no Tibia: Schznister Equilibriun
Falae Galerinha do XTibia, Queria pedir a vocês um NPC que promove player level 100+
e Uma spell.
Um player level 100 chega no npc e diz:
NPC Name: Moluf Master
Player: hi
NPC; Ola jovem aventureiro, gostaria de ser [promovido]
Player: yes
NPC: Você Foi Promovido, agora voce é um [Class nova que irei criar].
Obs: o NPC cobra 100k para promover os players.
<---------------------->
Queria pedir uma spell que bufa o player por 5 minutos, ela iria estourar aqueles effects do (Exevo Gran Mas Flam) em diferentes posições, almentaria as skills Axe, Club, Sword.