Jump to content
  • 0
DR4LUC0N

Would someone mind helping me check party member IP and UID?

Question

So the original code is 

// START OF NEW CHECK - [Duplicate IP in one party?]
	attachrid [email protected];
	// for IP check
	set [email protected]_list$, "";
	set [email protected]_list$, "";
	set [email protected], 0;
	
	// Check Party Members
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		if (isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) == 0)
		continue;{
			attachrid [email protected][[email protected]];
			query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + [email protected][[email protected]] + "", [email protected]$);
			// If same IP is on party
			if(compare([email protected]_list$, "|" + [email protected]$ + "|" ) == 1) {
				set [email protected], 1;
			} else 
				// Add IP to party list for checking
				[email protected]_list$ += "|" + [email protected]$ + "|";
			
			// If acc has entered ladder
			if (compare( .en_acc_list$, "|" + getcharid(3,strcharinfo(0)) + "|" ) == 1) {
				if([email protected]_list$ == "")
					[email protected]_list$ += strcharinfo(0);
				else
					[email protected]_list$ += ", " + strcharinfo(0);
			}
		}	
	}
	
	// Get back to PTL to display message
	attachrid [email protected];
	
	if([email protected]) {
		mes "Sorry, party members with the same IP address can't enter.";
		close;
	}
	
	if([email protected]_list$ != "") {
		mes "Sorry, the following people has already entered the ladder today:";
		mes [email protected]_list$;
		close;
	}
	
// END OF NEW CHECK

This checks the party member is the same IP as party leader.

But I'm also trying to check to see if the party member has done the event before using uniqueID, here's my attempt.

// START OF NEW CHECK - [Duplicate IP in one party?]
	attachrid [email protected];
	// for IP check
	set [email protected]_list$, "";
	set [email protected]_list$, "";
	set [email protected], 0;
	set [email protected], 0;
	
	// Check Party Members
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		if (isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) == 0)
		continue;{
			attachrid [email protected][[email protected]];
			[email protected] = query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + [email protected][[email protected]] + "", [email protected]$);
			[email protected] = query_sql("SELECT last_unique_id FROM `login` WHERE account_id ="[email protected][[email protected]]+"", [email protected]_mem_uid$);
			[email protected] = query_sql("SELECT `dailybbq` FROM `bloody_branch_uid` WHERE `unique_id` = "[email protected]_mem_uid$+" LIMIT 1", [email protected]$);
			[email protected] = compare([email protected]_list$, "|" + [email protected]$ + "|" )
			[email protected] = compare([email protected]_list$, "|" + [email protected]$ + "|" )
			
			//Check party member UniqueID and see if they have completed for the day.
			if([email protected] == 0 && [email protected] == 1) {
			set [email protected], 1;
			}
			// If same IP is on party
			else if([email protected] == 1 && [email protected] == 0) {
			set [email protected], 1;
			}			
			else if([email protected] == 0 && [email protected] == 0) {
				// Add IP to party list for checking
				[email protected]_list$ += "|" + [email protected]$ + "|";
				// Add Unique_ID to party list for checking
				[email protected]_list$ += "|" + [email protected]$ + "|";
			}
			
			// If acc has entered ladder
			if (compare( .en_acc_list$, "|" + getcharid(3,strcharinfo(0)) + "|" ) == 1) {
				if([email protected]_list$ == "")
					[email protected]_list$ += strcharinfo(0);
				else
					[email protected]_list$ += ", " + strcharinfo(0);
			}
		}	
	}
	
	// Get back to PTL to display message
	attachrid [email protected];
	
	if([email protected]) {
		mes "A party member has completed the Bloody branch Quest today.";
		close;
	}
	
	if([email protected]) {
		mes "Sorry, party members with the same IP address can't enter.";
		close;
	}
	
	if([email protected]_list$ != "") {
		mes "Sorry, the following people has already entered the ladder today:";
		mes [email protected]_list$;
		close;
	}
// END OF NEW CHECK

Could someone help me in this please?

Edited by DR4LUC0N
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1
// START OF NEW CHECK - [Duplicate IP in one party?]
	attachrid [email protected];

	// Check Party Members
	[email protected] = getcharid(1);
	if ([email protected] == 0)
	{
		mes "you have no party";
		close;
	}
	getpartymember [email protected], 2, [email protected];
	[email protected] = [email protected];
	
	// make sure there is no pause between the check and collected party member data
	// like script command next, select, prompt, sleep2, sleep.
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
	{
		// no need to check with isloggedin anymore,
		// if failed to attach meaning the party member / player isn't online,
		// since only one char in account id can online at one time.
		if (attachrid([email protected][[email protected]]) == true)
		{
			// getcharip() script command was there in the script engine, why query?
			[email protected]$ = getcharip();

			 // script for you self? if use gepard do not bother using query,
			 // get_unique_id() should be there in the script engine, why query?
			[email protected] = get_unique_id();
			
			// check ip duplicate
			if (([email protected] = inarray([email protected]$, [email protected]$)) > -1)
				[email protected]_$[getarraysize([email protected]_$)] = strcharinfo(0);
			else
				[email protected]$[getarraysize([email protected]$)] = [email protected]$;
			
			// check gepard unique id duplicate
			if (([email protected] = inarray([email protected], [email protected])) > -1)
				[email protected]$[getarraysize([email protected]$)] = strcharinfo(0);
			else
				[email protected][getarraysize[[email protected]]] = [email protected];
		}	
	}
	
	// Get back to party leader to display message
	attachrid [email protected];
	
	if (getarraysize([email protected]_$))
	{
		mes "There is party member that found with same ip they are "+ implode([email protected]$, ",");
		close;
	}
	if (getarraysize([email protected]$))
	{
		mes "There is party member that found with same pc they are "+ implode([email protected]$, ",");
		close;
	}
// END OF NEW CHECK

 

Link to comment
Share on other sites

  • 1

Please refer to my reply and ignore my suggestion at the bottom. I already mentioned that the script already offers a uid check, you just have to reuse it.

 

veil,81,134,6	script	Quistis Trepe	10414,{
	.gui = get_unique_id ();
	[email protected] = query_sql("SELECT `dailybbq` FROM `bloody_branch_uid` WHERE `unique_id` = "+.gui+" LIMIT 1", [email protected]);
	
	mes "[Quistis Trepe]";
	mes "Say... do you want to play the MvP Ladder game? It cost 15 Vote Coins Per person, total of 30 Vote Coins now to get in.";
	next;
	switch(select("Yes, let's get it on!:Information.:Show me the best record.:No.")) {
		case 1:
			if ([email protected] == 0) {
				break;
			} else if ([email protected] >= 1) {
				mes "You have already completed the Bloody Branch Quest for today. Come back tomorrow after 12:00am server time.";
				close;
			}

 

Here's the line of codes that verify party members' IP

			//Check party member UniqueID and see if they have completed for the day.
			if([email protected] == 0 && [email protected] == 1) {
			set [email protected], 1;
			}
			// If same IP is on party
			else if([email protected] == 1 && [email protected] == 0) {
			set [email protected], 1;
			}			
			else if([email protected] == 0 && [email protected] == 0) {
				// Add IP to party list for checking
				[email protected]_list$ += "|" + [email protected]$ + "|";
				// Add Unique_ID to party list for checking
				[email protected]_list$ += "|" + [email protected]$ + "|";
			}

After this, all you have to do was to reuse/insert the uid check.

...and you already did the first few lines

			[email protected] = query_sql("SELECT last_unique_id FROM `login` WHERE account_id ="[email protected][[email protected]]+"", [email protected]_mem_uid$);
			[email protected] = query_sql("SELECT `dailybbq` FROM `bloody_branch_uid` WHERE `unique_id` = "[email protected]_mem_uid$+" LIMIT 1", [email protected]$);

 

Link to comment
Share on other sites

  • 0
Posted (edited)
On 6/21/2021 at 11:35 AM, Litro Endemic said:
// START OF NEW CHECK - [Duplicate IP in one party?]
	attachrid [email protected];

	// Check Party Members
	[email protected] = getcharid(1);
	if ([email protected] == 0)
	{
		mes "you have no party";
		close;
	}
	getpartymember [email protected], 2, [email protected];
	[email protected] = [email protected];
	
	// make sure there is no pause between the check and collected party member data
	// like script command next, select, prompt, sleep2, sleep.
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
	{
		// no need to check with isloggedin anymore,
		// if failed to attach meaning the party member / player isn't online,
		// since only one char in account id can online at one time.
		if (attachrid([email protected][[email protected]]) == true)
		{
			// getcharip() script command was there in the script engine, why query?
			[email protected]$ = getcharip();

			 // script for you self? if use gepard do not bother using query,
			 // get_unique_id() should be there in the script engine, why query?
			[email protected] = get_unique_id();
			
			// check ip duplicate
			if (([email protected] = inarray([email protected]$, [email protected]$)) > -1)
				[email protected]_$[getarraysize([email protected]_$)] = strcharinfo(0);
			else
				[email protected]$[getarraysize([email protected]$)] = [email protected]$;
			
			// check gepard unique id duplicate
			if (([email protected] = inarray([email protected], [email protected])) > -1)
				[email protected]$[getarraysize([email protected]$)] = strcharinfo(0);
			else
				[email protected][getarraysize[[email protected]]] = [email protected];
		}	
	}
	
	// Get back to party leader to display message
	attachrid [email protected];
	
	if (getarraysize([email protected]_$))
	{
		mes "There is party member that found with same ip they are "+ implode([email protected]$, ",");
		close;
	}
	if (getarraysize([email protected]$))
	{
		mes "There is party member that found with same pc they are "+ implode([email protected]$, ",");
		close;
	}
// END OF NEW CHECK

 

Thank you for helping! The reason for the SQL is because it gets emptied every day so they can go back in the next. As far as I know there's not a way to remove a gepard unique_id variable without talking to an NPC, so I found it to be easier to use a SQL to keep track and delete it daily(I have an OnClock for this towards the end of the script.). But you're clearly much better at this then I am and that's why I came here for help because I'm unsure where to go from here.

 

Basically if the party member IP isn't the same(stopping dual client or same IP party members from entering) and making sure the party members haven't entered in the event before. Here's the actual script for better reference.

//===== rAthena Script =======================================
//= MVP Ladder Game
//===== By: ==================================================
//= aftermath, AnnieRuru (rewrite)
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= Gather a party and kill every MVP in ascending order.
//===== Additional Comments: =================================
//= 1.0 First version, edited. [Euphy]
//============================================================

veil,81,134,6	script	Quistis Trepe	10414,{
	.gui = get_unique_id ();
	[email protected] = query_sql("SELECT `dailybbq` FROM `bloody_branch_uid` WHERE `unique_id` = "+.gui+" LIMIT 1", [email protected]);
	
	mes "[Quistis Trepe]";
	mes "Say... do you want to play the MvP Ladder game? It cost 15 Vote Coins Per person, total of 30 Vote Coins now to get in.";
	next;
	switch(select("Yes, let's get it on!:Information.:Show me the best record.:No.")) {
		case 1:
			if ([email protected] == 0) {
				break;
			} else if ([email protected] >= 1) {
				mes "You have already completed the Bloody Branch Quest for today. Come back tomorrow after 12:00am server time.";
				close;
			}
			
		
		case 2:
			mes "[Quistis Trepe]";
			mes "In this game, your party has to kill every single MvP monster in ascending order, from the weakest to strongest.";
			if ( .finish_item_amount )
				mes "If your party can finish the MVP ladder game, each member will earn "+ callfunc("F_InsertPlural", .finish_item_amount, getitemname( .finish_item_id )) +".";
			if ( .register_cost )
				mes "But the entrance fee is 15 vote coins per person, which means 30 Vote Coin total.";
				mes "Everyone need to vote on the websites to get 300 Vote Point, you can exchange them for 30 Vote Coins with the VoteForPoints Npc";
			next;
			mes "[Quistis Trepe]";
			mes "You lose the game if you can't finish in "+ .timeout +" minutes, or if your entire party is killed.";
			mes "Good luck!";
			close;
		
		case 3:
			mes "[Quistis Trepe]";
			if ( !$mvpladdderparty_time ) {
				mes "Nobody has finished this game yet.";
				close;
			}
			mes "The best record is";
			mes "[ "+( $mvpladdderparty_time / 60 )+" min "+( $mvpladdderparty_time % 60 )+" sec ]";
			mes "By the party ^FF0000"+ $mvpladdderparty_name$ +"^000000.";
			[email protected] = getarraysize( $mvpladderparty_member$ );
			for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ )
				mes "^000000"+ ( [email protected] +1 ) +". ^0000FF"+ $mvpladderparty_member$[[email protected]];
			if ( getgmlevel() < .gmlvlreset ) close;
			next;
			if ( select( "Close.", "Reset the record." ) == 1 ) close;
			if ( select( "Never mind.", "I really want to reset it." ) == 1 ) close;
			$mvpladdderparty_time = 0;
			$mvpladdderparty_name$ = "";
			deletearray $mvpladderparty_member$[[email protected]];
			mes "[Quistis Trepe]";
			mes "Record reset successfully.";
			close;
			
		case 4:
			mes "[Quistis Trepe]";
			mes "When you are strong enough to complete the game, please come back.";
			close;
		}
		
	if ( !getcharid(1) ) {
		mes "[Quistis Trepe]";
		mes "You have to form a party to play.";
		close;
	}
	
	if ( is_party_leader() == false ) {
		mes "[Quistis Trepe]";
		mes "Only the party leader can register.";
		close;
	}
	
	[email protected] = getcharid(3);
	getpartymember getcharid(1),1;
	getpartymember getcharid(1),2;
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		if (isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) == 0)
		continue;{
			[email protected] = readparam( Class, [email protected][[email protected]] );
			if (compare( [email protected]_list$, "|" + [email protected] + "|" ) == 1) {
				mes "Sorry, only one " + jobname([email protected]) + " is allowed.";
				close;
			}
		[email protected]_list$ += "|" + [email protected] + "|";
		[email protected]++;
		}	
	}
	
// START OF NEW CHECK - [Duplicate IP in one party?]
	attachrid [email protected];
	// for IP check
	set [email protected]_list$, "";
	set [email protected]_list$, "";
	set [email protected], 0;
	set [email protected], 0;
	
	// Check Party Members
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		if (isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) == 0)
		continue;{
			attachrid [email protected][[email protected]];
			[email protected] = query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + [email protected][[email protected]] + "", [email protected]$);
			[email protected] = query_sql("SELECT last_unique_id FROM `login` WHERE account_id ="[email protected][[email protected]]+"", [email protected]_mem_uid$);
			[email protected] = query_sql("SELECT `dailybbq` FROM `bloody_branch_uid` WHERE `unique_id` = "[email protected]_mem_uid$+" LIMIT 1", [email protected]$);
			[email protected] = compare([email protected]_list$, "|" + [email protected]$ + "|" )
			[email protected] = compare([email protected]_list$, "|" + [email protected]$ + "|" )
			
			//Check party member UniqueID and see if they have completed for the day.
			if([email protected] == 0 && [email protected] == 1) {
			set [email protected], 1;
			}
			// If same IP is on party
			else if([email protected] == 1 && [email protected] == 0) {
			set [email protected], 1;
			}			
			else if([email protected] == 0 && [email protected] == 0) {
				// Add IP to party list for checking
				[email protected]_list$ += "|" + [email protected]$ + "|";
				// Add Unique_ID to party list for checking
				[email protected]_list$ += "|" + [email protected]$ + "|";
			}
			
			// If acc has entered ladder
			if (compare( .en_acc_list$, "|" + getcharid(3,strcharinfo(0)) + "|" ) == 1) {
				if([email protected]_list$ == "")
					[email protected]_list$ += strcharinfo(0);
				else
					[email protected]_list$ += ", " + strcharinfo(0);
			}
		}	
	}
	
	// Get back to PTL to display message
	attachrid [email protected];
	
	if([email protected]) {
		mes "A party member has completed the Bloody branch Quest today.";
		close;
	}
	
	if([email protected]) {
		mes "Sorry, party members with the same IP address can't enter.";
		close;
	}
	
	if([email protected]_list$ != "") {
		mes "Sorry, the following people has already entered the ladder today:";
		mes [email protected]_list$;
		close;
	}
// END OF NEW CHECK

	else if ( [email protected] != .register_min ) {
		mes "[Quistis Trepe]";
		mes "You have to form a party with exactly "+ .register_min +" different classes members to play.";
		close;
	}
	
	else if ( [email protected] != .register_min )  {
		mes "[Quistis Trepe]";
		mes "Your party must have "+ .register_min +" members online on map '"+ strnpcinfo(4) +"'.";
		close;
	}
	
	else if (countitem(34207) < 15) {
		mes "[Quistis Trepe]";
		mes "Someone in the party doesn't have 15 vote coins.";
		close;
	}
	
// PTL has 5 miths, check for other pt members
	else if (countitem(34207) > 14) {
		for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
			attachrid [email protected][[email protected]];
			if (countitem(34207) < 15) {
				attachrid [email protected];
				mes "[Quistis Trepe]";
				mes "You don't have 15 Vote Points. Please come back when you do.";
				close;
			}
		}
		attachrid [email protected];
	}
	
	if ( .party_id ) {
		mes "[Quistis Trepe]";
		mes "I'm sorry, but a party is currently playing the game. Please standby until the party is finished.";
		mes "Thank you.";
		close;
	}
	
	announce "The party ["+ strcharinfo(1) +"] has started the MvP ladder game.", bc_all;
	// Delete mithril coins for each PT member
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		attachrid [email protected][[email protected]];
		delitem 34207,15;
	}
	
	attachrid [email protected];
	set .party_id, getcharid(1);
	set [email protected]_enter, gettimetick(2);
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		if ( isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) ) {
			attachrid [email protected][[email protected]];
			if ( strcharinfo(3) == strnpcinfo(4) ) {
				announce "You have "+ .timeout +" minutes to complete "+ .totalround +" rounds.", bc_self;
				[email protected]$[[email protected]] = strcharinfo(0);
				[email protected]++;
			}
		}
	}
	
	cleanmap .eventmap$;
	warpparty .eventmap$, 0,0, .party_id, strnpcinfo(4);
	attachrid [email protected];
	mes "hello";
	donpcevent strnpcinfo(0)+"::OnMvpDead";
	sleep .timeout * 60000;
	if ( .round == .totalround +1 ) {
		getpartymember .party_id, 1;
		getpartymember .party_id, 2;
		mapannounce .eventmap$, "Congratulations... You were able to defeat all the MVPs!", bc_map;
		for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
			if ( isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) ) {
				attachrid [email protected][[email protected]];
				if
				query_sql("SELECT last_unique_id FROM `login` WHERE account_id ="[email protected][[email protected]]+"", [email protected]_mem_uid_done$);
				query_sql( "INSERT INTO `bloody_branch_uid` VALUES ("[email protected]_mem_uid_done$+", 1)");
				query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + [email protected][[email protected]] + "", [email protected]$);
				if ( strcharinfo(3) == .eventmap$ )
					getitem .finish_item_id, .finish_item_amount;
				.entered_list$ += "|" + [email protected]$ + "|";
				.en_acc_list$ += "|" + getcharid(3,strcharinfo(0)) + "|";
			}
		}
		
		set [email protected] , getcharid(3,strcharinfo(0));
		addrid (2,0,getcharid(1)); //attach the rid of all players in the group
		set questdelay,gettimetick(2)+86400; //set the delay for all players in group
		detachrid;
		attachrid([email protected]); //so that the rest of the script will only run on the party leader		
		set [email protected], gettimetick(2) - [email protected]_enter;
		if ( .bonus_item_amount && [email protected] < .bonus_time * 60 ) {
			mapannounce .eventmap$, "You are rewarded a bonus item for completing the ladder within "+ .bonus_time +" minutes.", bc_map;
			for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
				if ( isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) ) {
					attachrid [email protected][[email protected]];
					if ( strcharinfo(3) == .eventmap$ )
						getitem .bonus_item_id, .bonus_item_amount;
				}
			}
		}

		if ( !$mvpladdderparty_time || [email protected] < $mvpladdderparty_time ) {
			mapannounce .eventmap$, "And you broke the record! [ "+( [email protected] / 60 )+" min "+( [email protected] % 60 )+" sec ]", bc_map;
			set $mvpladdderparty_time, [email protected];
			set $mvpladdderparty_name$, getpartyname( .party_id );
			copyarray $mvpladderparty_member$, [email protected]$, .register_min;
		}
		else
			mapannounce .eventmap$, "Time used [ "+( [email protected] / 60 )+" min "+( [email protected] % 60 )+" sec ]", bc_map;
		sleep 10000;
		announce "Player ["+ [email protected]$ +"] of the party ["+ getpartyname( .party_id ) +"] has finished the Bloody Branch Quest!", bc_all;
	}
	else
		announce "Player ["+ [email protected]$ +"] of the party ["+ getpartyname( .party_id ) +"] has failed to finish the MvP ladder game.", bc_all;
//	mapwarp .eventmap$,.Map$,.x,.y,0;
	killmonsterall .eventmap$;
	.party_id = .round = 0;
	end;

OnMvpDead:
	getpartymember .party_id, 1;
	getpartymember .party_id, 2;
	.round++;
	if ( .round >= 2 && .round != .totalround +1 && .round_item_amount ) {
		for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
			if ( isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) ) {
				attachrid [email protected][[email protected]];
				if ( strcharinfo(3) == .eventmap$ )
					getitem .round_item_id, .round_item_amount;
			}
		}
	}
	if ( .round == .totalround +1 ) {
		awake strnpcinfo(0);
		end;
	}
	else if ( .round == .totalround )
		mapannounce .eventmap$, "The final Round will begin in "+ .delay +" seconds...", bc_map;
	else
		mapannounce .eventmap$, "Starting round "+ .round +" in "+ .delay +" seconds...", bc_map;
	sleep .delay * 1000;
	if ( .mvpid[.round] == 1646 )  // pick random Bio3 MVP
		.mvpid[.round] = rand(1646,1651);
	monster .eventmap$,0,0, "--ja--", .mvpid[.round], 1, strnpcinfo(0)+"::OnMvpDead";
	mapannounce .eventmap$, getmonsterinfo( .mvpid[.round], MOB_NAME ) +" has spawned!", bc_map|bc_blue;
	end;

OnPCLogoutEvent:
	if ( hp > 0 )
		[email protected]_one = 1;
	else
		end;
		
OnPCDieEvent:
	if ( strcharinfo(3) != .eventmap$ || !getcharid(1) ) end;
	if ( getcharid(1) != .party_id ) end;
	getpartymember .party_id, 1;
	getpartymember .party_id, 2;
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		if ( isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) ) {
			attachrid [email protected][[email protected]];
			if ( strcharinfo(3) == .eventmap$ && hp > 0 )
				[email protected]++;
		}
	}
	if ( [email protected]_one )
		[email protected];
	if ( [email protected] ) {
		mapannounce .eventmap$, "Party wiped!", bc_map;
		sleep 10000;
		awake strnpcinfo(0);
	}
	end;

OnClock0000:
	set .entered_list$, "";
	set .en_acc_list$, "";
	query_sql( "DELETE FROM `bloody_branch_uid` WHERE `dailybbq` = '1'" );
//	query_sql "truncate table bloody_branch_uid";
	end;

OnInit:
	set .entered_list$, "";
	set .en_acc_list$, "";
//	Configurations -----------------------------------------------------

	// Time limit (in minutes)
	// When time runs out, all players inside the room will be kicked out.
	// Do NOT set this to zero!
	set .timeout, 30;

	// entrance fee (in Zeny)
	set .register_cost, 200000000;

	// exact amount of party members needed to start the game
	set .register_min, 2;

	// id of each mvp. you can add more
	setarray .mvpid[1],
		1086,//	Golden Thief Bug	64
//		1651,// H.Wizz				99
		1115,//	Eddga				65
		1150,//	Moonlight Flower	67
		1159,//	Phreeoni			69
		1112,//	Drake				70
		1583,//	Tao Gunka			70
		1492,//	Incantation Samurai	71
		1046,//	Doppelgangger		72
//		1649,// H.Priest			99
		1252,//	Garm				73
		1418,//	Evil Snake Lord		73
		1059,//	Mistress			74
		1190,//	Orc Lord			74
//		1646,// Lord Knight			99
		1087,//	Orc Hero			77
		1251,//	Knight of Windstorm	77
		1038,//	Osiris				78
//		1658,//	Ygnizem				79
//		1647,// Assassin X			99
		1272,//	Dark Lord			80
		1871,//	Fallen Bishop		80
		1039,//	Baphomet			81
		1147,//	Maya				81
//		1650,// Sniper Cecil		99
		1785,//	Atroce				82
		1389,//	Dracula				85
		1630,//	Bacsojin			85
//		1885,//	Gorynych			85
		1623,//	RSX 0806			86
//		1511,//	Amon Ra				88
//		1648,// Whitesmith			99
		1688,//	Lady Tanee			89
		1768,//	Gloom Under Night	89
		1719,//	Datale				90
//		1734,//	Kiel D-01			90
		1157,//	Pharaoh				93
		1373,//	Lord of Death		94
//		1312,//	Turtle General		97
		1779,//	Ktullanux			98
		1874,//	Beelzebub			98
//		1646,// Bio3 placeholder    99
		1708,//	Thanatos			99
		1751,//	Valkyrie Randgris	99
		1832;//	Ifrit				99


	// number of rounds (default: 39)
	//set .totalround, getarraysize(.mvpid) -1;
	set .totalround, 2; //if you want 35 rounds

	// item reward for completing each round
//	set .round_item_id, 607;
//	set .round_item_amount, 1;

	// item reward for completing the entire ladder
	set .finish_item_id, 12103;
	set .finish_item_amount, 20;

	// bonus reward if ladder completed within a certain time (in minutes)
	set .bonus_time, 15; // if completed within 15 minutes, this reward is given
	set .bonus_item_id, 12103;
	set .bonus_item_amount, 5;

	// time delay between rounds, in seconds (default: 3)
	set .delay, 3;

	// minimum GM level to reset the best record
	set .gmlvlreset, 99;
	
	// teleport map that the player warps to after they finish the quest
//	set .Map$,"veil";
//	set .x,120;
//	set .y,105;
	

	// event map
	set .eventmap$, "cguild_vs22";

	// mapflag configuration
	setarray [email protected],
		mf_nowarp,
		mf_nowarpto,
		mf_nosave,
		mf_nomemo,
		mf_noteleport,
//		mf_nopenalty, // disable exp loss
		mf_noreturn,
//		mf_nobranch,
//		mf_nomobloot, // disable monster drop loots,
//		mf_nomvploot, // 2 of these
//		mf_nodrop,
		mf_partylock;

//	Config Ends --------------------------------------------------------------

	mapannounce .eventmap$, "An administrator has refreshed the server. Please re-register. We apologize for the inconvenience.", bc_map;
//	getmapxy .map$, .x, .y, BL_NPC;
//	mapwarp .eventmap$, .Map$, .x, .y;
	killmonsterall .eventmap$;
	[email protected] = getarraysize( [email protected] );
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ )
		setmapflag .eventmap$, [email protected][[email protected]];

//waitingroom"Bloody Branch Quest",0;

end;
}

veil_guide,81,134,6	duplicate(Quistis Trepe)	Quistis Trepe#Guides	10414


-	script	sqlresetter	-1,{
OnCommand: //Add event on the start of your npc
	dispbottom "BBQ sql has been reset for testing purpose.";
	query_sql( "DELETE FROM `bloody_branch_uid` WHERE `dailybbq` = '1'" );
end;

OnInit:
	bindatcmd "sql",strnpcinfo(3) + "::OnCommand";
end;
}


-	script	no_reins2	-1,{
OnPCLoadMapEvent:
if (strcharinfo(3) == "cguild_vs22" && ismounting() ) { setmounting(); }
}
cguild_vs22	mapflag	loadevent

 

 

On 6/25/2021 at 1:10 AM, Magnetix said:

Please refer to my reply and ignore my suggestion at the bottom. I already mentioned that the script already offers a uid check, you just have to reuse it.

 

veil,81,134,6	script	Quistis Trepe	10414,{
	.gui = get_unique_id ();
	[email protected] = query_sql("SELECT `dailybbq` FROM `bloody_branch_uid` WHERE `unique_id` = "+.gui+" LIMIT 1", [email protected]);
	
	mes "[Quistis Trepe]";
	mes "Say... do you want to play the MvP Ladder game? It cost 15 Vote Coins Per person, total of 30 Vote Coins now to get in.";
	next;
	switch(select("Yes, let's get it on!:Information.:Show me the best record.:No.")) {
		case 1:
			if ([email protected] == 0) {
				break;
			} else if ([email protected] >= 1) {
				mes "You have already completed the Bloody Branch Quest for today. Come back tomorrow after 12:00am server time.";
				close;
			}

 

Here's the line of codes that verify party members' IP

			//Check party member UniqueID and see if they have completed for the day.
			if([email protected] == 0 && [email protected] == 1) {
			set [email protected], 1;
			}
			// If same IP is on party
			else if([email protected] == 1 && [email protected] == 0) {
			set [email protected], 1;
			}			
			else if([email protected] == 0 && [email protected] == 0) {
				// Add IP to party list for checking
				[email protected]_list$ += "|" + [email protected]$ + "|";
				// Add Unique_ID to party list for checking
				[email protected]_list$ += "|" + [email protected]$ + "|";
			}

After this, all you have to do was to reuse/insert the uid check.

...and you already did the first few lines

			[email protected] = query_sql("SELECT last_unique_id FROM `login` WHERE account_id ="[email protected][[email protected]]+"", [email protected]_mem_uid$);
			[email protected] = query_sql("SELECT `dailybbq` FROM `bloody_branch_uid` WHERE `unique_id` = "[email protected]_mem_uid$+" LIMIT 1", [email protected]$);

 

Sorry for the late reply. What about the part where the event is complete, is that proper to input both the leader and member? 

Edited by DR4LUC0N
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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.