Jump to content
  • 0

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


Reinheit

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  04/16/20
  • Last Seen:  

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 .@position$[1], EQI_SHADOW_ARMOR, EQI_SHADOW_WEAPON;
	set .@menu$,"";
	for( set .@i,1; .@i <= 15; set .@i,.@i+1 ){
		if( getequipisequiped(.@i) )
			set .@menu$, .@menu$ + .@position$[.@i] + "[ " + getequipname(.@i) + " ]";
			set .@menu$, .@menu$ + ":";
	}

 

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

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

	setarray .@p, EQI_SHADOW_ARMOR, EQI_SHADOW_WEAPON;
	for(.@i=0;.@i<getarraysize(.@p);.@i++){
		if(getequipisequiped(.@p[.@i]))
			.@menu$ += F_getpositionname(.@p[.@i]) + "[ " + getequipname(.@p[.@i]) + " ]";
		.@menu$ += ":";
	}
	.@part = .@p[select(.@menu$) -1];

 

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  149
  • Reputation:   46
  • Joined:  07/15/13
  • Last Seen:  

Find: 

for( set .@i,1; .@i <= 15; set .@i,.@i+1 ){

Edit:

for( set .@i,1; .@i <= 2; set .@i,.@i+1 ){

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  04/16/20
  • Last Seen:  

5 minutes ago, EIysium said:

Find: 


for( set .@i,1; .@i <= 15; set .@i,.@i+1 ){

Edit:


for( set .@i,1; .@i <= 2; set .@i,.@i+1 ){

 

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

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

An easy way to do with

replace
for( set .@i,1; .@i <= 15; set .@i,.@i+1 ){
	if( getequipisequiped(.@i) )
		set .@menu$, .@menu$ + .@position$[.@i] + "[ " + getequipname(.@i) + " ]";
		set .@menu$, .@menu$ + ":";
}

WITH

if( getequipisequiped(EQI_SHADOW_ARMOR) ){
	set .@menu$, .@menu$ + .@position$[EQI_SHADOW_ARMOR] + "[ " + getequipname(EQI_SHADOW_ARMOR) + " ]";
}
set .@menu$, .@menu$ + ":";
if( getequipisequiped(EQI_SHADOW_WEAPON) ){
	set .@menu$, .@menu$ + .@position$[EQI_SHADOW_WEAPON] + "[ " + getequipname(EQI_SHADOW_WEAPON) + " ]";
}
set .@menu$, .@menu$ + ":";

you can optimize it ofc

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  04/16/20
  • Last Seen:  

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 .@part,select(.@menu$);    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 .@menu$, .@menu$ + .@position$[EQI_SHADOW_ARMOR] + "[ " + getequipname(EQI_SHADOW_ARMOR) + " ]";
		}
		set .@menu$, .@menu$ + ":";

	set .@part,select(.@menu$);
	if(!getequipisequiped(.@part)){
		mes "You're not wearing";
		mes "anything there that";
		mes "I can refine.";
		emotion 6;
		close;
	}
	//Check if the item is refinable...
	if(!getequipisenableref(.@part)) {
		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(.@part) >= 5) {
		mes "I can't refine this";
		mes "any more. This is as";
		mes "refined as it gets!";
		close;
	}
	set .@refineitemid, getequipid(.@part); // save id of the item
	set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
	switch(getequipweaponlv(.@part)){
	case 0: 					// Refine Armor
		set .@price,1000000;
		set .@material,512; 	// ItemID set to Apples right now.
		break;
	}
		mes "To refine this I need";
		mes "one ^003366"+getitemname(.@material)+"^000000 and";
		mes "a service fee of " + callfunc("F_InsertComma", .@price) + " 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(.@material) < 1) || (Zeny < .@price)) {
			mes "You don't seem to have";
			mes "enough Zeny or "+getitemname(.@material)+"...";
			mes "Go get some more. I'll be";
			mes "here all day if you need me.";
			close;
		}
		set Zeny,Zeny-.@price;
		delitem .@material,1;
		if(getequipisequiped(.@part) == 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(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // 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 .@part;
		Emotion e_smile;
		set .@win,rand(1,3);
		if (.@win == 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

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  04/16/20
  • Last Seen:  

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

Out of curiosity, what brought you to use .@i=0; instead of set .@i,1; ?

3 hours ago, sader1992 said:

	setarray .@p, EQI_SHADOW_ARMOR, EQI_SHADOW_WEAPON;
	for(.@i=0;.@i<getarraysize(.@p);.@i++){
		if(getequipisequiped(.@p[.@i]))
			.@menu$ += F_getpositionname(.@p[.@i]) + "[ " + getequipname(.@p[.@i]) + " ]";
		.@menu$ += ":";
	}
	.@part = .@p[select(.@menu$) -1];

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

1 hour ago, Reinheit said:

Out of curiosity, what brought you to use .@i=0; instead of set .@i,1; ?

my coding style.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  04/16/20
  • Last Seen:  

Gotcha. Thanks again~

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