Jump to content
  • 0

Npc can't auto trigger not moving player


bluesky

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   2
  • Joined:  04/26/17
  • Last Seen:  

I know auto trigger can't trigger not moving player

But that's OK on not moving npc.

 

Now I want use a moving npc to auto trigger player.

like this:

Quote

job_sword1,117,238,1    script    electricity    1002,1,1,{
     warp "prontera",155,187;
     end;
OnInit:
    npcspeed 60;
    npcwalkto 130,250;
    end;
}

 

But player not moving will not warp to prontera.

I think maybe can use

0.for loop

1.getmapxy  => to get npc position

2.getareausers => to get npc position area users, if getareauser >0   areawarp

3. sleep 100

But if I had 50+ moving npc, maybe that will Consume a lot of CPU resources?

Have other better method to auto trigger not moving player?

Thank you!!

Edited by bluesky
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   22
  • Joined:  10/24/14
  • Last Seen:  

I'm not quite sure what you mean, like this perhaps? :huh:

job_sword1,117,238,1    script    electricity    1002,1,1,{
OnTouch: // Player has entered NPC's area
  warp "prontera",155,187;
  end;
OnInit:
  npcspeed 60;
  npcwalkto 130,250;
  end;
} 

You can increase the NPC's area of effect: 1002,2,2,{

But i'm not sure if OnTouch event will work on moving NPC's.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   2
  • Joined:  04/26/17
  • Last Seen:  

12 hours ago, Sehrentos said:

I'm not quite sure what you mean, like this perhaps? :huh:


job_sword1,117,238,1    script    electricity    1002,1,1,{
OnTouch: // Player has entered NPC's area
  warp "prontera",155,187;
  end;
OnInit:
  npcspeed 60;
  npcwalkto 130,250;
  end;
} 

You can increase the NPC's area of effect: 1002,2,2,{

But i'm not sure if OnTouch event will work on moving NPC's.

 

if NPC's moving to player around and player not moving,then will not  trigger OnTouch

Now I used

for {

getmapxy

getareausers ,

}

it's work.

Thank you:D

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
Answer this question...

×   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...