• 0
Sign in to follow this  
neXus

removing the duplicate result

Question

Hello guys. I am creating a selection scripts and I would like to know how to remove duplicate results from the list.

prontera,154,150,5	script	SampleTest	123,{
	
	[email protected] = 1;	// Reflect 10% Short-Range Damage
	[email protected] = 3;	// Reduce 10% Aftercast Delay
	[email protected] = 0;
	[email protected] = 0;

	setarray [email protected]$[0],
		"Reflect 10% Short-Range Damage",1100000,7561,690,1063,730,
		"8 Mdef",1500000,7118,275,7162,700,
		"Reduce 10% Aftercast Delay",1700000,7567,500,1036,800,
		"Full HP/SP on Resurrection",2000000,951,730,7149,750,
		"10% Damage more with Shield Chain",2000000,7194,580,7215,890,
		"10% Increase Healing Power",1400000,6032,400,1096,790,
		"Uninterruptable Cast",1400000,7125,400,7263,480,
		"Increase Holy and Grand Cross Damage by 20%",2000000,7223,300,7215,900,
		"Indestructible",1400000,6023,380,7197,800;

	mes "Sample";

	for ([email protected]=0; [email protected]<getarraysize([email protected]$); [email protected][email protected]+6){
		for ([email protected]=0; [email protected]<4; [email protected]++){
			if (getd("[email protected]"+ [email protected])){
				if ([email protected]$[(getd("[email protected]"+ [email protected])-1)*6] != [email protected]$[[email protected]]){
					if (getd("[email protected]"+ ([email protected]/6) +"$") != [email protected]$[[email protected]]){
						mes "~ "+ [email protected]$[[email protected]];
					}
				}
				setd("[email protected]"+ ([email protected]/6) +"$", [email protected]$[[email protected]]);
			}
		}
	}

	close;
}

If I run this script the bonus 1 will be remove from the list but when the selection continue the bonus 2 is still showing up from the list. Its like to bonus 2 onwards is not being recognize by this script. I want the bonus 1 and 2 not appear from the list.

Its like removing the duplicate result.

 

Thanks in advance.

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I think is it, you want to do:

Spoiler
prontera,154,150,5	script	SampleTest	123,{
	
	.@bonus0 = 1;	// Reflect 10% Short-Range Damage
	.@bonus1 = 3;	// Reduce 10% Aftercast Delay
	.@bonus2 = 2;	// 8 Mdef
	.@bonus3 = 8;	// 10% Damage more with Shield Chain
	.@bonus4 = 5;	// Increase Holy and Grand Cross Damage by 20%

	setarray .@ItemBonus$[0],
		"Reflect 10% Short-Range Damage",1100000,7561,690,1063,730,
		"8 Mdef",1500000,7118,275,7162,700,
		"Reduce 10% Aftercast Delay",1700000,7567,500,1036,800,
		"Full HP/SP on Resurrection",2000000,951,730,7149,750,
		"10% Damage more with Shield Chain",2000000,7194,580,7215,890,
		"10% Increase Healing Power",1400000,6032,400,1096,790,
		"Uninterruptable Cast",1400000,7125,400,7263,480,
		"Increase Holy and Grand Cross Damage by 20%",2000000,7223,300,7215,900,
		"Indestructible",1400000,6023,380,7197,800;

	mes "Sample";

	for(set .@i, 0; .@i < getarraysize(.@ItemBonus$); set .@i, .@i + 6)
	{
		for(set .@j, 0; getd("[email protected]" + .@j) > 0; set .@j, .@j + 1)
		{
			if (.@ItemBonus$[(getd("[email protected]" + .@j) - 1) * 6] == .@ItemBonus$[.@i])
			{
				setd "[email protected]"+ (.@i / 6) +"$", .@ItemBonus$[.@i];
				break;
			}
		}

		if (getd("[email protected]"+ (.@i / 6) +"$") != .@ItemBonus$[.@i])
			mes "~ "+ .@ItemBonus$[.@i];
	}

	close;
}

 

 

Share this post


Link to post
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.

Loading...
Sign in to follow this