Jump to content
  • 0

Help me on this script


Jayz

Question


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  396
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

I want to make my Enchance Craftsman like Refiner menu... instead Item Category.. i want to make it.. like refiner

when you talk the npc instead you choose an item you want to craft.. you can choose an item in your equipment..

so mean to say.. any item in your equip is allowed to craft except Weapon....

anyone can help me??

because i dont know how to make this :(

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 <= 10; set .@i,.@i+1 )
{

//===== rAthena Script ======================================= 
//= Armor Enchanter
//===== By: ================================================== 
//= L0ne_W0lf
//===== Current Version: ===================================== 
//= 1.3
//===== Compatible With: ===================================== 
//= rAthena SVN
//===== Description: ========================================= 
//= [Aegis Conversion]
//= Add a +1, +2, or +3 random stat to a specified armor.
//===== Additional Comments: ================================= 
//= 1.0 First version.
//= 1.1 Corrected typo (Sit -> Suit) (bugreport:4586)
//= 1.2 Optimized. [Euphy]
//= 1.3 Fixed some typos and optimized a little more. [Daegaladh]
//============================================================ 

prontera,165,60,2	script	Apprentice Craftsman	73,{
mes "[Apprentice Craftsman]";
if (Zeny > 399999) {
	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 .@Items[0],2307,2309,2314,2316,2321,2325,2327,2328,2330,2332,2334,2335,2341,2344,2346,2348,2350,2337,2386,2394,2395,2396;
			set .@j,50;
			break;
		case 2:
			setarray .@Items[0],2311,2318,2319,2320,2308,2310,2315,2317,2322,2324,2326,2331,2333,2336,2342,2345,2347,2349,2351;
			set .@j,55;
			set .@k,1;
			break;
		case 3:
			setarray .@Items[0],2364,2365,2391,2374,2375,2376,2377,2378,2379,2380,2381,2382,2387,2388,2389,2390;
			set .@j,60;
			break;
		case 4:
			mes "[Apprentice Craftsman]";
			mes "Please come back when you have any interest in enchanting your armor.";
			close;
	}
	set .@menu$,"";
	for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+1)
		set .@menu$, .@menu$+getitemname(.@Items[.@i])+((.@k)?" [1]":"")+":";
	callsub S_EnchantArmor, .@Items[select(.@menu$)-1], .@j;
	end;
}
else {
	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 .@itemid,getarg(0);
set .@failrate,getarg(1);
mes "[Apprentice Craftsman]";
if ((countitem(.@itemid) > 0) && (countitem(.@itemid) < 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 .@itemid,1;
	switch (rand(1,.@failrate)) {
		case 1: set .@addpart,4702;break;
		case 2: set .@addpart,4712;break;
		case 3: set .@addpart,4722;break;
		case 4: set .@addpart,4732;break;
		case 5: set .@addpart,4742;break;
		case 6: set .@addpart,4752;break;
		case 7:
		case 8: set .@addpart,4701;break;
		case 9:
		case 10: set .@addpart,4711;break;
		case 11:
		case 12: set .@addpart,4721;break;
		case 13:
		case 14: set .@addpart,4731;break;
		case 15:
		case 16: set .@addpart,4741;break;
		case 17:
		case 18: set .@addpart,4751;break;
		case 19:
		case 20:
		case 21: set .@addpart,4700;break;
		case 22:
		case 23:
		case 24: set .@addpart,4710;break;
		case 25:
		case 26:
		case 27: set .@addpart,4720;break;
		case 28:
		case 29:
		case 30: set .@addpart,4730;break;
		case 31:
		case 32:
		case 33: set .@addpart,4740;break;
		case 34:
		case 35:
		case 36: set .@addpart,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 .@itemid, 1, 1, 0, 0, 0, 0, 0, .@addpart;
}
else {
	mes "Hmm? There's nothing to be enchanted!";
	mes "Please come back with just ONE equipment to be enchanted.";
	close;
}
}

Edited by Zack-
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  396
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

bump this is possible or not?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Anything is just about possible to do!!! It will be a lot of typing just in the sheer number of items that can be forged. I suggest you use setarray to make an array with each items required items and such. If you want it to follow the normal required items looking the produce_db and look at the items you want to forge. I suggest that you make an npc from scratch though and then format it similar to the refiner if you like that one.

Peopleperson49

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

it should be something similar like this...

http://pastebin.com/raw.php?i=DtUFHx5g

since the topic starter doesnt elaborate much on what the script required or need..i assume it work almost like the script he provide...

@peopleperson

Array cant fulfill what he need here...imagine how many array are you going to use to store up to thousand of equipments.....?

produce_db is not really a good placefor you to take into consideration in this situation.....and i dont think produce_db able to help you create a armor that have runes with it.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

I made a script similar to this to make elemental armors. I used a switch with each case being a setarray detailing all the info I needed.

Peopleperson49

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  396
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

@Emistry yeah exactly..

when you enchance an Princess Flag Hat(5609) have error

[Error]: buildin_countitem: Invalid item '-1'.
[Debug]: Source (NPC): Sample at prontera (155,181)

do you think the problem is

if( countitem( getequipid(.@i) ) > 1 ){

if yes how to fix?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

here..

http://pastebin.com/raw.php?i=ZTER80Af

fixed some variable that caused error in script...

@peopleperson

ya i know you are saying array..and planning what to do with it...

but are you really going to set all the item ID within the item_db into your array ?

how many array you would need to store all item ID that exist in item_db ??

your code will be very very very long and required to loop alot of array just to check for 1 items.....

your code will become loop whole item_db to find 1 item...which is not necessary in this case...

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  396
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

oh nice thats it.. thank you emistry.. now my problem is solved ;)

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