Ir para conteúdo
  • 0

Vocação


lucasagas

Pergunta

Meu problema é que toda vez quando eu o player consegue uma vocação através do npc, quando ele desloga volta a vocação anterior. Não sei o que eu faço, me ajudem o mais rapido possivel.

Minha vocation.xml está ae \/

 

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

- <vocations>

- <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">

<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="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="100" manamultiplier="1.1" attackspeed="1000" soulmax="100" gainsoulticks="120" fromvoc="1">

<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="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="100" manamultiplier="1.1" attackspeed="1000" soulmax="100" gainsoulticks="120" fromvoc="2">

<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="3" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="4" gainhpamount="5" gainmanaticks="4" gainmanaamount="100" manamultiplier="1.4" attackspeed="1000" soulmax="100" gainsoulticks="120" fromvoc="3">

<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="4" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="5" gainmanaticks="6" gainmanaamount="100" manamultiplier="3.0" attackspeed="1000" soulmax="100" gainsoulticks="120" fromvoc="4">

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

- <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="200" manamultiplier="1.1" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30">

<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="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="200" manamultiplier="1.1" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30">

<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="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="10" gainmanaticks="3" gainmanaamount="200" manamultiplier="1.4" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">

<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="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="10" gainmanaticks="4" gainmanaamount="200" manamultiplier="3.0" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">

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

- <vocation id="9" name="Vip Sorcerer" description="an Vip sorcerer" needpremium="1" 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="Vip Druid" description="an Vip druid" needpremium="1" 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="Vip Paladin" description="an Vip paladin" needpremium="1" 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="Vip Knight" description="an Vip knight" needpremium="1" 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>

</vocations>

Editado por PsyReboleira
Link para o comentário
Compartilhar em outros sites

8 respostass a esta questão

Posts Recomendados

  • 0

Cara, seria legal você arrumar o seu tópico. Creio que assim não irão aprovar o seu tutorial.

Não consegui entender muito, por falta de organização. Mas também não sei muito de Script.

Abraços.

Link para o comentário
Compartilhar em outros sites

  • 0

Posta o script do 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

 

 

local a = {

[5] = {new_voc = 9,need_level = true,level = 60,cobrar = true,price = 100000,need_premium = true},

[6] = {new_voc = 10,need_level = true,level = 60,cobrar = true,price = 100000,need_premium = true},

[7] = {new_voc = 11,need_level = true,level = 60,cobrar = true,price = 100000,need_premium = true},

[8] = {new_voc = 12,need_level = true,level = 60,cobrar = true,price = 100000,need_premium = true}

}

local b = a[getPlayerVocation(cid)]

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

if(not b) then

selfSay('Você não tem a second promote, então não poderá ser promovido!.', cid)

talkState[talkUser] = 0

else

selfSay('Deseja virar ' .. getVocationInfo(b.new_voc).name .. ' por '..b.price..' gold coins? {yes}', cid)

talkState[talkUser] = 1

end

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

if b.need_premium == true and not isPremium(cid) then

selfSay('Você precisa ser Premium para ser promovido!.', cid)

talkState[talkUser] = 0

elseif b.need_level == true and getPlayerLevel(cid) < b.level then

selfSay('Você deve ter pelo menos level '.. b.level ..' para ser promovido!.', cid)

talkState[talkUser] = 0

elseif b.cobrar == true and doPlayerRemoveMoney(cid, b.price) == TRUE then

doPlayerSetVocation(cid,b.new_voc)

selfSay('Você foi promovido com sucesso.', cid)

talkState[talkUser] = 0

else

selfSay('Você não tem '..b.price..' gold coins Suficientes.', cid)

doSendMagicEffect(getPlayerPosition(cid), 2)

end

end

return TRUE

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Link para o comentário
Compartilhar em outros sites

  • 0

funfo akee

 

Aqui continua voltando, vou dar o exemplo:

 

Sorcerer - Master Sorcerer - Vip Sorcerer

 

de Sorcerer para Master Sorcerer tudo bem.. agora de Master Sorcerer viro Vip Sorcerer, quando deslogo e entro novamente, ele volta para Master Sorcerer...

 

Mas valeu o post..

Link para o comentário
Compartilhar em outros sites

  • 0

Posso estar errado, mas eu estava com o mesmo problema, eu apenas substitui a seguinte função do NPC:

 

doPlayerSetVocation(cid,b.new_voc)



 

Por

 

doPlayerSetPromotionLevel(cid, 2)



 

Ahh! Matou a charada! Consegui, não volta mais!

Valeu cara, ja estava desistindo!

Editado por PsyReboleira
Link para o comentário
Compartilhar em outros sites

  • 0

Eu também fiquei muito tempo quebrando a cabeça com isso, a sorte que um grande membro da comunidade XTibia me ajudou, acho que com a evolução dos servidores essa função não é mais usada,

(doPlayerSetVocation).

 

Obrigado, sem mais.

Editado por XxXHiagoXxX
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...