Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   Help me - AI for teleport a player (https://postpacific.loc-online.com/showthread.php?t=4616)

nowak2006 30.05.2006 02:08

Help me - AI for teleport a player
 
Today i started to learn something about ai. I will try to implement the scrolls that teleports players to specific citys, like scroll_of_scape_aden. The idea is summon an invisible npc that will teleports the player who summon it.

Somebody help me to codify using NASC? I know that i need to use the function InstantTeleport (CSharedCreatureData* c, int x, int y, int z), but i dont know how to get the first parameter.

Code:

class InstantTeleporterTest : default_npc
{
 parameter:
 int port_x = 1234;
 int port_y = 1234;
 int port_z = 1234;

 handler:
  EventHandler CREATED(myself)  {
        InstantTeleport(???, port_x, port_y, port_z);
  }
}

EDITED:
Sorry.. but i found one post about this:
https://postpacific.loc-online.com/f...pic.php?t=3333


Thanks!

barabashka 30.05.2006 09:19

Maybe this help you
 
Code:

class summon_tp_talking : default_npc
{
parameter:
  int x = -83964;
  int y = 242680;
  int z = -3700;
     
handler:
  EventHandler CREATED()
  {
      AddTimerEx(39999, 100);
      InstantTeleport(myself.master, x, y, z);
  }
  EventHandler TIMER_FIRED_EX(timer_id)
  {
    if (timer_id == 39999)
      Despawn();
  }
}



All times are GMT. The time now is 15:48.