Ir para conteúdo

Posts Recomendados

Seria Assim

 

tenho meu npc de promotion mas quero q ele venda outra promotion(second promotion) uma terçeira vocação do player

um exemplo o cara fla promotion e vira supreme sorcerer, elder druid, elite knight, royal paladin...

 

e em seguida ele fla second promotion e se transforma em majesitc, wizard, gladiator, archer ( custara 1kk essa promotion)!!

 

vo posta o script do npc de promotion q eu uso!

 

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

npcHandler:addModule(FocusModule:new())

 

por favor!

 

fast plz...

 

FASSSSTTTT

Link para o comentário
https://xtibia.com/forum/topic/122810-adicionar-nova-promotion-no-npc/
Compartilhar em outros sites

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({'second promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 1000000 (1kk) gold coins. Do you want me to promote you?'})
node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 1000000, level = 20, promotion = 2, text = 'Congratulations! You are now special promoted.'})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})

npcHandler:addModule(FocusModule:new())

 

~~

 

Agora em vocations.xml você cria novas vocações com as ID's 9, 10, 11 e 12.

 

Ex.:

 

<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="90" manamultiplier="1.1" attackspeed="1500" soulmax="299" gainsoulticks="15" fromvoc="5" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="2.0" magDamage="1.2" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </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="90" manamultiplier="1.1" attackspeed="1500" soulmax="299" gainsoulticks="15" fromvoc="6" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="2.0" magDamage="1.2" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="1.8"/>
        <skill id="2" multiplier="1.8"/>
        <skill id="3" multiplier="1.8"/>
        <skill id="4" multiplier="1.8"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="11" name="Epic Royal Paladin" description="an epic royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="40" manamultiplier="1.4" attackspeed="1500" soulmax="299" gainsoulticks="15" fromvoc="7" lessloss="30">
        <formula meleeDamage="1.1" distDamage="1.1" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.2"/>
        <skill id="1" multiplier="1.2"/>
        <skill id="2" multiplier="1.2"/>
        <skill id="3" multiplier="1.2"/>
        <skill id="4" multiplier="1.1"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="12" name="Epic Elite Knight" description="an epic elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="8" gainhpamount="60" gainmanaticks="4" gainmanaamount="40" manamultiplier="3.0" attackspeed="1500" soulmax="299" gainsoulticks="15" fromvoc="8" lessloss="30">
        <formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>

Retirado do XvX Server 8.50.

Link para o comentário
https://xtibia.com/forum/topic/122810-adicionar-nova-promotion-no-npc/#findComment-810735
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...