Jump to content
  • 0

(Fixed)NPC will only appear every weekends.


Question

Posted (edited)

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

7 answers to this question

Recommended Posts

  • 0
Posted

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;
}

 

  • 0
Posted

	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;

 

  • 0
Posted
	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;

 

  • 0
Posted
	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....

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