Jump to content
  • 0

can someone help me with Skorm script about an Expert Enchanter ¿?


Question

Posted (edited)

Hi, rAthena Community i've this scripts, but when i select first slot, it equip to 2nd, then i try to select 2nd, but i cant only can uncard, so i select 3rd slot and it select the 4th slot... so i can set cards on 1st and 3rd slot only on 2nd and 4th :/ how can i solve this ? Thx!
 

prontera,193,188,4	script	Katonai	821,{

	mes .npc$;
	mes "Hello there!";
	mes "I can enchant your items,";
	mes "for a small fee of "+.pric+"z.";
	emotion e_no1,0; next;
	if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; }
	if(Zeny<.pric) { mes .npc$; mes "I'm sorry you don't have enough Zeny, please come back later."; close; }
	
	mes .npc$;
	mes "Which item would you like to enchant?"; next;
	for( .@a = 0; .@a < .e_len; .@a++ ) {
		if(getequipid(.equiploc[.@a])>-1) {
			set .@menu$, .@menu$+.eqp$[.@a]+"- [^0000FF"+getitemname(getequipid(.equiploc[.@a]))+"^000000]:";
		} else { set .@menu$, .@menu$+"^adb4be"+.eqp$[.@a]+"- [Empty]^000000:"; }
	}
		
	select(.@menu$);
	set .@eq_loc, .equiploc[@menu-1];
	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(.@eq,(getiteminfo(.@eq_itm,2)==4?4:.@eq_loc));
	for(set(.@b,0);.@b<getarraysize(getd(".itm"+.@eq));set(.@b,.@b+1)) {
		set(.@items,getd(".itm"+.@eq+"["+.@b+"]"));
		if(getiteminfo(.@items,2)>-1)
			if(set(.@c,countitem(.@items))) {
				set .@menu$, .@menu$+getitemname(.@items)+" x"+.@c+":";
				set .@b,.@b+1; set .@item[.@b], .@items;
			}
	}
			
	if(.@menu$=="") {
		mes .npc$;
		mes "Hmm, you don't seem to have any enchantment orbs for that equipment.";
		close;
	}

	mes .npc$;
	mes "Please, select an enchantment from the menu."; next;
	select(.@menu$);
	set .@itm, .@item[@menu];

	set .@menu$, ""; set .@a, 0;
	while((set(.@a,.@a+1)-1)<4) {
		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]:";
	}
	
	mes .npc$;
	mes "Select a slot."; next;
	set(.@slot,select(.@menu$)-1);
	set .@eqrf,	getequiprefinerycnt(.@eq_loc);
	if(getequipcardid(.@eq_loc,.@slot)) {
		mes .npc$;
		mes "Would you like me to remove this card?"; next;
		if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; }
		getitem getequipcardid(.@eq_loc,.@slot),1;
		delitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
		setd(".@crd"+(@menu+1), 0);
		getitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
	}

	if(rand(101)>.perc[.@slot]) {
		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;
	delitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
	setd(".@crd"+(@menu+1), .@itm);
	getitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
	misceffect .efet;
	emotion e_no1,0;
	mes .npc$;
	mes "All done!";
	equip .@eq_itm;
	close;

//NPC Constants
	OnInit:
		//=-=-=-=-=-=-=Configuration=-=-=-=-=-=-=
		set      .npc$  ,	"[^0000FFEnchant Expert^000000]"; // NPC Name
		set      .pric  ,	1000000;                          // Price
		set      .efet  ,	154;                              // Effect Number
		setarray .perc  ,	100,80,50,10;                     // Percent slot
		setarray .crd_c$,	"st", "nd", "rd", "th";           // Count
		setarray .itm32  ,   29101;                             // Sheilds
		setarray .itm16  ,   29101;                             // Armor
		setarray .itm4  ,   29101;                             // Garment
		setarray .itm64  ,   29101;                       // Footgear
		setarray .itm128  ,   29101;                             // Accessory1
		setarray .itm10  ,   29101;                             // Accessory2
		setarray .itm2  ,   29101;                             // Weapon
		setarray .itm1 ,   29101;                             // Low Headgear
		setarray .itm512  ,   29101;                             // Mid Headgear
		setarray .itm256  ,   29101;                             // Upper Headgear
		setarray .eqp$  ,	"Upper Headgear", "Mid Headgear", "Low Headgear", "Armor", "Left Hand", "Right Hand", "Garment",
		                	"Shoes", "Accessory1", "Accessory2";
		setarray .equiploc, EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R;
		set      .e_len ,	getarraysize(.eqp$);
		//=-=-=-=-=-=-=-=-Skorm-=-=-=-=-=-=-=-=-=
}

as you can see on the image below the 2nd and 4th is not problem but i cant equip on 1st and 3rd, if i pick 1st... it equip on 2nd, if i pick 2nd, it jus tell me about remove, if i pick 3rd, it equipo to 4th, if i try again on 1st o 3rd, it egain re-equip on 2nd or 4th :/

expert enchant error en 1 y 3 slot.png

Edited by ItsFree

5 answers to this question

Recommended Posts

  • 2
Posted
prontera,193,188,4	script	Katonai	821,{

	mes .npc$;
	mes "Hello there!";
	mes "I can enchant your items,";
	mes "for a small fee of "+.pric+"z.";
	emotion e_no1,0; next;
	if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; }
	if(Zeny<.pric) { mes .npc$; mes "I'm sorry you don't have enough Zeny, please come back later."; close; }
	
	mes .npc$;
	mes "Which item would you like to enchant?"; next;
	for( .@a = 0; .@a < .e_len; .@a++ ) {
		if(getequipid(.equiploc[.@a])>-1) {
			set .@menu$, .@menu$+.eqp$[.@a]+"- [^0000FF"+getitemname(getequipid(.equiploc[.@a]))+"^000000]:";
		} else { set .@menu$, .@menu$+"^adb4be"+.eqp$[.@a]+"- [Empty]^000000:"; }
	}
		
	select(.@menu$);
	set .@eq_loc, .equiploc[@menu-1];
	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(.@eq,(getiteminfo(.@eq_itm,2)==4?4:.@eq_loc));
	for(set(.@b,0);.@b<getarraysize(getd(".itm"+.@eq));set(.@b,.@b+1)) {
		set(.@items,getd(".itm"+.@eq+"["+.@b+"]"));
		if(getiteminfo(.@items,2)>-1)
			if(set(.@c,countitem(.@items))) {
				set .@menu$, .@menu$+getitemname(.@items)+" x"+.@c+":";
				set .@b,.@b+1; set .@item[.@b], .@items;
			}
	}
			
	if(.@menu$=="") {
		mes .npc$;
		mes "Hmm, you don't seem to have any enchantment orbs for that equipment.";
		close;
	}

	mes .npc$;
	mes "Please, select an enchantment from the menu."; next;
	select(.@menu$);
	set .@itm, .@item[@menu];

	set .@menu$, ""; set .@a, 0;
	while((set(.@a,.@a+1)-1)<4) {
		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]:";
	}
	
	mes .npc$;
	mes "Select a slot."; next;
	set(.@slot,select(.@menu$)-1);
	set .@eqrf,	getequiprefinerycnt(.@eq_loc);
	if(getequipcardid(.@eq_loc,.@slot)) {
		getitem getequipcardid(.@eq_loc,.@slot),1;
		delitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
		setd(".@crd"+@menu, 0);
		getitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
		close;
	}

	if(rand(101)>.perc[.@slot]) {
		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;
	delitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
	setd(".@crd"+@menu, .@itm);
	getitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
	misceffect .efet;
	emotion e_no1,0;
	mes .npc$;
	mes "All done!";
	equip .@eq_itm;
	close;

//NPC Constants
	OnInit:
		//=-=-=-=-=-=-=Configuration=-=-=-=-=-=-=
		set      .npc$  ,	"[^0000FFEnchant Expert^000000]"; // NPC Name
		set      .pric  ,	1000000;                          // Price
		set      .efet  ,	154;                              // Effect Number
		setarray .perc  ,	100,80,50,10;                     // Percent slot
		setarray .crd_c$,	"st", "nd", "rd", "th";           // Count
		setarray .itm32  ,   29101;                             // Sheilds
		setarray .itm16  ,   29101;                             // Armor
		setarray .itm4  ,   29101;                             // Garment
		setarray .itm64  ,   29101;                       // Footgear
		setarray .itm128  ,   29101;                             // Accessory1
		setarray .itm10  ,   29101;                             // Accessory2
		setarray .itm2  ,   29101;                             // Weapon
		setarray .itm1 ,   29101;                             // Low Headgear
		setarray .itm512  ,   29101;                             // Mid Headgear
		setarray .itm256  ,   29101;                             // Upper Headgear
		setarray .eqp$  ,	"Upper Headgear", "Mid Headgear", "Low Headgear", "Armor", "Left Hand", "Right Hand", "Garment",
		                	"Shoes", "Accessory1", "Accessory2";
		setarray .equiploc, EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R;
		set      .e_len ,	getarraysize(.eqp$);
		//=-=-=-=-=-=-=-=-Skorm-=-=-=-=-=-=-=-=-=
}

 

  • Upvote 2
  • 0
Posted (edited)

@Z3R0

both in adding and remove option the setd @menu not @menu+1

and in the remove option the if(select("Yes:No")&2) reset the @menu to 1 so it only remove the first slot so i removed it

Edited by sader1992
  • Upvote 1
  • 0
Posted (edited)

Thx gonna try it ^^

Tested and is working now... just a question if i wanna add more options i mean "orbs" how can i do it ¿? i tried with this... but didn't work

 

prontera,193,188,4	script	Katonai	821,{

	mes .npc$;
	mes "Hello there!";
	mes "I can enchant your items,";
	mes "for a small fee of "+.pric+"z.";
	emotion e_no1,0; next;
	if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; }
	if(Zeny<.pric) { mes .npc$; mes "I'm sorry you don't have enough Zeny, please come back later."; close; }
	
	mes .npc$;
	mes "Which item would you like to enchant?"; next;
	for( .@a = 0; .@a < .e_len; .@a++ ) {
		if(getequipid(.equiploc[.@a])>-1) {
			set .@menu$, .@menu$+.eqp$[.@a]+"- [^0000FF"+getitemname(getequipid(.equiploc[.@a]))+"^000000]:";
		} else { set .@menu$, .@menu$+"^adb4be"+.eqp$[.@a]+"- [Empty]^000000:"; }
	}
		
	select(.@menu$);
	set .@eq_loc, .equiploc[@menu-1];
	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(.@eq,(getiteminfo(.@eq_itm,2)==4?4:.@eq_loc));
	for(set(.@b,0);.@b<getarraysize(getd(".itm"+.@eq));set(.@b,.@b+1)) {
		set(.@items,getd(".itm"+.@eq+"["+.@b+"]"));
		if(getiteminfo(.@items,2)>-1)
			if(set(.@c,countitem(.@items))) {
				set .@menu$, .@menu$+getitemname(.@items)+" x"+.@c+":";
				set .@b,.@b+1; set .@item[.@b], .@items;
			}
	}
			
	if(.@menu$=="") {
		mes .npc$;
		mes "Hmm, you don't seem to have any enchantment orbs for that equipment.";
		close;
	}

	mes .npc$;
	mes "Please, select an enchantment from the menu."; next;
	select(.@menu$);
	set .@itm, .@item[@menu];

	set .@menu$, ""; set .@a, 0;
	while((set(.@a,.@a+1)-1)<4) {
		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]:";
	}
	
	mes .npc$;
	mes "Select a slot."; next;
	set(.@slot,select(.@menu$)-1);
	set .@eqrf,	getequiprefinerycnt(.@eq_loc);
	if(getequipcardid(.@eq_loc,.@slot)) {
		getitem getequipcardid(.@eq_loc,.@slot),1;
		delitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
		setd(".@crd"+@menu, 0);
		getitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
		close;
	}

	if(rand(101)>.perc[.@slot]) {
		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;
	delitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
	setd(".@crd"+@menu, .@itm);
	getitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
	misceffect .efet;
	emotion e_no1,0;
	mes .npc$;
	mes "All done!";
	equip .@eq_itm;
	close;

//NPC Constants
	OnInit:
		//=-=-=-=-=-=-=Configuration=-=-=-=-=-=-=
		set      .npc$  ,	"[^0000FFEnchant Expert^000000]"; // NPC Name
		set      .pric  ,	1000000;                          // Price
		set      .efet  ,	154;                              // Effect Number
		setarray .perc  ,	100,80,50,10;                     // Percent slot
		setarray .crd_c$,	"st", "nd", "rd", "th";           // Count
		setarray .itm32  ,   29101, 4858;                             // Sheilds
		setarray .itm16  ,   29101, 4857;                             // Armor
		setarray .itm4  ,   29101, 4856;                             // Garment
		setarray .itm64  ,   29101, 4855;                       // Footgear
		setarray .itm128  ,   29101, 4854;                             // Accessory1
		setarray .itm10  ,   29101, 4853;                             // Accessory2
		setarray .itm2  ,   29101;                             // Weapon
		setarray .itm1 ,   29101;                             // Low Headgear
		setarray .itm512  ,   29101;                             // Mid Headgear
		setarray .itm256  ,   29101;                             // Upper Headgear
		setarray .eqp$  ,	"Upper Headgear", "Mid Headgear", "Low Headgear", "Armor", "Left Hand", "Right Hand", "Garment",
		                	"Shoes", "Accessory1", "Accessory2";
		setarray .equiploc, EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R;
		set      .e_len ,	getarraysize(.eqp$);
		//=-=-=-=-=-=-=-=-Skorm-=-=-=-=-=-=-=-=-=
}

i mean i just add ",<space>Item_ID;" but only the first option is show and no the new options i added even having the items on inventory, Thx!

 

expert enchant error al leer orbs.png

Edited by ItsFree
  • 0
Posted

Bump, i tried with this 

Quote

        setarray .itm16  ,   4857  ,   4858;                             // Armor

i mean copying the space btw "item16" , and the id, and nothing, also i tried with tab and nothing, how can i add more than just 1 option ¿?

even i tired adding twice the same line but no error on console and also not working :/
 

Quote

        setarray .itm16  ,   4857;                             // Armor
        setarray .itm16  ,   4858;                             // Armor

please help with that :/

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...