Jump to content
  • 0

Set item in enchantment npc


kronobr

Question


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.02
  • Content Count:  71
  • Reputation:   0
  • Joined:  06/24/19
  • Last Seen:  

Hi, I would like this npc to affect only Armor and Upper Headgear. I tried to modify the setarray .eqp $ to have only these options but it doesn't work. Can anyone help? I tried to modify it in several ways, but it still doesn't pull the correct ones.
 

geffen,114,103,4	script	Master Expert	480,{
	mes .npc$;

	mes "Im a Master os Masters! I do things that only demigods can do. But everything comes at a price.";
	next;
	mes "Gimme a card between id 4001 ~ 4100 and "+.pric+"z. please note that it's 40% sucess rate";
	emotion e_no1,0; next;
	mes "The item must have at least 1 enchantment in order to receive my powers.";
	next;
	mes "You can use any card id 4001~4100 range, without type restriction, in the first slot (Even if it has no slot) from Upper Headgear and Armor";
	next;
	mes "If it fails, the item is not deleted, nor is the letter.";
	next;
	if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; }
	if(Zeny<.pric) { mes .npc$; mes "Insufficient zeny"; close; }
	
	mes .npc$;
	mes "Select your equipment"; next;
	while(set(.@a,.@a+1)<=.e_len) {
		if(getequipid(.@a)>-1)
			set .@menu$, .@menu$+.eqp$[.@a-1]+"- [^0000FF"+getitemname(getequipid(.@a))+"^000000]:";
		else set .@menu$, .@menu$+"^adb4be"+.eqp$[.@a-1]+"- [Empty]^000000:";
	}
		
	select(.@menu$);
	set .@eq_loc, @menu;
	set .@eq_itm, getequipid(.@eq_loc);
	if(.@eq_itm<0) {
		mes .npc$;
		mes "Hmm, I don't think you have anything equipped there.";
		close;
	}
	
	set .@menu$, "";
	set .@a, .en_orb[0];
	while((set(.@a,.@a+1)-1)<=.en_orb[1])
		if(getiteminfo(.@a-1,2)>-1)
			if(set(.@c,countitem(.@a-1))) {
				set .@menu$, .@menu$+getitemname(.@a-1)+" x"+.@c+":";
				set .@b,.@b+1; set .@item[.@b], .@a-1;
			}
			
	if(.@menu$=="") {
		mes .npc$;
		mes "You need some card in your inventory";
		close;
	}

	mes .npc$;
	mes "Select card from your inventory"; next;
	
	
	select(.@menu$);
	set .@itm, .@item[@menu];

	set .@menu$, ""; set .@a, 0;
	while((set(.@a,.@a+1)-1)<1) {
		setd(".@crd"+.@a, getequipcardid(.@eq_loc,.@a-1));
		if(getequipcardid(.@eq_loc,.@a-1))
			set .@menu$, .@menu$+.@a+.crd_c$[.@a-1]+" Slot- [^a92435"+getitemname(getequipcardid(.@eq_loc,.@a-1))+"^000000]:";
		else set .@menu$, .@menu$+.@a+.crd_c$[.@a-1]+" Slot- [^30ad25Empty^000000]:";
		
	}
setarray .@OptID[0],0;
setarray .@OptID[1],0;
setarray .@OptID[2],0;
setarray .@OptID[3],0;
setarray .@OptID[4],0;
setarray .@OptVal[0],0;
setarray .@OptVal[1],0;
setarray .@OptVal[2],0;
setarray .@OptVal[3],0;
setarray .@OptVal[4],0;
setarray .@OptParam[0],0;
setarray .@OptParam[1],0;
setarray .@OptParam[2],0;
setarray .@OptParam[3],0;
setarray .@OptParam[4],0;

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

setarray .@OptID[.@j],getequiprandomoption(.@eq_loc,.@j,ROA_ID);
setarray .@OptVal[.@j],getequiprandomoption(.@eq_loc,.@j,ROA_VALUE);
setarray .@OptParam[.@j],getequiprandomoption(.@eq_loc,.@j,ROA_PARAM);
//mes .@OptID[.@j]+","+.@OptVal[.@j]+","+.@OptParam[.@j];
}
	mes .npc$;
	mes "select slot."; next;
	select(.@menu$);
	set .@eqrf,	getequiprefinerycnt(.@eq_loc);
	if(getequipcardid(.@eq_loc,@menu-1)) {
		//mes .npc$;
		mes "This slot already have some card.";
		next;
//		if(Zeny<500000) { mes "Insufficient Zeny"; close; }
		switch(select("Bye")) {
		case 1:
			close;
			break;
		case 2:
			close;
			break;

		}
		
		//if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; }
		//successremovecards (.@eq_loc);
		close;
	}

	if(rand(100)>.perc) {
		mes .npc$;
		mes "I'm sorry but I've failed you!";
		misceffect 155; emotion e_sob,0;
		set Zeny,Zeny-.pric;
		close;
	}
	
	set Zeny,Zeny-.pric;
	delitem .@itm,1;
	delitem3 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4,.@OptID,.@OptVal,.@OptParam;
	setd(".@crd"+@menu, .@itm);
	getitem3 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4,.@OptID,.@OptVal,.@OptParam;
	misceffect .efet;
	emotion e_no1,0;
	mes .npc$;
	mes "All done!";
	equip .@eq_itm;
	close;

//NPC Constants
	OnInit:
		//=-=-=-=-=-=-=Configuration=-=-=-=-=-=-=
		set      .npc$  ,	"[^0000FFMaster Expert^000000]"; // NPC Name
		set      .pric  ,	500000;                          // Price
		set      .efet  ,	154;                              // Effect Number
		set      .perc  ,	rand(40,60);                      // Percent
		setarray .crd_c$,	"st", "nd", "rd", "th";          // Count
//		setarray .en_orb,	29081, 29088;                       // Range of IDs selected for
		setarray .en_orb,	4001, 4100;                       // Range of IDs selected for
//		setarray .en_orb,	4700, 4950;                       // Range of IDs selected for enchanting.
		setarray .eqp$  ,	"", "", "", "", "",
		                	"Upper Headgear", "Armor", "", "", "";
		set      .e_len ,	getarraysize(.eqp$);
		waitingroom "[Master Expert]",0;
		//=-=-=-=-=-=-=-=-Skorm-=-=-=-=-=-=-=-=-=
	
}

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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