Jump to content
  • 0

Costume Enchanter must unequip left acc


GiovanT

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  38
  • Reputation:   1
  • Joined:  07/21/16
  • Last Seen:  

Guys, i make enchanter NPC for costume item and  im only want to enchant just for head, middle, lower and garment costume. But i must unequip my Left acc and equip Right acc to do that, please help me to fix my script...thx

mes "[Costume Enchanter]";
		mes "Choose any of the equipment you're wearing that you'd like to enchant.";
		next;
		setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
		set .@menu$,"";
		for(set .@i,1; .@i<=20; set .@i,.@i+1) {
			if(getequipisequiped(.@i>=10) && !getequipisequiped(.@i>=15) && !getequipisequiped(.@i==14)) {
				set .@menu$, .@menu$ + "[" + getequipname(.@i) + "]";
				set .@equipped,1;
			}
			set .@menu$, .@menu$ + ":";
		}
		if (.@equipped == 0) {
			mes "[Costume Enchanter]";
			mes "Please ^0066FFUnequip^000000 your ^0055FFLeft Accessory^000000 and ^0066FFEquip^000000 your ^0055FFRight Accessory^000000";
			close;
		}
		set .@part, select(.@menu$);
		next;

		if(!getequipisequiped(.@part)) { //custom check
			mes "[Costume Enchanter]";
			mes "Sorry, I can only enchant equipment,";
			mes "not body parts. Come back when you're wearing something";
			mes "on that slot.";
			close;
		}
		
		mes "[Costume Enchanter]";
		mes "What kind of enchantment do you desire?";
		switch(select("Atk Rate and Hit:Matk Rate and Fixed Cast:Critical Rate and Critical:Long Atk Rate and ASPD:Max HP Rate and Def:Heal Rate and MDef:Cancel")) {
			case 1:
				switch(select("Atk Rate and Hit:Cancel")) {
					case 1: set .@enchantstoneid,29061; break;
					default: set .@enchantstoneid,0; break;
				}
				break;
			case 2:
				switch(select("Matk Rate and Fixed Cast:Cancel")) {
					case 1: set .@enchantstoneid,29071; break;
					default: set .@enchantstoneid,0; break;
				}
				break;
			case 3:
				switch(select("Critical Rate and Critical:Cancel")) {
					case 1: set .@enchantstoneid,29081; break;
					default: set .@enchantstoneid,0; break;
				}
				break;
			case 4:
				switch(select("Long Atk Rate and ASPD:Cancel")) {
					case 1: set .@enchantstoneid,29091; break;
					default: set .@enchantstoneid,0; break;
				}
				break;
			case 5:
				switch(select("Max HP Rate and Def:Cancel")) {
					case 1: set .@enchantstoneid,29101; break;
					default: set .@enchantstoneid,0; break;
				}
				break;
			case 6:
				switch(select("Heal Rate and MDef:Cancel")) {
					case 1: set .@enchantstoneid,29111; break;
					default: set .@enchantstoneid,0; break;
				}
				break;
			default:
				set .@enchantstoneid,0;
				break;
		}
		
		set .@enchantitemid, getequipid(.@part); // save id of the item
		set .@slots, getitemslots(.@enchantitemid); // slots of the item
		set .@refinelevel, getequiprefinerycnt(.@part); // refine level of the item
		setarray .@equip_card[0], getequipcardid(.@part,0),getequipcardid(.@part,1),getequipcardid(.@part,2),getequipcardid(.@part,3); // get current cards
		next;
		if (.@enchantstoneid == 0) {
			mes "[Costume Enchanter]";
			mes "Stop wasting my time...";
		}
		else {
			// anti-hack
			if (callfunc("F_IsEquipIDHack", .@part, .@enchantitemid) ||
				callfunc("F_IsEquipCardHack", .@part, .@equip_card[0], .@equip_card[1], .@equip_card[2], .@equip_card[3])) {
				mes "[Costume Enchanter]";
				mes "Hey! What do you think you're doing!";
				mes "Don't you dare switch your gear while I'm working on them, okay?";
				close;
			}
			
			if (.@equip_card[3] == 0 && .@slots < 4) {
				set .@equip_card[3],.@enchantstoneid;
			}
			else if (.@equip_card[2] == 0 && .@slots < 3) {
				set .@equip_card[2],.@enchantstoneid;
			}
			else if (.@equip_card[1] == 0 && .@slots < 2) {
				set .@equip_card[1],.@enchantstoneid;
			}
			else if (.@equip_card[0] == 0 && .@slots < 1) {
				set .@equip_card[0],.@enchantstoneid;
			}
			else {
				mes "[Costume Enchanter]";
				mes "I don't think I can fit any more enchantments";
				mes "onto this piece of equipment.";
				close;
			}
			
			specialeffect2 EF_REPAIRWEAPON;
			delequip .@part;
			getitem2 .@enchantitemid,1,1,.@refinelevel,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
			mes "[Costume Enchanter]";
			mes "All done!";
		}
	}

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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