WOE supply on Registered Guild Only

MikZ

New member
Messages
461
Points
0
Good day!

May I request additional script here please.
Wanted to have Admin to register the GUILD first to get the reward not open to all Guild and will only provide the Supply every WOE TIME only.

Code:
prontera,155,180,5	script	Daily Supply	4_M_UNCLEKNIGHT,{

	setarray .@item_id, 671,1,672,2;	// <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;
}
 
Last edited by a moderator:
Back
Top