Jump to content
  • 0

(Fixed)NPC will only appear every weekends.


louigui0224

Question


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  139
  • Reputation:   0
  • Joined:  06/22/14
  • Last Seen:  

I\m trying to edit the npc but i dont know how to put the schedule to this npc...i want this npc to show every weekends..by 11am-1pm and after 1pm it will hide and will show again by 6pm-8pm sat sun...is that possible?

//===== eAthena Script =======================================
//= Quests: Archangel Wings, Archdemon Wings, Deviling Wings, Little Angel Wings
//============================================================

prontera,156,165,4	script	Coupon Farmer	436,{

 mes "[Quest]";
 mes callfunc("F_Hi");
 mes "I can warp you to the jungle coupon.";
 next;
 menu "Yes, Warp me",-,"Leave",M_EXIT;

 mes "[Quest]";
 mes "Okay all i need to have is just";
 next;
 mes "[Quest]";
 mes "1 million of zeny";
 next;
 mes "[Quest]";
 mes "Do you have all the item?";
 next;
 menu "Yes",-,"No",M_EXIT;
 
 if (Zeny < 1000000) GOTO L_NOITEM;
 set Zeny,Zeny-1000000;
 warp "moc_ruins" ,0,0;
 mes "[Quest]";
 mes "Thank you very much!";
 mes callfunc("F_Bye");
 close;

L_NOITEM:
 mes "[Quest]";
 mes "Sorry you don't have zeny.";
 emotion e_sry;
 close;

M_EXIT:
 mes "[Quest]";
 mes callfunc("F_Bye");
 close;

	OnInit:
		waitingroom "Donation Farmzone 2 Hours",0;
		end;
}

 

Edited by louigui0224
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  139
  • Reputation:   0
  • Joined:  06/22/14
  • Last Seen:  

where should i add this sir??inside the script(in which part should i add this code?) or do i need to create another .txt and load it?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  139
  • Reputation:   0
  • Joined:  06/22/14
  • Last Seen:  

already did it but its not working.here is the script.

prontera,156,165,4	script	Coupon Farmer	436,{

OnHour11:
OnHour18:
If(gettime(DT_DAYOFWEEK) == SATURDAY || gettime(DT_DAYOFWEEK) == SUNDAY) enablenpc "Coupon Farmer"; end;
	 
OnHour12:
OnHour19:
If(gettime(DT_DAYOFWEEK) == SATURDAY || gettime(DT_DAYOFWEEK) == SUNDAY) disablenpc "Coupon Farmer"; end;

 mes "[Quest]";
 mes callfunc("F_Hi");
 mes "I can warp you to the jungle coupon.";
 next;
 menu "Yes, Warp me",-,"Leave",M_EXIT;

 mes "[Quest]";
 mes "Okay all i need to have is just";
 next;
 mes "[Quest]";
 mes "1 million of zeny";
 next;
 mes "[Quest]";
 mes "Do you have all the item?";
 next;
 menu "Yes",-,"No",M_EXIT;
 
 if (Zeny < 1000000) GOTO L_NOITEM;
 set Zeny,Zeny-1000000;
 warp "moc_ruins" ,0,0;
 mes "[Quest]";
 mes "Thank you very much!";
 mes callfunc("F_Bye");
 close;

L_NOITEM:
 mes "[Quest]";
 mes "Sorry you don't have zeny.";
 emotion e_sry;
 close;

M_EXIT:
 mes "[Quest]";
 mes callfunc("F_Bye");
 close;

	OnInit:
		waitingroom "Donation Farmzone 2 Hours",0;
		end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  


	OnInit:
		waitingroom "Donation Farmzone 2 Hours",0;
		end;

change to

	OnInit:
		waitingroom "Donation Farmzone 2 Hours",0;
	OnClock0000:
		if ( gettime(DT_DAYOFWEEK) == SATURDAY || gettime(DT_DAYOFWEEK) == SUNDAY ) {
			enablenpc strnpcinfo(3);
		}
		else {
			disablenpc strnpcinfo(3);
		}
		end;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  139
  • Reputation:   0
  • Joined:  06/22/14
  • Last Seen:  

but there is no time to the one that you edit sir @Emistry

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

	OnInit:
		waitingroom "Donation Farmzone 2 Hours",0;
	OnMinute00:
		if (( gettime(DT_DAYOFWEEK) == SATURDAY || gettime(DT_DAYOFWEEK) == SUNDAY ) && ( gettime(DT_HOUR) >= 18 && gettime(DT_HOUR) < 20 )) {
			enablenpc strnpcinfo(3);
		}
		else {
			disablenpc strnpcinfo(3);
		}
		end;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  139
  • Reputation:   0
  • Joined:  06/22/14
  • Last Seen:  

I dont understand how to edit those codes you sent..but actually my plan for the time is going to be 11am to 12pm and 6pm-8pm sat sunday.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

	OnInit:
		waitingroom "Donation Farmzone 2 Hours",0;
	OnMinute00:
		if (( gettime(DT_DAYOFWEEK) == SATURDAY || gettime(DT_DAYOFWEEK) == SUNDAY ) 
			&& (( gettime(DT_HOUR) >= 11 && gettime(DT_HOUR) < 13 )
				|| ( gettime(DT_HOUR) >= 18 && gettime(DT_HOUR) < 20 ))
		) {
			enablenpc strnpcinfo(3);
		}
		else {
			disablenpc strnpcinfo(3);
		}
		end;

sample has been shown previously, you should actually try it out and adjust it yourself too.... shouldn't really expecting a 100% spoon-feed everytime lol

 

Weekday restriction ...

if ( gettime(DT_DAYOFWEEK) == SATURDAY || gettime(DT_DAYOFWEEK) == SUNDAY ) {

Weekday + hour restriction. ...

if (( gettime(DT_DAYOFWEEK) == SATURDAY || gettime(DT_DAYOFWEEK) == SUNDAY ) && ( gettime(DT_HOUR) >= 18 && gettime(DT_HOUR) < 20 )) {

the changes are obvious here... just add another condition checking for the hour range....

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