BlackTibia

No estás conectado. Conéctate o registrate

 » Open Tibia » Pedido de Scripts » 

Script de NPC para nuevas profesion

Script de NPC para nuevas profesion

#1 Script de NPC para nuevas profesion el Jue Feb 25, 2016 1:35 am

Josue2304


Aprendiz
Buenas, agregue nuevas profesiones a mi servidor recientemene, estuve buscando como hacer que un npc me las venda, pero ninguna me a servido. La transicion de las vocs seria asi:
Druid-Elder Druid-Mega Druid, por asi decirlo, lo que quiero es que el NPC pida cierta cantidad de x item para dar la profesion Mega Druid y que sea requesito tambien tener la voc previa, osea que pase de Elder a Mega y no directamente de Druid a mega.
Se los agradeceria mucho por aquello aca les dejo mi vocations.xml por si las dudas

Código:

<?xml version="1.0" encoding="UTF-8"?>
<vocations>
   <vocation id="0" clientId="0" name="Mega Noob" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="20" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no" droploot="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" clientId="3" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="800" 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" clientId="4" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="800" 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" clientId="2" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="8" gainhpamount="1" gainmanaticks="4" gainmanaamount="2" manamultiplier="1.4" attackspeed="800" 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" clientId="1" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="800" 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" clientId="3" name="Master Sorcerer" description="a master sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="600" 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" clientId="4" name="Elder Druid" description="an elder druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="600" 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" clientId="2" name="Royal Paladin" description="a royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="6" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.4" attackspeed="600" 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" clientId="1" name="Elite Knight" description="an elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="600" 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 id="9" clientId="1" name="Mega Sorcerer" description="an Mega Sorcerer" needpremium="0" gaincap="15" gainhp="10" gainmana="40" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="400" soulmax="400" gainsoulticks="15" fromvoc="5" lessloss="32">
      <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" clientId="1" name="Mega Druid" description="an Mega Druid" needpremium="0" gaincap="10" gainhp="10" gainmana="40" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="400" soulmax="400" gainsoulticks="15" fromvoc="6" lessloss="32">
      <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" clientId="1" name="Mega Paladin" description="an Mega Paladin" needpremium="0" gaincap="25" gainhp="15" gainmana="25" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.4" attackspeed="400" soulmax="400" gainsoulticks="15" fromvoc="7" lessloss="32">
      <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" clientId="1" name="Mega Knight" description="an Mega Knight" needpremium="0" gaincap="30" gainhp="25" gainmana="10" gainhpticks="4" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="400" soulmax="400" gainsoulticks="15" fromvoc="8" lessloss="32">
      <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>
</vocations>


Y este es el codigo que tengo del npc
Código:

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({'third promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Yo Puedo Darte La Segunda Promotion Por 200k Seguro Que La Quieres?.'})
    node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 1500, promotion = 2, text = 'Felicidades,Ahora Tienes La Segunda Promotion,Eres Mas Fuerte.'})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Deacuerdo,Vuelve Cuando Estes Listo.', reset = true})


npcHandler:addModule(FocusModule:new())

Ahi solo pide dinero, por lo que agradeceria bastante si le pueden poner lo de los items.

#2 Re: Script de NPC para nuevas profesion el Sáb Feb 27, 2016 8:28 pm

Josue2304


Aprendiz
@bump

#3 Re: Script de NPC para nuevas profesion el Dom Feb 28, 2016 8:33 pm

Josue2304


Aprendiz
Solucionado, por si lo quieren cerrar.

Contenido patrocinado


Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje [Página 1 de 1.]

Permisos de este foro:
No puedes responder a temas en este foro.

 

¿Quién está en línea?

En total hay 1 usuario en línea: 1 Registrado, 0 Ocultos y 0 Invitado

Usuarios navegando en este foro: vicente9908

Forum Statistics

Nuestros miembros han públicado un total de posts en temas.
Actualmente hay miembros registrados.
Démosle la bienvenida al miembro más reciente,
La mayor cantidad de usuarios en línea ha sido de .