Jump to content
  • 0

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


Question

Posted

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

5 answers to this question

Recommended Posts

  • 0
Posted

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

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

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

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