Jump to content
  • 0

making the NPC hide after woe and unhide 30mins before woe


AinsLord

Question


  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

this is the script i found i just added the enablenpc command

no errors all is fine

but everytime i reload the serve NPC stays

its not being hidden

i tried putting On Init:

still same
 

-	script	SupplyTrigger	-1,{

OnSat1930:
OnSun1930:
	enablenpc "Guild Supply#1";
	enablenpc "Guild Supply#2";
	enablenpc "Guild Supply#3";
//	enablenpc "Guild Supply#4";
	end;

OnAgitEnd:
OnAgitEnd2:
	disablenpc "Guild Supply#1";
	disablenpc "Guild Supply#2";
	disablenpc "Guild Supply#3";
	end;
}

louyang,226,106,4	script	Guild Supply#1	998,{
	setarray .@item_id, 12529,20,14003,20;	// <Item_ID>,<Item_Amount>,{...};
	.@n$ = "["+strnpcinfo(0)+"]";
	.@GID = getcharid(2);
	.@GM = (getguildmaster(.@GID) == strcharinfo(0))?1:0;
	mes .@n$;
	mes "Welcome!";
	mes (.@GM)?"Have you claimed your supplies today?":"You have no business with me.";
	next;
	if (select(((.@GM)?"Claim Supplies":"")+":Leave") == 2) close;
	query_sql("SELECT COUNT(*) FROM `guild_member` WHERE `guild_id`="+.@GID, .@count);
	if (.@count < 10) {
		mes .@n$;
		mes "You have not enough guild members to claim the supplies.";
		close;
	}
	.@d$ = gettimestr("%Y%m%d",9);
	.@p = .@GID / 128;
	.@g = .@GID % 128;	
	if (getd("$GS_"+.@p+"$["+.@g+"]") != .@d$) {
		mes .@n$;
		mes "Here you go!";
		close2;
		setd "$GS_"+.@p+"$["+.@g+"]", .@d$;
		for (.@i = 0; .@i < getarraysize(.@item_id); .@i += 2)
			getitem .@item_id[.@i],.@item_id[.@i+1];
		end;
	}
	mes .@n$;
	mes "You have taken your supplies today.";
	close;

//OnInit:
	//waitingroom "[Guild Supply]",0;
//end;

}

alberta,31,229,0	duplicate(Guild Supply#1)	Guild Supply#2	653
prontera,165,318,1	duplicate(Guild Supply#1)	Guild Supply#3	653
//louyang,207,97,0	duplicate(Guild Supply#1)	Guild Supply#4	653

i also tried it will appear on a certain time of the day

and disappear certain time of the same day

like 1930 will show the NPC and by 2000 NPC hides

 

thnx in advance

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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

you can try this.

-	script	SupplyTrigger	-1,{

	OnInit:
	OnSat1930:
	OnSun1930:
	OnAgitEnd:
	OnAgitEnd2:
		if (gettime(DT_HOUR) == 19 && gettime(DT_MINUTE) >= 30) {
			hideoffnpc "Guild Supply#1";
			hideoffnpc "Supply#2";
			hideoffnpc "Guild Supply#3";
			// hideoffnpc "Guild Supply#4";
		}
		else {
			hideonnpc "Guild Supply#1";
			hideonnpc "Supply#2";
			hideonnpc "Guild Supply#3";
			// hideonnpc "Guild Supply#4";
		}
		end;
}

as long as the time is between 07:30PM to 07:59PM, the NPC will be enabled.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.10
  • Content Count:  349
  • Reputation:   12
  • Joined:  04/05/20
  • Last Seen:  

2 hours ago, AinsLord said:

this is the script i found i just added the enablenpc command

no errors all is fine

but everytime i reload the serve NPC stays

its not being hidden

i tried putting On Init:

still same
 


-	script	SupplyTrigger	-1,{

OnSat1930:
OnSun1930:
	enablenpc "Guild Supply#1";
	enablenpc "Guild Supply#2";
	enablenpc "Guild Supply#3";
//	enablenpc "Guild Supply#4";
	end;

OnAgitEnd:
OnAgitEnd2:
	disablenpc "Guild Supply#1";
	disablenpc "Guild Supply#2";
	disablenpc "Guild Supply#3";
	end;
}

louyang,226,106,4	script	Guild Supply#1	998,{
	setarray .@item_id, 12529,20,14003,20;	// <Item_ID>,<Item_Amount>,{...};
	.@n$ = "["+strnpcinfo(0)+"]";
	.@GID = getcharid(2);
	.@GM = (getguildmaster(.@GID) == strcharinfo(0))?1:0;
	mes .@n$;
	mes "Welcome!";
	mes (.@GM)?"Have you claimed your supplies today?":"You have no business with me.";
	next;
	if (select(((.@GM)?"Claim Supplies":"")+":Leave") == 2) close;
	query_sql("SELECT COUNT(*) FROM `guild_member` WHERE `guild_id`="+.@GID, .@count);
	if (.@count < 10) {
		mes .@n$;
		mes "You have not enough guild members to claim the supplies.";
		close;
	}
	.@d$ = gettimestr("%Y%m%d",9);
	.@p = .@GID / 128;
	.@g = .@GID % 128;	
	if (getd("$GS_"+.@p+"$["+.@g+"]") != .@d$) {
		mes .@n$;
		mes "Here you go!";
		close2;
		setd "$GS_"+.@p+"$["+.@g+"]", .@d$;
		for (.@i = 0; .@i < getarraysize(.@item_id); .@i += 2)
			getitem .@item_id[.@i],.@item_id[.@i+1];
		end;
	}
	mes .@n$;
	mes "You have taken your supplies today.";
	close;

//OnInit:
	//waitingroom "[Guild Supply]",0;
//end;

}

alberta,31,229,0	duplicate(Guild Supply#1)	Guild Supply#2	653
prontera,165,318,1	duplicate(Guild Supply#1)	Guild Supply#3	653
//louyang,207,97,0	duplicate(Guild Supply#1)	Guild Supply#4	653

i also tried it will appear on a certain time of the day

and disappear certain time of the same day

like 1930 will show the NPC and by 2000 NPC hides

 

thnx in advance

Try hideonnpc and hideoffnpc instead 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

1 hour ago, Origami said:

Try hideonnpc and hideoffnpc instead 

tried this one still same

dunno whats wrong with the code

but still figuring out on my end

for the solution

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.10
  • Content Count:  349
  • Reputation:   12
  • Joined:  04/05/20
  • Last Seen:  

-	script	SupplyTrigger	-1,{

OnSat1930:
OnSun1930:
	enablenpc "Guild Supply#1";
	enablenpc "Guild Supply#2";
	enablenpc "Guild Supply#3";
//	enablenpc "Guild Supply#4";
	end;

OnAgitEnd:
OnAgitEnd2:
	disablenpc "Guild Supply#1";
	disablenpc "Guild Supply#2";
	disablenpc "Guild Supply#3";
	end;
}

louyang,226,106,4	script	Guild Supply#1	998,{
	setarray .@item_id, 12529,20,14003,20;	// <Item_ID>,<Item_Amount>,{...};
	.@n$ = "["+strnpcinfo(0)+"]";
	.@GID = getcharid(2);
	.@GM = (getguildmaster(.@GID) == strcharinfo(0))?1:0;
	mes .@n$;
	mes "Welcome!";
	mes (.@GM)?"Have you claimed your supplies today?":"You have no business with me.";
	next;
	if (select(((.@GM)?"Claim Supplies":"")+":Leave") == 2) close;
	query_sql("SELECT COUNT(*) FROM `guild_member` WHERE `guild_id`="+.@GID, .@count);
	if (.@count < 10) {
		mes .@n$;
		mes "You have not enough guild members to claim the supplies.";
		close;
	}
	.@d$ = gettimestr("%Y%m%d",9);
	.@p = .@GID / 128;
	.@g = .@GID % 128;	
	if (getd("$GS_"+.@p+"$["+.@g+"]") != .@d$) {
		mes .@n$;
		mes "Here you go!";
		close2;
		setd "$GS_"+.@p+"$["+.@g+"]", .@d$;
		for (.@i = 0; .@i < getarraysize(.@item_id); .@i += 2)
			getitem .@item_id[.@i],.@item_id[.@i+1];
		end;
	}
	mes .@n$;
	mes "You have taken your supplies today.";
	close;

//OnInit:
	//waitingroom "[Guild Supply]",0;
//end;

}

alberta,31,229,0	duplicate(Guild Supply#1)	Guild Supply#2	653
prontera,165,318,1	duplicate(Guild Supply#1)	Guild Supply#3	653
//louyang,207,97,0	duplicate(Guild Supply#1)	Guild Supply#4	653

i also tried it will appear on a certain time of the day

and disappear certain time of the same day

errors all is fine

but everytime i reload the serve NPC stays

its not being hidden

i tried putting On Init:

still same
 

-	script	SupplyTrigger	-1,{

OnSat1930:
OnSun1930:
	hideoffnpc "Guild Supply#1";
	hideoffnpc Supply#2";
	hideoffnpc"Guild Supply#3";
//	hideoffnpc "Guild Supply#4";
	end;
OnInit:
OnAgitEnd:
OnAgitEnd2:
	hideonnpc "Guild Supply#1";
	hideonnpc "Guild Supply#2";
	hideonnpc "Guild Supply#3";
	end;
}
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

thnx @Origami and @Emistry

ill try both of this

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