Ir para conteúdo

Posts Recomendados

Olá pessoal.

Estou montando um OT com influencia em alguns MMOrpgs, com a tentativa de implantar um sistema de raças que virá - na falta de opção melhor - como um sistema de promotions.

 

A idéia básica é que depois de adquirir a primeira promotion (Master Sorc, Elder Druid, etc...) os jogadores possam escolher um caminho alternativo, onde cada jogador, independente de sua classe, possa escolher uma raça para adquirir.

 

Aqui vem o problema.

 

Configurei o vocation.xml para que existam 6 "raças" das quais cada jogador possa escolher.

Isso fez com que eu precisasse adicionar 24 novas vocations no arquivo. Das quais só funcionam as vocações até id=12

 

Segue o script com as 8 primeiras vocações adicionadas:

 

<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="30" manamultiplier="2.2" attackspeed="2000" 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="3.0" club="4.0" sword="4.0" axe="4.0" distance="4.0" shielding="3.0" 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="30" manamultiplier="2.2" attackspeed="1800" 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="3.0" club="3.6" sword="3.6" axe="3.6" distance="3.6" shielding="3.0" 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="15" gainmanaticks="4" gainmanaamount="20" manamultiplier="2.8" 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="2.4" club="2.4" sword="2.4" axe="2.4" distance="2.2" shielding="2.2" 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="20" gainmanaticks="6" gainmanaamount="10" manamultiplier="6.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="2.2" club="2.2" sword="2.2" axe="2.2" distance="2.8" shielding="2.2" 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="100" gainmanaticks="2" gainmanaamount="150" manamultiplier="2.2" attackspeed="2000" 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="3.0" club="4.0" sword="4.0" axe="4.0" distance="4.0" shielding="3.0" 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="100" gainmanaticks="2" gainmanaamount="150" manamultiplier="2.2" attackspeed="1800" 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="3.0" club="3.6" sword="3.6" axe="3.6" distance="3.6" shielding="3.0" 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="150" gainmanaticks="3" gainmanaamount="130" manamultiplier="2.8" attackspeed="1000" 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="2.4" club="2.4" sword="2.4" axe="2.4" distance="2.2" shielding="2.2" 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="170" gainmanaticks="4" gainmanaamount="80" manamultiplier="6.0" attackspeed="1000" 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="2.2" club="2.2" sword="2.2" axe="2.2" distance="2.8" shielding="2.2" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="9" name="Human Sorcerer" description="a human sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="10" manamultiplier="2.2" 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="3.0" club="4.0" sword="4.0" axe="4.0" distance="4.0" shielding="3.0" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="10" name="Human Druid" description="a human druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="10" manamultiplier="2.2" 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="Human Paladin" description="a human paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="10" gainmanaticks="3" gainmanaamount="10" manamultiplier="2.8" 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="Human Knight" description="a human knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="8" gainhpamount="10" gainmanaticks="4" gainmanaamount="10" manamultiplier="6.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>

<vocation id="13" name="Elf Sorcerer" description="an elf sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="10" manamultiplier="2.2" 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="3.0" club="4.0" sword="4.0" axe="4.0" distance="4.0" shielding="3.0" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="14" name="Elf Druid" description="an elf druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="30" manamultiplier="2.2" attackspeed="1800" soulmax="100" gainsoulticks="120" fromvoc="6">

<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="3.0" club="3.6" sword="3.6" axe="3.6" distance="3.6" shielding="3.0" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="15" name="Elf Paladin" description="an elf paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="10" gainmanaticks="3" gainmanaamount="10" manamultiplier="2.8" 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="16" name="Elf Knight" description="an elf knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="8" gainhpamount="10" gainmanaticks="4" gainmanaamount="10" manamultiplier="6.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>

 

 

Notem que tanto os human quanto os elf possuem o mesmo fromvoc, já que um master sorcerer - por exemplo - podem optar por virar tanto human quando elf.

 

 

O NPC responsável pela promotion está assim:

 

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

 

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

 

 

 

 

 

 

 

 

 

local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})

node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, text = 'Congratulations! You are now promoted.'})

node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})

 

 

 

 

local node2 = keywordHandler:addKeyword({'human way'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can halp you to search you way for 20k. Do you want me to help you?'})

node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20, level = 40, promotion = 2, text = 'Congratulations! You are in your way.'})

node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})npcHandler:addModule(FocusModule:new())

 

 

 

local node3 = keywordHandler:addKeyword({'elf way'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can halp you to search you way for 20k. Do you want me to help you?'})

node3:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20, level = 40, promotion = 3, text = 'Congratulations! You are in your way.'})

node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})npcHandler:addModule(FocusModule:new())

 

 

 

Tentei ver a lógica de que a cada 4 vocation id o sistema reconhece como uma promotion superior, então coloquei para o elf way o promotion = 3.

 

 

 

 

A Second promotion está funcionando tranquilamente, mas a "terceira" não funciona.

Quando falo com o npc ele tranforma normalmente mas a mensagem You see yourself. You are . aparece ao invés do nome da raça.

 

O erro que ocorre no server é esse:

 

[25/03/2010 15:10:13] [Warning - Vocations::getVocation] Vocation 4294967295 not found.

[25/03/2010 15:10:13] [Warning - Vocations::getVocation] Vocation 4294967295 not found.

[25/03/2010 15:10:13] [Warning - Vocations::getVocation] Vocation 4294967295 not found.

[25/03/2010 15:10:13] [Warning - Vocations::getVocation] Vocation 4294967295 not found.

 

 

Bem... pesso desculpa pelo tamanho do post, mas fiz o mais resumido que eu poderia fazer.

Se alguem puder me ajudar, serei grato ^^

 

A versão do tibia que uso é o 8.54

O map editor é: Remere's Map Editor 1.1.11

O OT server é: Alissow OT Sever, version 0.3.9.

 

Estou no aguardo. Vles o/

Editado por Vszalek
Link para o comentário
https://xtibia.com/forum/topic/129898-sistema-de-ra%C3%A7as-acima-de-2%C2%AA-promotion-error/
Compartilhar em outros sites

Amigo, ao invés de adicionar "Post quotado", use as tags code : [code.] e [/code.] (sem o . ), ou tambem as tags quote:

e [/quote.].

 

flw

o error pode ter ocorrido por causa da atribuição de promotion.

 

fromvoc="5"

 

ja existem outras vocações usando essa atribuição.

o error pode ter ocorrido por causa da atribuição de promotion.

 

fromvoc="5"

 

ja existem outras vocações usando essa atribuição.

 

Sim, isso resolveria o problema parcialmente, no entanto, faria com que somente alguém que já possue a raça human pudesse virar elf, o que não é a intenção.

Preciso de algo que resolva e ainda permita que um Master Sorcerer (por exemplo) possa optar por qualquer uma das raças.

 

Att, Szalek^^

×
×
  • Criar Novo...