Jump to content
  • 0

Refiner


Kuroe

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   0
  • Joined:  01/19/17
  • Last Seen:  

Hello. i am using a refiner that i found here at rathena and i just wanna ask why are these equipments not in the right options and can someone help me fix it?

Here's the script 
 

//===== rAthena Script ======================================= 
//= Perfect Refiner
//===== By: ================================================== 
//= SoulDestroyer (souldestroyer1030)
//===== Current Version: ===================================== 
//= 1.0
//===== Compatible With: ===================================== 
//= rAthena Project
//===== Description: ========================================= 
//= Refine -refinable- items to whatever level (even downgrade)
//===== Additional Comments: ================================= 
//= N/A
//============================================================ 

prontera,165,189,4	script	Legendary Blacksmith	813,{
	disable_items;
	set .@action, 0;
	mes "[Legendary Blacksmith]";
	mes "Heya! I'm the best blacksmith in the whole of Midgard!";
	mes "How can I help you?";
	next;
	switch(select("Upgrade Equipment:Downgrade Equipment:Repair Equipment:Maybe next time.")) {
	case 1:
		set .@action,1;
		break;
	case 2:
		set .@action,2;
		break;
	case 3:
		set .@action,3;
		break;
	default:
		mes "[Legendary Blacksmith]";
		mes "Come back if you change your mind!";
		close;
	}
	
	if (.@action == 1 || .@action == 2) {
		next;
		if (.@action == 1) {
			set actionword$,"upgrade";
		} else if (.@action == 2) {
			set actionword$,"downgrade";
		}
		mes "[Legendary Blacksmith]";
		mes "Choose any of the equipment you're wearing that you'd like to " + actionword$ + ".";
		next;
		setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Head","Accessory 1","Accessory 2","Head 2","Head 3";
		set .@menu$,"";
		for(set .@i,1; .@i<=10; set .@i,.@i+1) {
			if(getequipisequiped(.@i)) {
				set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
				set .@equipped,1;
			}
			set .@menu$, .@menu$ + ":";
		}
		if (.@equipped == 0) {
			mes "[Legendary Blacksmith]";
			mes "What? You're not wearing anything there.";
			close;
		}
		set .@part, select(.@menu$);
		next;
		
		//Check if the item is refinable...
		if(!getequipisenableref(.@part)) {
			mes "[Legendary Blacksmith]";
			mes "Even with my exceptional skill,";
			mes "there are things that just cannot be touched";
			mes "by a blacksmith's hammer.";
			close;
		}
		
		mes "[Legendary Blacksmith]";
		mes "By how much do you want me to " + actionword$ + " this item?";
		input .@refineamount;
		next;
		
		if (.@refineamount == 0) {
			mes "[Legendary Blacksmith]";
			mes "Oh, did you change your mind?";
			close;
		}
		
		set .@refineitem, getequipid(.@part); // save id of the item
		set .@refinelevel,getequiprefinerycnt(.@part); // save refine level of the item
		setarray .@equip_card[0], getequipcardid(.@part,0),getequipcardid(.@part,1),getequipcardid(.@part,2),getequipcardid(.@part,3); // get current cards

		if(!getequipisequiped(.@part)) { //custom check
			mes "[Legendary Blacksmith]";
			mes "Please equip the gear that you want me to ";
			mes "work on before coming to me!";
			close;
		}
		//Check to see if the items is already maxed out
		if((.@action == 1 && .@refinelevel >= 20) || (.@action == 2 && .@refinelevel <= 0)) {
			mes "[Legendary Blacksmith]";
			mes "I can no longer work on this.";
			mes "Everything in this world has limits, you know!";
			close;
		}
			
		// anti-hack
		if (callfunc("F_IsEquipIDHack", .@part, .@refineitem) ||
			callfunc("F_IsEquipCardHack", .@part, .@equip_card[0], .@equip_card[1], .@equip_card[2], .@equip_card[3])) {
			mes "[Legendary Blacksmith]";
			mes "You switched gears... while I'm working.";
			mes "That disappoints me more than anything. Go away.";
			close;
		}
		
		if (.@action == 1) {
			successrefitem .@part, .@refineamount;
		} else if (.@action == 2) {
			downrefitem .@part, .@refineamount;
		}
		mes "[Legendary Blacksmith]";
		mes "Clang! Clang! Clang!";
		next;
		mes "[Legendary Blacksmith]";
		mes "It's things like these that make me really proud";
		mes "of who and what I am. Perfection!";
		close;
	}
	else if (.@action == 3) {
		next;
		mes "[Legendary Blacksmith]";
		mes "Okay, let me have a look at your equipment...";
		next;
		repairall getcharid(0);
		mes "[Legendary Blacksmith]";
		mes "There you go, I've repaired everything that needs repairing!";
		close;
	}
	close;
}

and here's the menu ingame

image.png.9525e091166ebf4b417ca8a399678587.png

Thanks in advance. ?

Edited by Kuroe
Forgot to put image
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  22
  • Reputation:   5
  • Joined:  06/19/18
  • Last Seen:  

*getequipid({<equipment slot>,<char_id>})

This function returns the item ID of the item slot that calls the script
on the invoking character or the specified equipment slot. If nothing is
equipped there, it returns -1.
Valid equipment slots are:

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

Notice that a few items occupy several equipment slots, and if the character is
wearing such an item, 'getequipid' will return its ID number for either slot.

Can be used to check if you have something equipped, or if you haven't got
something equipped:

	if (getequipid(EQI_HEAD_TOP) == 2234)
		mes "What a lovely Tiara you have on";
	else
		mes "Come back when you have a Tiara on";
	close;

You can also use it to make sure people don't pass a point before removing an
item totally from them. Let's say you don't want people to wear Legion Plate
armor, but also don't want them to equip if after the check, you would do this:

	if (getequipid(EQI_ARMOR) == 2341 || getequipid(EQI_ARMOR) == 2342) {
		mes "You are wearing some Legion Plate Armor, please drop that in your stash before continuing";
		close;
	}
	// the || is used as an or argument, there is 2341 and 2342 cause there are
	// two different legion plate armors, one with a slot one without.

	if (countitem(2341) > 0 || countitem(2432) > 0) {
		mes "You have some Legion Plate Armor in your inventory, please drop that in your stash before continuing";
		close;
	}
	mes "I will lets you pass.";
	close2;
	warp "place",50,50;
	end;

---------------------------------------

*getequipname(<equipment slot>{,<char_id>})

Returns the jname of the item equipped in the specified equipment slot on the
invoking character, or an empty string if nothing is equipped in that position.
Does the same thing as getitemname(getequipid()). Useful for an NPC to state
what your are wearing, or maybe saving as a string variable.
See 'getequipid' for a full list of valid equipment slots.

        if ( getequipname(EQI_HEAD_TOP) != "" )
	        mes "So you are wearing a " + getequipname(EQI_HEAD_TOP) + " on your head";
	else
	        mes "You are not wearing any head gear";

Is because the refiner npc has the old positions of the equipment.

You're getting those values because of this part.

setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Head","Accessory 1","Accessory 2","Head 2","Head 3";
		set .@menu$,"";
		for(set .@i,1; .@i<=10; set .@i,.@i+1) {
			if(getequipisequiped(.@i)) {
				set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";

Change it to this, and it should work "not tested"

setarray .@position$[0], "Accessory L","Accessory R","Shoes","Robe","Head Low","Head Mid","Head Top","Armor","Left hand","Right hand";

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   0
  • Joined:  01/19/17
  • Last Seen:  

 

8 hours ago, Clark said:

You're getting those values because of this part.


setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Head","Accessory 1","Accessory 2","Head 2","Head 3";
		set .@menu$,"";
		for(set .@i,1; .@i<=10; set .@i,.@i+1) {
			if(getequipisequiped(.@i)) {
				set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";

Change it to this, and it should work "not tested"


setarray .@position$[0], "Accessory L","Accessory R","Shoes","Robe","Head Low","Head Mid","Head Top","Armor","Left hand","Right hand";

 

Thanks. ?

 

So I just had to re arrange them...

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