Jump to content
  • 0
Unknown

Custom Enchanter NPC

Question

Probably you're tired of reading people asking for an Enchanter NPC, but I really need your help to create this one. So, please, if you have the skills to do so, I'd be very grateful if you'll help me!

What I'd like is a custom Enchanter that enchants only armors, shields, garments and boots with a random stat (min. +1, max +5 - Str, Agi, Vit, Int, Dex, Luk only!).

Thank you in advance!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

or (stolen from http://rathena.org/board/topic/77031-armor-enchanter-npc/#entry170869 )

prontera,156,178,5	script	ldfhsdfkljs	100,{
	mes "do you want to enchant your equipment ?";
	next;
	[email protected] = select( .menu$ ) -1;
	if ( !getequipisequiped( .const_equip[[email protected]] ) || .const_equip[[email protected]] == EQI_HAND_L && getiteminfo( getequipid( EQI_HAND_L ),2 ) != 5 ) {
		mes "you did not equip an "+ .menu_name$[[email protected]] +" at the moment";
		close;
	}
	[email protected] = getequipid( .const_equip[[email protected]] );
	[email protected] = getequiprefinerycnt( .const_equip[[email protected]] );
	[email protected] = getequipcardid( .const_equip[[email protected]], 0 );
	[email protected] = getequipcardid( .const_equip[[email protected]], 1 );
	[email protected] = getequipcardid( .const_equip[[email protected]], 2 );
	[email protected] = getequipcardid( .const_equip[[email protected]], 3 );
	if ( [email protected] == 255 || [email protected] == 254 ) {
		mes "I can't enchant a signed equipment";
		close;
	}
	if ( [email protected] ) {
		mes "this armor has already enchanted";
		close;
	}
	
	[email protected] = rand(.totalchance);
	while ( ( [email protected] = [email protected] - .rate[[email protected]] ) >= 0 ) [email protected]++;
	[email protected] = rand(0,5); // orb of str/int/dex ....

	delitem2 [email protected], 1,1, [email protected], 0, [email protected], [email protected], [email protected], 0;
	getitem2 [email protected], 1,1, [email protected], 0, [email protected], [email protected], [email protected], 4700 + [email protected] * 10 + [email protected];
	equip [email protected];
	close;
OnInit:
	setarray .rate, 55,50,45,40,35; // rate of getting +1 is 55%, +2 is 50% .... +10 is 10% ...

	setarray .const_equip, EQI_ARMOR, EQI_HAND_L, EQI_GARMENT, EQI_SHOES;
	setarray .menu_name$, "Armor", "Shield", "Garment", "Shoes";
	.menu$ = implode( .menu_name$,":" );
	while ( [email protected] < 10 ) {
		.totalchance = .totalchance + .rate[[email protected]];
		[email protected]++;
	}
	end;
}
  • Upvote 1
Link to comment
Share on other sites

you can try this

 

prontera,165,60,2    script    Apprentice Craftsman    73,{
    disable_items;
    mes "[Apprentice Craftsman]";
    if (Zeny >= 400000) {
        mes "I've been studying ways to enhance an armor to maximize its capability.";
        next;
        mes "[Apprentice Craftsman]";
        mes "Enchanting is an awesome skill that infuses a mysterious status powers into the armor's hidden socket.";
        next;
        mes "[Apprentice Craftsman]";
        mes "However, you have to keep in mind that if there are two armors of the same kind in your possession, the Enchantment will be applied in the order they are placed in your inventory.";
        next;
        mes "[Apprentice Craftsman]";
        mes "In that case, the Enchantment may be applied to an item which you didn't mean to Enchant. So just bring ^5555ffONE Armor^000000 you want enchanted to be safe...";
        next;
        mes "[Apprentice Craftsman]";
        mes "I'm not responsible for what would happen if you have more than one of the same kind in your inventory.";
        next;
        switch(select("Armor with no Slots:Armor with Slots:High Grade Armor:Maybe next time")) {
        case 1:
            setarray [email protected][0],2307,2309,2314,2316,2321,2325,2327,2328,2330,2332,2334,2335,2341,2344,2346,2348,2350,2337,2386,2394,2395,2396;
            set [email protected],50;
            break;
        case 2:
            setarray [email protected][0],2311,2318,2319,2320,2308,2310,2315,2317,2322,2324,2326,2331,2333,2336,2342,2345,2347,2349,2351;
            set [email protected],55;
            set [email protected],1;
            break;
        case 3:
            setarray [email protected][0],2364,2365,2391,2374,2375,2376,2377,2378,2379,2380,2381,2382,2387,2388,2389,2390;
            set [email protected],60;
            break;
        case 4:
            mes "[Apprentice Craftsman]";
            mes "Please come back when you have any interest in enchanting your armor.";
            close;
        }
        set [email protected]$,"";
        for(set [email protected],0; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+1)
            set [email protected]$, [email protected]$+getitemname([email protected][[email protected]])+(([email protected])?" [1]":"")+":";
        callsub S_EnchantArmor, [email protected][select([email protected]$)-1], [email protected];
        end;
    }
    mes "I am in charge of Enchanting Armors. Simply put, I've been studying ways to power-up armor.";
    next;
    mes "[Apprentice Craftsman]";
    mes "If by any chance, you would want to enchant your armor, bring me 400,000 zeny and the armor you want to enchant and you are all set to go.";
    close;

S_EnchantArmor:
    set [email protected],getarg(0);
    set [email protected],getarg(1);
    mes "[Apprentice Craftsman]";
    if ((countitem([email protected]) > 0) && (countitem([email protected]) < 2)) {
        mes "Socket enchant will cost you 400,000 zeny. And there will be a random option enchanted. Of course, there is a chance of breaking your armor.";
        next;
        mes "[Apprentice Craftsman]";
        mes "First and most importantly.";
        mes "^ff5555Existing Refine Level of the Armor";
        mes "and Cards will be GONE.^000000";
        mes "Do you still want to try an Enchant?";
        next;
        if(select("Hmm... Let me think it over.:I've made up my mind already. Give it a shot.")==1) {
            mes "[Apprentice Craftsman]";
            mes "Well, I can't blame you. Safety first, eh?";
            mes "Now you have a nice day.";
            close;
        }
        mes "[Apprentice Craftsman]";
        mes "Quite of an adventurer huh? Well, shall we?";
        close2;
        specialeffect2 EF_MAPPILLAR;
        if (Zeny < 400000) {
            mes "[Apprentice Craftsman]";
            mes "Sorry, but you don't have enough zeny.";
            close;
        }
        progressbar "ffff00",7;
        set Zeny, Zeny-400000;
        delitem [email protected],1;
        switch (rand(1,[email protected])) {
            case 1: set [email protected],4704;break;
            case 2: set [email protected],4714;break;
            case 3: set [email protected],4724;break;
            case 4: set [email protected],4734;break;
            case 5: set [email protected],4744;break;
            case 6: set [email protected],4754;break;
            
            case 7:
            case 8: set [email protected],4703;break;
            case 9:
            case 10: set [email protected],4713;break;
            case 11:
            case 12: set [email protected],4723;break;
            case 13:
            case 14: set [email protected],4733;break;
            case 15:
            case 16: set [email protected],4743;break;
            case 17:
            case 18: set [email protected],4753;break;
            
            case 19:
            case 20: set [email protected],4702;break;
            case 21:
            case 22: set [email protected],4712;break;
            case 23:
            case 24: set [email protected],4722;break;
            case 25:
            case 26: set [email protected],4732;break;
            case 27:
            case 28: set [email protected],4742;break;
            case 29:
            case 30: set [email protected],4752;break;
            
            case 31:
            case 32: set [email protected],4701;break;
            case 33:
            case 34: set [email protected],4711;break;
            case 35:
            case 36: set [email protected],4721;break;
            case 37:
            case 38: set [email protected],4731;break;
            case 39:
            case 40: set [email protected],4741;break;
            case 41:
            case 42: set [email protected],4751;break;
            
            case 43:
            case 44:
            case 45: set [email protected],4700;break;
            case 46:
            case 47:
            case 48: set [email protected],4710;break;
            case 49:
            case 50:
            case 51: set [email protected],4720;break;
            case 52:
            case 53:
            case 54: set [email protected],4730;break;
            case 55:
            case 56:
            case 57: set [email protected],4740;break;
            case 58:
            case 59:
            case 60: set [email protected],4750;break;
            default:
                specialeffect2 EF_PHARMACY_FAIL;
                mes "[Apprentice Craftsman]";
                mes "Well that's too bad.";
                mes "The requested equipment has failed to enchant.";
                close;
        }
        getitem2 [email protected], 1, 1, 0, 0, 0, 0, 0, [email protected];
    }
    else {
        mes "Hmm? There's nothing to be enchanted!";
        mes "Please come back with just ONE equipment to be enchanted.";
        close;
    }
}

if you want to enchant armor shield garment and boots

change this

 

		switch(select("Armor with no Slots:Armor with Slots:High Grade Armor:Shield with no Slots:Shield with Slots:Garment with Slots:Garment with no Slots:Boots with no Slots:Boots with Slots:Maybe next time")) {
// Armor with no slot
		case 1:
			setarray [email protected][0],2307,2309,2314,2316,2321,2325,2327,2328,2330,2332,2334,2335,2341,2344,2346,2348,2350,2337,2386,2394,2395,2396;
			set [email protected],50; //50 is rate success to enchant
			break;
// Armor with slot
		case 2:
			setarray [email protected][0],2311,2318,2319,2320,2308,2310,2315,2317,2322,2324,2326,2331,2333,2336,2342,2345,2347,2349,2351;
			set [email protected],55; //55 is rate success to enchant
			set [email protected],1;
			break;
// Hight Grade armor
		case 3:
			setarray [email protected][0],2364,2365,2391,2374,2375,2376,2377,2378,2379,2380,2381,2382,2387,2388,2389,2390;
			set [email protected],60; //60 is rate success to enchant
			break;


// Shield with no slot
case 4:
            setarray [email protected][0],?,?,?,etc; // you can change ? with id shield with no slot item find in your item_db
            set [email protected],60; //60 is rate success to enchant
            break;
//Shield with slot
case 5:
            setarray [email protected][0],?,?,?,etc; // you can change ? with id shield with slot item find in your item_db
            set [email protected],60; //60 is rate success to enchant
            break;


//Garment with no slot
        case 6:
            setarray [email protected][0],?,?,?,etc; // you can change ? with id garment with no slot item find in your item_db
            set [email protected],60; //60 is rate success to enchant
            break;
//Garment with slot
        case 7:
             setarray [email protected][0],?,?,?,etc; // you can change ? with id garment with slot item find in your item_db
            set [email protected],60; //60 is rate success to enchant
            break;


//Boots with no slot
        case 8:
            setarray [email protected][0],?,?,?,etc; // you can change ? with id boots with no slot item find in your item_db
            set [email protected],60; //60 is rate success to enchant
            break;
//Boots with slot
        case 9:
            setarray [email protected][0],?,?,?,etc; // you can change ? with id boots with slot item find in your item_db
            set [email protected],60; //60 is rate success to enchant
            break;


		case 10:
			mes "[Apprentice Craftsman]";
			mes "Please come back when you have any interest in enchanting your armor.";
			close;
		}

 

CMIIW

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.