lucasd10 0 Postado Julho 10, 2011 Share Postado Julho 10, 2011 eu ja vi uns post que comenta sobre isso so que nao deu em nada ... , olha ae como eu fiz... 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 second promot you for 200000 gold coins. Do you want me to epicize you?'}) node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) local node3 = keywordHandler:addKeyword({'third promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can third promot you for 200000 gold coins. Do you want me to epicize you?'}) node3:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 500, promotion = 3, text = 'Congratulations! You are now epicized.'}) node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) npcHandler:addModule(FocusModule:new()) nao deu em nada =/ ajuda aee =) Link para o comentário Compartilhar em outros sites More sharing options...
Leoprotons 35 Postado Julho 12, 2011 Share Postado Julho 12, 2011 Vou responder suas pergunta como se voce nao tivese pesquisado nada blz?! Primeiro abre o arquivo vocations.xml que se encontra na pasta data/xml/ do ser server Vai ter varias vocaçoes voce podera editala ou podera adicionar uma. Para editar e so trocar os dados para adicionar aqui vai um pequeno tuto: <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="50" gainmanaticks="3" gainmanaamount="50" manamultiplier="1.1" attackspeed="400" 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" 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> id = não deve haver nenhuma igual, tente seguir a sequencia para não se perder. name = nome da nova vocação. description = quando der look aparecera esse nome, e caso acc manager também. needpremium = se precisa de premmium para ter essa vocação (0 = não 1 = sim) gaincap = o tanto de cap que vai ganhar quando upar gainhp = o tanto de vida que vai ganhar quando upar gainmana = o tanto de mana que vai ganhar quando upar gainhpticks = o tanto de segundos que demora pra subir a vida gainhpamount = o tanto de vida que vai ganhar a cada ( no nosso exemplo 6 ) segundos gainmanaticks = o tanto de segundos que demora pra subir a mana gainmanaamount = o tanto de mana que vai ganhar a cada ( no nosso exemplo 3 ) segundos manamultiplier = quanto ml vai demorar pra subir, quanto menor mais rápido attackspeed = velocidade do ataque de wands e weapons (quanto menor mais rápido) soulmax = o maximo de soul gainsoulticks = o tanto de segundos que vai demorar pra subir o soul fromvoc = como ele será reconhecido nos scripts ( bote igual o id ) Formulas: meleeDamage = quanto hita com weapons ( exceto wands e rods ) distDamage = quanto hita com ataques a distancia wandDamage = quando hita com wand magDamage = quando hita com magias magHealingDamage = quanto heala com magias de cura, ( tanto exura como exura sio ) defense = quanto defende com escudos armor = quanto defende com armaduras Skill Ids: (0) Fist (1) Club (2) Sword (3) Axe (4) Distance (5) Shield (6) Fishing. Dai sim vem a parte do script que voce citou, pois bem e um npc e voçe ira adicionalo em data/npc salve isto como Promotion.xml <?xml version="1.0" encoding="UTF-8"?><npc name="Promotion Seller" script="data/npc/scripts/promotion.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="79" body="86" legs="114" feet="0" addons="3"/> </npc> e salve isto como promotion.lua e cole dentro de data/npc/script/ 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 second promot you for 200000 gold coins. Do you want me to epicize you?'}) node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) local node3 = keywordHandler:addKeyword({'third promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can third promot you for 200000 gold coins. Do you want me to epicize you?'}) node3:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 500, promotion = 3, text = 'Congratulations! You are now epicized.'}) node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) npcHandler:addModule(FocusModule:new()) Espero que tenha solucionado a sua duvida. Link para o comentário Compartilhar em outros sites More sharing options...
elitevini 1 Postado Julho 12, 2011 Share Postado Julho 12, 2011 (editado) Vou responder suas pergunta como se voce nao tivese pesquisado nada blz?! Primeiro abre o arquivo vocations.xml que se encontra na pasta data/xml/ do ser server Vai ter varias vocaçoes voce podera editala ou podera adicionar uma. Para editar e so trocar os dados para adicionar aqui vai um pequeno tuto: <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="50" gainmanaticks="3" gainmanaamount="50" manamultiplier="1.1" attackspeed="400" 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" 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> id = não deve haver nenhuma igual, tente seguir a sequencia para não se perder. name = nome da nova vocação. description = quando der look aparecera esse nome, e caso acc manager também. needpremium = se precisa de premmium para ter essa vocação (0 = não 1 = sim) gaincap = o tanto de cap que vai ganhar quando upar gainhp = o tanto de vida que vai ganhar quando upar gainmana = o tanto de mana que vai ganhar quando upar gainhpticks = o tanto de segundos que demora pra subir a vida gainhpamount = o tanto de vida que vai ganhar a cada ( no nosso exemplo 6 ) segundos gainmanaticks = o tanto de segundos que demora pra subir a mana gainmanaamount = o tanto de mana que vai ganhar a cada ( no nosso exemplo 3 ) segundos manamultiplier = quanto ml vai demorar pra subir, quanto menor mais rápido attackspeed = velocidade do ataque de wands e weapons (quanto menor mais rápido) soulmax = o maximo de soul gainsoulticks = o tanto de segundos que vai demorar pra subir o soul fromvoc = como ele será reconhecido nos scripts ( bote igual o id ) Formulas: meleeDamage = quanto hita com weapons ( exceto wands e rods ) distDamage = quanto hita com ataques a distancia wandDamage = quando hita com wand magDamage = quando hita com magias magHealingDamage = quanto heala com magias de cura, ( tanto exura como exura sio ) defense = quanto defende com escudos armor = quanto defende com armaduras Skill Ids: (0) Fist (1) Club (2) Sword (3) Axe (4) Distance (5) Shield (6) Fishing. Dai sim vem a parte do script que voce citou, pois bem e um npc e voçe ira adicionalo em data/npc salve isto como Promotion.xml <?xml version="1.0" encoding="UTF-8"?><npc name="Promotion Seller" script="data/npc/scripts/promotion.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="79" body="86" legs="114" feet="0" addons="3"/> </npc> e salve isto como promotion.lua e cole dentro de data/npc/script/ 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 second promot you for 200000 gold coins. Do you want me to epicize you?'}) node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) local node3 = keywordHandler:addKeyword({'third promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can third promot you for 200000 gold coins. Do you want me to epicize you?'}) node3:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 500, promotion = 3, text = 'Congratulations! You are now epicized.'}) node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) npcHandler:addModule(FocusModule:new()) Espero que tenha solucionado a sua duvida. Emtão kra não ta dando aqui tipow eu falo com o npc e ele só da a 1 promotion tipo de druid para elder druid de knight para elite knight mais ele não ta dando de elite knight para Epic elite Knight aqui meu vocation.XML <?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="10" gainmanaticks="6" gainmanaamount="10" manamultiplier="4.0" attackspeed="1000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="2.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="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="15" gainmanaticks="2.5" gainmanaamount="45" manamultiplier="1.1" 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" 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="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="15" gainmanaticks="2.5" gainmanaamount="45" manamultiplier="1.1" attackspeed="2000" 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" 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="3" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="2.5" gainhpamount="35" gainmanaticks="3" gainmanaamount="35" manamultiplier="1.4" attackspeed="2000" 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" 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="4" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="25" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="4"> <formula meleeDamage="1.1" distDamage="1.0" wandDamage="1.0" magDamage="1.0" 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> <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="3" gainhpamount="30" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" 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" 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="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="3" gainhpamount="30" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" attackspeed="2000" 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" 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="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="2.5" gainhpamount="40" gainmanaticks="2.5" gainmanaamount="50" manamultiplier="1.4" attackspeed="2000" 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" 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="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="50" gainmanaticks="3" gainmanaamount="40" manamultiplier="3.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30"> <formula meleeDamage="1.1" distDamage="1.0" wandDamage="1.0" magDamage="1.0" 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> <vocation id="9" name="Epic Master Sorcerer" description="an master sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="40" gainmanaticks="2" gainmanaamount="70" manamultiplier="1.1" attackspeed="1900" 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 elder druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="40" gainmanaticks="2" gainmanaamount="70" manamultiplier="1.1" attackspeed="1900" 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 royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="60" gainmanaticks="3" gainmanaamount="60" manamultiplier="1.4" attackspeed="1900" 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 elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="8" gainhpamount="70" gainmanaticks="4" gainmanaamount="50" manamultiplier="3.0" attackspeed="1900" 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> </vocations> Editado Julho 12, 2011 por ManoPergunta Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados