Jump to content
  • 0

Fusion Headgears


Linkin Park

Question


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

I want to request an NPC that can combine headgearA and headgearB and produce headgearA with the effects of headgearA and headgearB.

I made this using @item2 command

Cnvg6.png

And to be much easy to configure, itemA and itemB should be in an array something like

setarray .itemFuse1[0],itemidA,itemidB,fuseRate;
setarray .itemFuse2[0],itemidA,itemidB,fuseRate;
setarray .itemFuse3[0],itemidA,itemidB,fuseRate;
setarray .itemFuse4[0],itemidA,itemidB,fuseRate;
....
....
I can add more arrays for .itemFuseN[0]

Similar settings for with this from http://rathena.org/b...ro/#entry109922

OnInit:
// Format: <%>,<item ID>,<count>{,...};
setarray .P1[0],70,607,25;
setarray .P2[0],70,13710,1;
setarray .P3[0],40,5471,1;
setarray .P4[0],40,5210,1;
setarray .P5[0],40,5224,1;
setarray .P6[0],50,2357,1,2524,1,2421,1,2115,1;
setarray .P7[0],25,2701,1;
setarray .P8[0],5,2394,1;
setarray .Default[0],12214,1;
setarray .Cost[0],7227,300;
set .Total,8;
end;

The menu will show something like:

itemname(itemidA) + itemname(itemidB)

itemname(itemidA) + itemname(itemidB)

itemname(itemidA) + itemname(itemidB)

itemname(itemidA) + itemname(itemidB)

itemname(itemidA) + itemname(itemidB)

the menu will vary on how many arrays are available from the config. Similar with the Quest Shop of Euphy

Fusion can fail based on the chance/rate in the array. When it failed, both items will be destroyed or deleted.

When fusion is successful, user can obtain the item through

delitem itemidA,1;
delitem itemidB,1;
getitem2 itemidA,1,1,0,0,0,0,0,itemidB;

Edited by RaGERO
Link to comment
Share on other sites

12 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

@Paulinds: Here you go - http://upaste.me/raw/8cf7503130022f6

 

prontera,163,167,4	script	Fusion Master	808,{
	mes "[Fusion Master]";
	mes "After ten long years of searching,";
	mes "I've finally come across a way to";
	mes "make equipment stronger than";
	mes "anyone would've thought...";
	next;
	switch(select("Keep listening...:Fuse items:^777777Cancel^000000")) {
		case 1:
			mes "[Fusion Master]";
			mes "The process is called ^0055FFFusion^000000.";
			mes "With it, I can combine two pieces";
			mes "of equipment, doubling its";
			mes "strength. Of course, there is a";
			mes "chance I might fail... ^FF0000and";
			mes "your equipment will break.^000000";
			next;
		case 2:
			mes "[Fusion Master]";
			if (Zeny < .Price) {
				mes "It costs "+.Price+"z to fuse items. Come back later."; close; }
			mes "What would you like to fuse?";
			if (.Price) mes "Each attempt will cost "+.Price+"z.";
			next;
			set .@menu$,"";
			for(set .@i,0; .@i<getarraysize(.Items); set .@i,.@i+3)
				set .@menu$, .@menu$+((countitem(.Items[.@i+1])?"^0055FF":"^FF0000"))+getitemname(.Items[.@i+1])+"^000000 & "+((countitem(.Items[.@i+2])?"^0055FF":"^FF0000"))+getitemname(.Items[.@i+2])+":";
			set .@i, (select(.@menu$)-1)*3;
			mes "[Fusion Master]";
			mes "^0055FF"+getitemname(.Items[.@i+2])+"^000000 ~~> ^0055FF"+getitemname(.Items[.@i+1])+"^000000";
			mes " ";
			if (!countitem(.Items[.@i+1]) || !countitem(.Items[.@i+2])) {
				mes "You don't have the required materials."; close; }
			if (.Ticket && .Items[.@i] < 100)
				if (countitem(.Ticket)) {
					mes "^FF00001 "+getitemname(.Ticket)+" will be consumed.^000000";
					set .@NoFail,1; }
			if (!.@NoFail && .Items[.@i] < 100) {
				if (.DispChance) mes "^FF0000There is a "+(100-.Items[.@i])+"% chance of failure.^000000";
				else mes "^FF0000The process may fail.^000000"; }
			mes "Do you wish to proceed?";
			next;
			if(select("Continue:^777777Cancel^000000")==2) close;
			mes "[Fusion Master]";
			delitem .Items[.@i+1],1;
			delitem .Items[.@i+2],1;
			if (.@NoFail) delitem .Ticket,1;
			if (.Price) set Zeny, Zeny-.Price;
			if(rand(1,100) > .Items[.@i] && !.@NoFail) {
				specialeffect2 155;
				mes "Oh, no...";
				close; }
			mes "Success!";
			mes "Here's your new item!";
			getitem2 .Items[.@i+1],1,1,0,0,0,0,0,.Items[.@i+2];
			if (.Announce) announce strcharinfo(0)+" has successfully fused "+getitemname(.Items[.@i+1])+" with "+getitemname(.Items[.@i+2])+"!",0;
			specialeffect2 91;
		case 3:
			close;
	}
OnInit:
	// Format: <% success>,<Item A>,<Item B>{,...};
	// Item B will be slotted inside of Item A; maximum 42 fusion items.
	setarray .Items[0],50,1202,1228,75,5025,2254,10,1102,1141;
	set .Price,0;		// Zeny cost per fusion attempt, if any
	set .Ticket,7227;	// Item ID consumed for 100% success rate (0 to disable)
	set .Announce,1;	// Announce successful fusion? (1:yes / 0:no)
	set .DispChance,1;	// Show the success rate? (1:yes / 0:no)
	end;
}

 

Edited by Skorm
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

prontera,163,167,4  script  Fusion Master  808,{
 mes "[Fusion Master]";
 mes "After ten long years of searching,";
 mes "I've finally come across a way to";
 mes "make equipment stronger than";
 mes "anyone would've thought...";
 next;
 switch(select("Keep listening...:Fuse items:^777777Cancel^000000")) {
case 1:
  mes "[Fusion Master]";
  mes "The process is called ^0055FFFusion^000000.";
  mes "With it, I can combine two pieces";
  mes "of equipment, doubling its";
  mes "strength. Of course, there is a";
  mes "chance I might fail... ^FF0000and";
  mes "your equipment will break.^000000";
  next;
case 2:
  mes "[Fusion Master]";
  if (Zeny < .Price) {
	mes "It costs "+.Price+"z to fuse items. Come back later."; close; }
  mes "What would you like to fuse?";
  if (.Price) mes "Each attempt will cost "+.Price+"z.";
  next;
  set .@menu$,"";
  for(set .@i,0; .@i<getarraysize(.Items); set .@i,.@i+3)
	set .@menu$, .@menu$+((countitem(.Items[.@i+1])?"^0055FF":"^FF0000"))+getitemname(.Items[.@i+1])+"^000000 & "+((countitem(.Items[.@i+2])?"^0055FF":"^FF0000"))+getitemname(.Items[.@i+2])+":";
  set .@i, (select(.@menu$)-1)*3;
  mes "[Fusion Master]";
  mes "^0055FF"+getitemname(.Items[.@i+2])+"^000000 ~~> ^0055FF"+getitemname(.Items[.@i+1])+"^000000";
  mes " ";
  if (!countitem(.Items[.@i+1]) || !countitem(.Items[.@i+2])) {
	mes "You don't have the required materials."; close; }
  if (.Ticket && .Items[.@i] < 100)
	if (countitem(.Ticket)) {
	  mes "^FF00001 "+getitemname(.Ticket)+" will be consumed.^000000";
	  set .@NoFail,1; }
  if (!.@NoFail && .Items[.@i] < 100) {
	if (.DispChance) mes "^FF0000There is a "+(100-.Items[.@i])+"% chance of failure.^000000";
	else mes "^FF0000The process may fail.^000000"; }
  mes "Do you wish to proceed?";
  next;
  if(select("Continue:^777777Cancel^000000")==2) close;
  mes "[Fusion Master]";
  delitem .Items[.@i+1],1;
  delitem .Items[.@i+2],1;
  if (.@NoFail) delitem .Ticket,1;
  if (.Price) set Zeny, Zeny-.Price;
  if(rand(1,100) > .Items[.@i] && !.@NoFail) {
	specialeffect2 155;
	mes "Oh, no...";
	close; }
  mes "Success!";
  mes "Here's your new item!";
  getitem2 .Items[.@i+1],1,1,0,0,0,0,0,.Items[.@i+2];
  if (.Announce) announce strcharinfo(0)+" has successfully fused "+getitemname(.Items[.@i+1])+" with "+getitemname(.Items[.@i+2])+"!",0;
  specialeffect2 91;
case 3:
  close;
 }
OnInit:
 // Format: <% success>,<Item A>,<Item B>{,...};
 // Item B will be slotted inside of Item A; maximum 42 fusion items.
 setarray .Items[0],50,1202,1228,75,5025,2254,10,1102,1141;
 set .Price,0;	// Zeny cost per fusion attempt, if any
 set .Ticket,7227;  // Item ID consumed for 100% success rate (0 to disable)
 set .Announce,1;  // Announce successful fusion? (1:yes / 0:no)
 set .DispChance,1;  // Show the success rate? (1:yes / 0:no)
 end;
}

Edited by Euphy
Request below
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

It's working perfectly! :D Thanks Euphy!

I thought of something, can this be edited so that when the user has 1 Fusion Ticket, the success rate will be 100%? and if the user has no 1 Fusion Ticket, the specified rate will be used.

Also an announcement of successful fusion globally :P if its not too much to ask of course ;)

Edited by RaGERO
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Post above is edited.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  223
  • Reputation:   4
  • Joined:  02/23/12
  • Last Seen:  

Hi siRs, can i ask?

if item A have a bonus +1 str

and item B have a bonus +1 agi

if fused youLL ge item C w/ bonus +1 str and +1agi?

if so.. how? i mean, if item C have a bonus +allstats for example, it will changed to 1 str and agi?

sorry im so nooB,

hmm just wondering,

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

@critica: All effects of items in slots are carried over, and the scripts of each item are read just like those of a card. There may be a few attributes that don't work, but everything is fine for the most part.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

Thanks Euphy :) It's working /no1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

Sir can upload in upaste or pastebin? XD THANK YOU !

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

Thanks Euphy !!

Is this working in Script only? Or I will be needing to edit in db folder?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

No need to edit DB files.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

So this only works on scripts?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

Read post #11

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