Jump to content
  • 0

Idle Santuary Place


Question

Posted

So i have this script that i found somewhere in eathena. What it does it cast santuary and when you stand near the area of the npc it heals you. Does anyone know how to change it so if you stand there for a certain amount of time "say like 1 hour" It will give you a certain amount of exp or maybe an item perhaps.

This idea was from Forsaken Online

Here's the script if anyone wants to help me out changing it to how i mentioned.

5 answers to this question

Recommended Posts

Posted

I don't test it but

getmapxy return 0 if the search was successful so it must be

while( !getmapxy(.@map$,.@x,.@y,0) ) {

Be careful about multi loop. If player touch the NPC many time, it should have multi loop. You can do something like that to prevent it.

if( @idtime ) end;
while( !getmapxy(.@map$,.@x,.@y,0) ) {

Thank you for pointing out that mistakes /no1

OnTouch:
   if( @idtime ) end;
while (getmapxy(.@map$,.@x,.@y,0) == 0 ) {
  	 // check distance
	if (.npc_map$!=.@map$ || distance(.@x,.@y, .npc_x,.npc_y) > 2 ) {
		set @idtime,0;
		break;
	}
	set @idtime,@idtime+1;
	if (@idtime >=3600) { getexp 100,100;  set @idtime,0;  }
	sleep2 1000;


}
end;

Posted

try this

OnTouch:
   while (!getmapxy(.@map$,.@x,.@y,0) == 0 ) {
  	 // check distance
       if (.npc_map$!=.@map$ || distance(.@x,.@y, .npc_x,.npc_y) > 2 ) {
           set @idtime,0;
           break;
       }
       set @idtime,@idtime+1;
       if (@idtime >=3600) { getexp 100,100;  set @idtime,0;  }
       sleep2 1000;


   }
end;

  • Upvote 1
Posted

try this

OnTouch:
while (!getmapxy(.@map$,.@x,.@y,0) == 0 ) {
  	 // check distance
	if (.npc_map$!=.@map$ || distance(.@x,.@y, .npc_x,.npc_y) > 2 ) {
		set @idtime,0;
		break;
	}
	set @idtime,@idtime+1;
	if (@idtime >=3600) { getexp 100,100;  set @idtime,0;  }
	sleep2 1000;


}
end;

Thank you I'll try it out!

Posted

I don't test it but

getmapxy return 0 if the search was successful so it must be

while( !getmapxy(.@map$,.@x,.@y,0) ) {

Be careful about multi loop. If player touch the NPC many time, it should have multi loop. You can do something like that to prevent it.

if( @idtime ) end;
while( !getmapxy(.@map$,.@x,.@y,0) ) {

  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...