Jump to content

[Duda] Respawn de un NPC


Nanashi

Recommended Posts


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  59
  • Reputation:   19
  • Joined:  01/03/13
  • Last Seen:  

Hola a todos,

 

tengo entendido que es posible hacer que un script, después de realizar su función, este desaparezca y aparezca en otro lugar del mapa aleatorio (algo así como el respawn de los monstruos que al morir aparece otro cada x tiempo).

 

Mi idea es muy parecida a un sistema de minería pero con funciones diferentes. ¿Alguien podría echarme una mano con el código? He estado buscando pero no lo encuentro. Gracias de antemano.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  62
  • Reputation:   1
  • Joined:  10/06/12
  • Last Seen:  

Aqui un ejemplo como deberia ser.

 

-    script    Quest_Respawn    -1,{
    end;
OnInit:
    disablenpc "Respawn#AH_1";
    disablenpc "Respawn#AH_2";
    disablenpc "Respawn#AH_3";
    disablenpc "Respawn#AH_4";
    disablenpc "Respawn#AH_5";
    end;
    
OnClock1600:
    enablenpc "Respawn#AH_5";
    end;
OnClock1700:
    disablenpc "Respawn#AH_5";
    enablenpc "Respawn#AH_4";
    end;
OnClock1800:
    disablenpc "Respawn#AH_4";
    enablenpc "Respawn#AH_3";
    end;
OnClock1900:
    disablenpc "Respawn#AH_3";
    enablenpc "Respawn#AH_2";
    end;
OnClock2000:
    disablenpc "Respawn#AH_2";
    enablenpc "Respawn#AH_1";
    end;
OnClock2100:
    disablenpc "Respawn#AH_1";
    end;
}

 

 

Mas dudas te respondo por aquí.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  59
  • Reputation:   19
  • Joined:  01/03/13
  • Last Seen:  

Ya pero eso lo q hace es activar y desactivar los script al pasar cierto tiempo. Yo lo que busco es lo siguiente, por ejemplo imagina que te encuentras un npc hablas con el y al terminar te da cierto item y desparece pero pasados x minutos aparece otro de nuevo en otro sitio distinto. ¿Entiendes a qué me refiero?

Edited by Nanashi
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  182
  • Reputation:   36
  • Joined:  01/26/12
  • Last Seen:  

Hideki tiene razón: para mover un NPC por un mapa, lo que se suele hacer es en verdad crear varias instancias del mismo y para simular su movimiento lo que se hace es simplemente activar una copia y desactivar la otra rápidamente.

 

Aún así, si realmente quieres mover el NPC a toda costa, puedes probar los siguientes script commands:

 

*npcspeed <speed value>;*npcwalkto <x>,<y>;*npcstop;These commands will make the NPC object in question move around the map. As they currently are, they are a bit buggy and are not useful for much more than making an NPC move randomly around the map.'npcspeed' will set the NPCs walking speed to a specified value. As in the @speed GM command, 200 is the slowest possible speed while 0 is the fastest possible (instant motion). 100 is the default character walking speed.'npcwalkto' will start the NPC sprite moving towards the specified coordinates on the same map it is currently on. The script proceeds immediately after theNPC begins moving.'npcstop' will stop the motion.While in transit, the NPC will be clickable, but invoking it will cause it to stop moving, which will make its coordinates different from what the client computed based on the speed and motion coordinates. The effect is rather unnerving.Only a few NPC sprites have walking animations, and those that do, do not get the animation invoked when moving the NPC, due to the problem in the NPC walking code, which looks a bit silly. You might have better success by defining a job-sprite based sprite id in 'db/mob_avail.txt' with this.---------------------------------------*movenpc "<NPC name>",<x>,<y>{,<dir>};This command looks like the NPCWalkToxy function,but is a little different.While NPCWalkToXY just makes the NPC 'walk' to the coordinates given (which sometimes gives problems if the path isn't a straight line without objects), this command just moves the NPC. It basically warps out and in on the current and given spot. Direction can be used to change the NPC's facing direction.Example:// This will move Bugga from to the coordinates 100,20 (if those coordinates are legit).    moveNPC "Bugga",100,20;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...