Jump to content
  • 0

Fusion Item


Radian

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Hello Everyone, I would like to request a script that works like this

  • Combine Cards.
  • Has a chance of success.
  • Multiple Requirements.

something like this (thanks in advance)

[ Fused Card ]
-- Fused Phreeoni Card --

-- Requirements --
1x Red Potion
1x Blue Potion
1x Yellow Potion
1x White Potion

-- New Effect --
HIT +150
Add a 5% chance of auto casting Stone Curse status when hit by enemy.

-- Success Rate --
90% Fail and 10% success.
Link to comment
Share on other sites

16 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

My bad.. you're right :)

and I forgot to delete the requirement

mes "[ Fused Card ]";
mes "-- Fused Phreeoni Card --";
next;
setarray .@items[0], 501, 505, 503, 504;
setarray .@amounts[0], 1, 1, 1, 1;
mes "-- Requirements --";
for ( .@i = 0; .@i < 4; .@i++ ) {
	if ( countitem(.@items[.@i]) >= .@amounts[.@i] ) {
		.@total++;
		.@color$ = "^0000ff1";
	}
	else
		.@color$ = "^ff00000";
	mes "x"+ .@color$ +"/"+ .@amounts[.@i] +" "+ getitemname(.@items[.@i]);
}
next;
mes "-- New Effect --";
mes "HIT +150";
mes "Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
next;
mes "-- Success Rate --";
mes "90% Fail and 10% success.";
if ( .@total == 4 ) {
	next;
	if ( select( "Do it", "Bye" ) == 1 ) {
		if ( rand(1,100) <= 10 ) {
			mes "Success !";
			getitem <your item>,1;
		}
		else {
			mes "Failed";
		}
		for ( .@i = 0; .@i < 4; .@i++ )
			delitem .@items[.@i],.@amounts[.@i];
	}
}
close;

I added the an array for the amount

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

God I should reread

replace

if ( .@argcount -3 == 4 ) {

by

if ( .@argcount -3 == (.@total *2) ) {
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


mes "[ Fused Card ]";

mes "-- Fused Phreeoni Card --";

next;

setarray .@items[0], 501, 505, 503, 504;

mes "-- Requirements --";

for ( .@i = 0; .@i < 5; .@i++ ) {

if ( countitem(.@items[.@i]) > 0 ) {

.@total++;

.@color$ = "^0000ff1";

}

else

.@color$ = "^ff00000";

mes "x"+ .@color$ +"/1 "+ getitemname(.@items[.@i]);

}

next;

mes "-- New Effect --";

mes "HIT +150";

mes "Add a 5% chance of auto casting Stone Curse status when hit by enemy.";

next;

mes "-- Success Rate --";

mes "90% Fail and 10% success.";

if ( .@total == 4 ) {

next;

if ( select( "Do it", "Bye" ) == 1 ) {

if ( rand(1,100) <= 10 ) {

mes "Success !";

getitem <your item>,1;

}

else {

mes "Failed";

}

}

}

close;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Thanks Capuche  /lv

 

just a question if im correct on this part 

for ( .@i = 0; .@i < 5; .@i++ ) {

I changed it into this

for ( .@i = 0; .@i < 4; .@i++ ) {

how to add amount per item?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Is it possible on this section " mes "90% Fail and 10% success."; " that it will depends on how much percentage of the fusion item will fail or success? so it will be 

 

38% Fail and 62% Success

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

I don't understand what you mean but

if ( rand(1,100) <= 10 ) {

is the condition for the success ; if a random number between 1 and 100 is below 10 success

If you want to change the rate fro example you can define a variable for the success rate and add it in the message

.@success_rate = 10;
mes ( 100 - .@success_rate ) +"% Fail and "+ .@success_rate +"% success.";
//...
if ( rand(1,100) <= .@success_rate ) {
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

 

I don't understand what you mean but

if ( rand(1,100) <= 10 ) {

is the condition for the success ; if a random number between 1 and 100 is below 10 success

If you want to change the rate fro example you can define a variable for the success rate and add it in the message

.@success_rate = 10;
mes ( 100 - .@success_rate ) +"% Fail and "+ .@success_rate +"% success.";
//...
if ( rand(1,100) <= .@success_rate ) {

 

Sorry what i meant is it will randomly choose the " % " of success and fail.

 

setarray .@success[0],10,20,30,40,50; something like this? xD i am setting a random amoung rate of success.

 

setarray .@fail[0],10,20,30,40,50; something like this..

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Random success rate?

.@success_rate = rand(1,100);

the fail rate is 100 - success

 

if you want an array

setarray .@success[0],10,20,30,40,50;
.@success_rate = .@success[ rand(5) ];
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

 

Random success rate?

.@success_rate = rand(1,100);

the fail rate is 100 - success

 

if you want an array

setarray .@success[0],10,20,30,40,50;
.@success_rate = .@success[ rand(5) ];

 

Thanks :)  /lv

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

My bad.. you're right :)

and I forgot to delete the requirement

mes "[ Fused Card ]";
mes "-- Fused Phreeoni Card --";
next;
setarray .@items[0], 501, 505, 503, 504;
setarray .@amounts[0], 1, 1, 1, 1;
mes "-- Requirements --";
for ( .@i = 0; .@i < 4; .@i++ ) {
	if ( countitem(.@items[.@i]) >= .@amounts[.@i] ) {
		.@total++;
		.@color$ = "^0000ff1";
	}
	else
		.@color$ = "^ff00000";
	mes "x"+ .@color$ +"/"+ .@amounts[.@i] +" "+ getitemname(.@items[.@i]);
}
next;
mes "-- New Effect --";
mes "HIT +150";
mes "Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
next;
mes "-- Success Rate --";
mes "90% Fail and 10% success.";
if ( .@total == 4 ) {
	next;
	if ( select( "Do it", "Bye" ) == 1 ) {
		if ( rand(1,100) <= 10 ) {
			mes "Success !";
			getitem <your item>,1;
		}
		else {
			mes "Failed";
		}
		for ( .@i = 0; .@i < 4; .@i++ )
			delitem .@items[.@i],.@amounts[.@i];
	}
}
close;

I added the an array for the amount

 

 

@Capuche can i request  additional item for fusion.

 

 

#4305 #4318 #4263

 

Cann you add same as settarray different requirments and quantitys.

and also, if the player success it will announce which item he/she fusion for cards and how many percent % .

Edited by Drakkus
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

 

can i request  additional item for fusion.

Additionnal item reward or required ? I don't understand what you want please reformulate !

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

 

 

can i request  additional item for fusion.

Additionnal item reward or required ? I don't understand what you want please reformulate !

 

 

 

 

e.g mes "Please select the following cards that you will Fusion";

select " setarray item 1, item 2, item 3, item 4,

 

each of the fusion card is different requirments.. it would be easy if you can put setarray[0] the required items.

 

and also can you add, if player success the fusion he/she will be announced and the % sucess rate.

 

Thank you in advance Capuche!

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

This?

	mes "Choose something.";
	next;
	switch( select( "Fused Turtle General Card", "Fused 2nd card", "Fused 3rd card" ) ) {
	case 1:
		// <reward ID>, <chance success>, <item ID req 1>,<amount 1>, <item ID req 2>,<amount 2>, ..., <desc>; 
		callsub S_Fuse, 4305,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	case 2:
		callsub S_Fuse, 4318,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	case 3:
		callsub S_Fuse, 4263,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	}
S_Fuse:
	.@argcount = getargcount();
	.@success = getarg(1);
	mes "[ Fused Card ]";
	mes "-- Fused "+ getitemname( getarg(0) ) +" --";
	next;
	mes "-- Requirements --";
	for ( .@i = 2; .@i < .@argcount -1; .@i++ ) {
		if ( countitem(getarg(.@i)) >= getarg(.@i+1) ) {
			.@total++;
			.@color$ = "^0000ff1";
		}
		else
			.@color$ = "^ff00000";
		mes "x"+ .@color$ +"/"+ getarg(.@i+1) +" "+ getitemname(getarg(.@i));
	}
	next;
	mes "-- New Effect --";
	mes getarg( .@argcount -1 );
	next;
	mes "-- Success Rate --";
	mes ( 100 - .@success ) +"% Fail and "+ .@success +"% success.";
	if ( .@argcount -3 == 4 ) {
		next;
		if ( select( "Do it", "Bye" ) == 1 ) {
			if ( rand(1,100) <= .@success ) {
				mes "Success !";
				getitem getarg(0),1;
			}
			else {
				mes "Failed";
			}
			for ( .@i = 2; .@i < .@argcount -1; .@i++ )
				delitem getarg(.@i),getarg(.@i+1);
		}
	}
	close;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

Yes, this what i'm looking for. and also, i'm having problem with the callsub part:

// <reward ID>, <chance success>, <item ID req 1>,<amount 1>, <item ID req 2>,<amount 2>, ..., <desc>; 
		callsub S_Fuse, 4305,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	case 2:
		callsub S_Fuse, 4318,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	case 3:
		callsub S_Fuse, 4263,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	}

I don't know why it gives me error:

http://i.imgur.com/6rKmo7T.png

 

Thank you again :D

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Mistake

	mes "Choose something.";
	next;
	switch( select( "Fused Turtle General Card", "Fused 2nd card", "Fused 3rd card" ) ) {
	case 1:
		// <reward ID>, <chance success>, <item ID req 1>,<amount 1>, <item ID req 2>,<amount 2>, ..., <desc>; 
		callsub S_Fuse, 4305,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	case 2:
		callsub S_Fuse, 4318,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	case 3:
		callsub S_Fuse, 4263,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	}
S_Fuse:
	.@argcount = getargcount();
	.@success = getarg(1);
	mes "[ Fused Card ]";
	mes "-- Fused "+ getitemname( getarg(0) ) +" --";
	mes "-- Requirements --";
	for ( .@i = 2; .@i < .@argcount -1; .@i += 2 ) {
		if ( countitem(getarg(.@i)) >= getarg(.@i+1) ) {
			.@total++;
			.@color$ = "^0000ff1";
		}
		else
			.@color$ = "^ff00000";
		mes "x"+ .@color$ +"/"+ getarg(.@i+1) +" "+ getitemname(getarg(.@i));
	}
	next;
	mes "-- New Effect --";
	mes getarg( .@argcount -1 );
	next;
	mes "-- Success Rate --";
	mes ( 100 - .@success ) +"% Fail and "+ .@success +"% success.";
	if ( .@argcount -3 == 4 ) {
		next;
		if ( select( "Do it", "Bye" ) == 1 ) {
			if ( rand(1,100) <= .@success ) {
				mes "Success !";
				getitem getarg(0),1;
			}
			else {
				mes "Failed";
			}
			for ( .@i = 2; .@i < .@argcount -1; .@i += 2 )
				delitem getarg(.@i),getarg(.@i+1);
		}
	}
	close;
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

 

Mistake

	mes "Choose something.";
	next;
	switch( select( "Fused Turtle General Card", "Fused 2nd card", "Fused 3rd card" ) ) {
	case 1:
		// <reward ID>, <chance success>, <item ID req 1>,<amount 1>, <item ID req 2>,<amount 2>, ..., <desc>; 
		callsub S_Fuse, 4305,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	case 2:
		callsub S_Fuse, 4318,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	case 3:
		callsub S_Fuse, 4263,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy.";
	}
S_Fuse:
	.@argcount = getargcount();
	.@success = getarg(1);
	mes "[ Fused Card ]";
	mes "-- Fused "+ getitemname( getarg(0) ) +" --";
	mes "-- Requirements --";
	for ( .@i = 2; .@i < .@argcount -1; .@i += 2 ) {
		if ( countitem(getarg(.@i)) >= getarg(.@i+1) ) {
			.@total++;
			.@color$ = "^0000ff1";
		}
		else
			.@color$ = "^ff00000";
		mes "x"+ .@color$ +"/"+ getarg(.@i+1) +" "+ getitemname(getarg(.@i));
	}
	next;
	mes "-- New Effect --";
	mes getarg( .@argcount -1 );
	next;
	mes "-- Success Rate --";
	mes ( 100 - .@success ) +"% Fail and "+ .@success +"% success.";
	if ( .@argcount -3 == 4 ) {
		next;
		if ( select( "Do it", "Bye" ) == 1 ) {
			if ( rand(1,100) <= .@success ) {
				mes "Success !";
				getitem getarg(0),1;
			}
			else {
				mes "Failed";
			}
			for ( .@i = 2; .@i < .@argcount -1; .@i += 2 )
				delitem getarg(.@i),getarg(.@i+1);
		}
	}
	close;

 

No errors now, but after gather all the requirments, it doesn't fuse :(  anyways, thank you for 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...