Jump to content
  • 0

Idle Santuary Place


huntax

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   0
  • Joined:  12/11/12
  • Last Seen:  

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.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

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;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   0
  • Joined:  12/11/12
  • Last Seen:  

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!

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   0
  • Joined:  12/11/12
  • Last Seen:  

nvm my char was bugged for somereason but it works great ty!!

Edited by huntax
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...