Jump to content
  • 0

NPC Refiner VIP and Non-VIP


Kater

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.40
  • Content Count:  61
  • Reputation:   0
  • Joined:  04/03/24
  • Last Seen:  

Hi brothers,

I would like your help for an NPC.
For refines + 7 for non-VIP players and + 10 for VIP players.

  • With the option to refine everything at once.
  • Refine one item at a time.
  • Remove refine.
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  138
  • Reputation:   54
  • Joined:  06/02/12
  • Last Seen:  

Hi

//===== rAthena Script ======================================= 
//= https://rathena.org/board/topic/141811-npc-refiner-vip-and-non-vip/
//============================================================

prontera,170,181,4	script	Refiner VIP	4_4JOB_MAURA,{
	disable_items;
	cutin "4job_maura_01.PNG",2;
	mes "[Refiner VIP]";
	mes "Greetings!";
	mes "I can refine an item up to the ^006400+10^000000 to ^0000FFVIP adventurers^000000...";
	mes "You don't have to worry! There's no chance of breaking your item.";
	if (vip_status(VIP_STATUS_ACTIVE))
		.@r = 10;
	else {
		next;
		mes "[Refiner VIP]";
		mes "Since you're not a VIP, I can refine your items to ^006400+7^000000.";
		.@r = 7;
	}
	next;
	setarray .@position$[1],"Head upper","Armor","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head middle","Head lower";
	setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW;
	switch(select("Refine everything", "Choose equipment", "Remove refine", "Cancel")) {
		mes "[Refiner VIP]";
		case 1:
			mes "I'm going to refine every refinable item you have equipped up to the +" + .@r + " level^000000.";
			mes "May I proceed?";
			next;
			if(select("No.", "Yes.") == 1) {
				emotion ET_THINK;
				mes "[Refiner VIP]";
				mes "Oh, you changed your mind.";
				mes "Ok.";
				mes "You can come back later.";
				close3;
			}
			for (.@i = 1; .@i < getarraysize(.@indices); .@i++) {
				if (getequipisequiped(.@indices[.@i]) && 
					getequipisenableref(.@indices[.@i]) && 
					getequiprefinerycnt(.@indices[.@i]) < .@r) {
						successrefitem .@indices[.@i], .@r - getequiprefinerycnt(.@indices[.@i]);
						.@refined++;
				}
			}
			mes "[Refiner VIP]";
			if (.@refined) {
				specialeffect EF_SUI_EXPLOSION;
				mes "Alright, it is done~";
				mes "I refined " + F_InsertPlural(.@refined, "item") + "!";
			}
			else
				mes "There is nothing to refine...";
			close3;
		case 2:
			break;
		case 3:
			.@remove = true;
			mes "This is rare. But sure...";
			break;
		case 4:
			mes "Okay. You can come again later.";
			close3;
	}
	mes "Please choose the equipment.";
	for ( .@i = 1; .@i <= 10; ++.@i )
		.@menu$ += (getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : .@position$[.@i] + "- [Empty]") + ":";

	.@part = .@indices[ select(.@menu$) ];
	clear;
	if (!getequipisequiped(.@part)) {
		mes "[Refiner VIP]";
		mes "You have to equip the item you want to refine.";
		close3;
	}
	if (!getequipisenableref(.@part)) {
		emotion ET_OTL;
		mes "[Refiner VIP]";
		mes "Oh, I'm sorry.";
		mes "This item is impossible to refine.";
		close3;
	}
	.@refineitemid = getequipid(.@part); // save id of the item
	.@refinerycnt = getequiprefinerycnt(.@part); //save refinery count
	setarray .@card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);

	if (.@remove) {
		if (!getequiprefinerycnt(.@part)) {
			mes "[Refiner VIP]";
			mes "^8B4513This item has no refine.^000000";
			mes "I can't proceed.";
			close3;
		}
	}
	else if (getequiprefinerycnt(.@part) >= .@r) {
		emotion ET_PROFUSELY_SWEAT;
		mes "[Refiner VIP]";
		mes "^8B4513This item is already refined as much as your deed.^000000";
		if (getequiprefinerycnt(.@part) < 10 && !vip_status(VIP_STATUS_ACTIVE)) {
			mes "You can become a ^0000FFVIP adventurer^000000 to continue using my services.";
		}
		else
			mes "Please come along with an item refined less than +" + .@r + ".";
		close3;
	}
	mes "[Refiner VIP]";
	if (.@remove)
		mes "I'm going to ^8B4513remove the refine^000000 of ^006400" + getequipname(.@part) + ".";
	else
		mes "I'm going to refine ^006400"+getequipname(.@part)+"^8B4513 up to the +"+.@r+" level^000000.";
	mes "May I proceed?";
	next;
	if(select("No.:Yes.") == 1) {
		emotion ET_THINK;
		mes "[Refiner VIP]";
		mes "Oh, you changed your mind.";
		mes "Ok.";
		mes "You can come back later.";
		close3;
	}
	mes "[Refiner VIP]";
	mes "Great.";
	mes "As you wish!";
	mes "I have my own special way to refine...";
	mes ".......ka boom!";
	specialeffect EF_SUI_EXPLOSION;

	// anti-hack
	if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) ||
		callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3])) {
		mes "[Refiner VIP]";
		emotion ET_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!";
		close3;
	}
	if (.@remove)
		downrefitem .@part, getequiprefinerycnt(.@part);
	else
		successrefitem .@part, .@r - getequiprefinerycnt(.@part);
	next;
	emotion ET_DELIGHT;
	mes "[Refiner VIP]";
	mes "Alright, here it is~";
	mes "Well, ^0000FF"+strcharinfo(0)+"^000000!";
	mes "Congratulations. You look GREAT!";
	close3;
}

 

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.40
  • Content Count:  61
  • Reputation:   0
  • Joined:  04/03/24
  • Last Seen:  

6 hours ago, Racaae said:

Hi

//===== rAthena Script ======================================= 
//= https://rathena.org/board/topic/141811-npc-refiner-vip-and-non-vip/
//============================================================

prontera,170,181,4	script	Refiner VIP	4_4JOB_MAURA,{
	disable_items;
	cutin "4job_maura_01.PNG",2;
	mes "[Refiner VIP]";
	mes "Greetings!";
	mes "I can refine an item up to the ^006400+10^000000 to ^0000FFVIP adventurers^000000...";
	mes "You don't have to worry! There's no chance of breaking your item.";
	if (vip_status(VIP_STATUS_ACTIVE))
		.@r = 10;
	else {
		next;
		mes "[Refiner VIP]";
		mes "Since you're not a VIP, I can refine your items to ^006400+7^000000.";
		.@r = 7;
	}
	next;
	setarray .@position$[1],"Head upper","Armor","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head middle","Head lower";
	setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW;
	switch(select("Refine everything", "Choose equipment", "Remove refine", "Cancel")) {
		mes "[Refiner VIP]";
		case 1:
			mes "I'm going to refine every refinable item you have equipped up to the +" + .@r + " level^000000.";
			mes "May I proceed?";
			next;
			if(select("No.", "Yes.") == 1) {
				emotion ET_THINK;
				mes "[Refiner VIP]";
				mes "Oh, you changed your mind.";
				mes "Ok.";
				mes "You can come back later.";
				close3;
			}
			for (.@i = 1; .@i < getarraysize(.@indices); .@i++) {
				if (getequipisequiped(.@indices[.@i]) && 
					getequipisenableref(.@indices[.@i]) && 
					getequiprefinerycnt(.@indices[.@i]) < .@r) {
						successrefitem .@indices[.@i], .@r - getequiprefinerycnt(.@indices[.@i]);
						.@refined++;
				}
			}
			mes "[Refiner VIP]";
			if (.@refined) {
				specialeffect EF_SUI_EXPLOSION;
				mes "Alright, it is done~";
				mes "I refined " + F_InsertPlural(.@refined, "item") + "!";
			}
			else
				mes "There is nothing to refine...";
			close3;
		case 2:
			break;
		case 3:
			.@remove = true;
			mes "This is rare. But sure...";
			break;
		case 4:
			mes "Okay. You can come again later.";
			close3;
	}
	mes "Please choose the equipment.";
	for ( .@i = 1; .@i <= 10; ++.@i )
		.@menu$ += (getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : .@position$[.@i] + "- [Empty]") + ":";

	.@part = .@indices[ select(.@menu$) ];
	clear;
	if (!getequipisequiped(.@part)) {
		mes "[Refiner VIP]";
		mes "You have to equip the item you want to refine.";
		close3;
	}
	if (!getequipisenableref(.@part)) {
		emotion ET_OTL;
		mes "[Refiner VIP]";
		mes "Oh, I'm sorry.";
		mes "This item is impossible to refine.";
		close3;
	}
	.@refineitemid = getequipid(.@part); // save id of the item
	.@refinerycnt = getequiprefinerycnt(.@part); //save refinery count
	setarray .@card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);

	if (.@remove) {
		if (!getequiprefinerycnt(.@part)) {
			mes "[Refiner VIP]";
			mes "^8B4513This item has no refine.^000000";
			mes "I can't proceed.";
			close3;
		}
	}
	else if (getequiprefinerycnt(.@part) >= .@r) {
		emotion ET_PROFUSELY_SWEAT;
		mes "[Refiner VIP]";
		mes "^8B4513This item is already refined as much as your deed.^000000";
		if (getequiprefinerycnt(.@part) < 10 && !vip_status(VIP_STATUS_ACTIVE)) {
			mes "You can become a ^0000FFVIP adventurer^000000 to continue using my services.";
		}
		else
			mes "Please come along with an item refined less than +" + .@r + ".";
		close3;
	}
	mes "[Refiner VIP]";
	if (.@remove)
		mes "I'm going to ^8B4513remove the refine^000000 of ^006400" + getequipname(.@part) + ".";
	else
		mes "I'm going to refine ^006400"+getequipname(.@part)+"^8B4513 up to the +"+.@r+" level^000000.";
	mes "May I proceed?";
	next;
	if(select("No.:Yes.") == 1) {
		emotion ET_THINK;
		mes "[Refiner VIP]";
		mes "Oh, you changed your mind.";
		mes "Ok.";
		mes "You can come back later.";
		close3;
	}
	mes "[Refiner VIP]";
	mes "Great.";
	mes "As you wish!";
	mes "I have my own special way to refine...";
	mes ".......ka boom!";
	specialeffect EF_SUI_EXPLOSION;

	// anti-hack
	if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) ||
		callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3])) {
		mes "[Refiner VIP]";
		emotion ET_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!";
		close3;
	}
	if (.@remove)
		downrefitem .@part, getequiprefinerycnt(.@part);
	else
		successrefitem .@part, .@r - getequiprefinerycnt(.@part);
	next;
	emotion ET_DELIGHT;
	mes "[Refiner VIP]";
	mes "Alright, here it is~";
	mes "Well, ^0000FF"+strcharinfo(0)+"^000000!";
	mes "Congratulations. You look GREAT!";
	close3;
}

 

 

 

I did the test, it doesn't differentiate between refine para and vip. Study refining only +7.

There are items that he cannot refine, it would be possible to remove this restriction and let him refine everything.

For example: not being able to refine item 2285

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.40
  • Content Count:  61
  • Reputation:   0
  • Joined:  04/03/24
  • Last Seen:  

Being able to edit the NPC and set the condition for VIP player.

Thanks!

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