Jump to content
  • 0
Reinheit

Limiting a (Shadow) Refiner to refine only 1-2 items

Question

Hello,

Newbie here. I've been trying to modify a shadow refiner to refine only the EQI_SHADOW_ARMOR and EQI_SHADOW_WEAPON slots using arrays. However, no matter what I alter, I can't seem to get it to not show the regular equips as refineable options also... 

Would anyone have an idea as to how I might do this? Or if an array is even the best solution here? It seems most of the refiner scripts floating around use them.

Thanks in advance. 

	setarray [email protected]$[1], EQI_SHADOW_ARMOR, EQI_SHADOW_WEAPON;
	set [email protected]$,"";
	for( set [email protected],1; [email protected] <= 15; set [email protected],[email protected]+1 ){
		if( getequipisequiped([email protected]) )
			set [email protected]$, [email protected]$ + [email protected]$[[email protected]] + "[ " + getequipname([email protected]) + " ]";
			set [email protected]$, [email protected]$ + ":";
	}

 

573944839_2021-02-05124642.png.4b03594c7bcd33b79e3a6839558a9c2b.png428022247_2021-02-05111607.png.fb86a7db2df68f5c3feb30baab62f851.png

 

EQI_COMPOUND_ON (-1)      - Item slot that calls this script (In context of item script)
EQI_ACC_L (0)             - Accessory 1
EQI_ACC_R (1)             - Accessory 2
EQI_SHOES (2)             - Footgear (shoes, boots)
EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
EQI_HEAD_TOP (6)          - Upper Headgear
EQI_ARMOR (7)             - Armor (jackets, robes)
EQI_HAND_L (8)            - Left hand (weapons, shields)
EQI_HAND_R (9)            - Right hand (weapons)
EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
EQI_COSTUME_GARMENT (13)  - Costume Garment
EQI_AMMO (14)    		  - Arrow/Ammunition
EQI_SHADOW_ARMOR (15)     - Shadow Armor
EQI_SHADOW_WEAPON (16)    - Shadow Weapon
EQI_SHADOW_SHIELD (17)    - Shadow Shield
EQI_SHADOW_SHOES (18)     - Shadow Shoes
EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1

 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 1
	setarray [email protected], EQI_SHADOW_ARMOR, EQI_SHADOW_WEAPON;
	for([email protected]=0;[email protected]<getarraysize([email protected]);[email protected]++){
		if(getequipisequiped([email protected][[email protected]]))
			[email protected]$ += F_getpositionname([email protected][[email protected]]) + "[ " + getequipname([email protected][[email protected]]) + " ]";
		[email protected]$ += ":";
	}
	[email protected] = [email protected][select([email protected]$) -1];

 

  • Love 1
Link to comment
Share on other sites

  • 0
5 minutes ago, EIysium said:

Ah! thanks @Elysium. That was almost it, but not quite >_< 

This reduced the list to 2 ~~YAY!~~ but still prioritizes the regular equips first. Any other ideas to show only ShadowEquip?  

2021-02-05 16 12 32.png

Link to comment
Share on other sites

  • 0

An easy way to do with

replace
for( set [email protected],1; [email protected] <= 15; set [email protected],[email protected]+1 ){
	if( getequipisequiped([email protected]) )
		set [email protected]$, [email protected]$ + [email protected]$[[email protected]] + "[ " + getequipname([email protected]) + " ]";
		set [email protected]$, [email protected]$ + ":";
}

WITH

if( getequipisequiped(EQI_SHADOW_ARMOR) ){
	set [email protected]$, [email protected]$ + [email protected]$[EQI_SHADOW_ARMOR] + "[ " + getequipname(EQI_SHADOW_ARMOR) + " ]";
}
set [email protected]$, [email protected]$ + ":";
if( getequipisequiped(EQI_SHADOW_WEAPON) ){
	set [email protected]$, [email protected]$ + [email protected]$[EQI_SHADOW_WEAPON] + "[ " + getequipname(EQI_SHADOW_WEAPON) + " ]";
}
set [email protected]$, [email protected]$ + ":";

you can optimize it ofc

Link to comment
Share on other sites

  • 0

Ooo! That way certainly works to limit the menu choices to EQI_SHADOW_ARMOR, @sader1992!! Thanks!! However, it seems to try to read the slot in the Left Accessory to upgrade instead: 

I feel like its the line      set [email protected],select([email protected]$);    where it's reading slot  EQI_ACC_L (0) instead of EQI_SHADOW_ARMOR (15)... thought it shouldn't matter if were typing out the Item ID.... right?   😰

1816791831_2021-02-05214020.png.8ba44caee883ddb47a7686f014021ba5.png1667320880_2021-02-05214015.png.f717ed3ffbb092864898a9e8b91e110d.png

 

Here's the whole script I'm trying to modify/understand: 

	if( getequipisequiped(EQI_SHADOW_ARMOR) ){
		set [email protected]$, [email protected]$ + [email protected]$[EQI_SHADOW_ARMOR] + "[ " + getequipname(EQI_SHADOW_ARMOR) + " ]";
		}
		set [email protected]$, [email protected]$ + ":";

	set [email protected],select([email protected]$);
	if(!getequipisequiped([email protected])){
		mes "You're not wearing";
		mes "anything there that";
		mes "I can refine.";
		emotion 6;
		close;
	}
	//Check if the item is refinable...
	if(!getequipisenableref([email protected])) {
		mes "I don't think I can";
		mes "refine this item at all...";
		close;
	}
	//Check to see if the items is already +5
	if(getequiprefinerycnt([email protected]) >= 5) {
		mes "I can't refine this";
		mes "any more. This is as";
		mes "refined as it gets!";
		close;
	}
	set [email protected], getequipid([email protected]); // save id of the item
	set [email protected], getequiprefinerycnt([email protected]); //save refinery count
	switch(getequipweaponlv([email protected])){
	case 0: 					// Refine Armor
		set [email protected],1000000;
		set [email protected],512; 	// ItemID set to Apples right now.
		break;
	}
		mes "To refine this I need";
		mes "one ^003366"+getitemname([email protected])+"^000000 and";
		mes "a service fee of " + callfunc("F_InsertComma", [email protected]) + " Zeny.";
		mes "Do you really wish to continue?";
		next;
		if(select("Yes:No") == 2){
			mes "Yeah...";
			mes "There's no need to";
			mes "rush. Take your time.";
			close;
		}
		if((countitem([email protected]) < 1) || (Zeny < [email protected])) {
			mes "You don't seem to have";
			mes "enough Zeny or "+getitemname([email protected])+"...";
			mes "Go get some more. I'll be";
			mes "here all day if you need me.";
			close;
		}
		set Zeny,[email protected];
		delitem [email protected],1;
		if(getequipisequiped([email protected]) == 0) { // hacker has removed the item (not changed, why?)
			mes "[Aetherspirit Linker]";
			mes "Look here... you don't have any Items on...";
			close;
		}
		if(getequiprefinerycnt([email protected]) != [email protected] || getequipid([email protected]) != [email protected]) { // hacker has changed the item
			mes "[Aetherspirit Linker]";
			Emotion e_fret;
			mes "Wait a second...";
			mes "Do you think I'm stupid?!";
			mes "You switched the item while I wasn't looking! Get out of here!";
			close;
		}
		successrefitem [email protected];
		Emotion e_smile;
		set [email protected],rand(1,3);
		if ([email protected] == 1) {
			mes "Perfect!";
			mes "Heh heh!";
			mes "Once again,";
			mes "flawless work";
			mes "from the master~";
			specialeffect2 (381, AREA, strcharinfo(PC_NAME));
			specialeffect2 (407, AREA, strcharinfo(PC_NAME)); 
			}
		close;

 

Link to comment
Share on other sites

  • 0

... @sader1992 you beautiful bastard. That worked -- thank you so much! 

Out of curiosity, what brought you to use [email protected]=0; instead of set [email protected],1; ?

3 hours ago, sader1992 said:
	setarray [email protected], EQI_SHADOW_ARMOR, EQI_SHADOW_WEAPON;
	for([email protected]=0;[email protected]<getarraysize([email protected]);[email protected]++){
		if(getequipisequiped([email protected][[email protected]]))
			[email protected]$ += F_getpositionname([email protected][[email protected]]) + "[ " + getequipname([email protected][[email protected]]) + " ]";
		[email protected]$ += ":";
	}
	[email protected] = [email protected][select([email protected]$) -1];

 

 

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.