Jump to content
  • 0

Hello need some help this refiner doesnt refine weapons how can i make him refine weapons too?


lelouchxv

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   8
  • Joined:  09/16/18
  • Last Seen:  

poring_w02,73,82,4	script	Refiner	85,{
function nZeny;
function CHose;
function nItem;
function nRate;
function sRater;

	//when use 'Protection Scroll'
	//-1,-2,-3... -->back to level 1,2,3...(MAX:10) if refine fail
	//1,2,3... --> reduce level 1,2,3.... if refine fail
	set @use2,0;
	set @rate,0;
	set @typr,0;
	set @menu2,0;
	set @use3,0;


	if(select("Refine","Close")==2) close;
	
	set @typr,select(""+getequipname(1),""+getequipname(2),""+getequipname(3),""+getequipname(4),""+getequipname(5),""+getequipname(6));
	callsub OnCon;

	sRater();
	if(select("^000088Refine now^000000","^FF3355Don't refine^000000")==2)
		close;	
	callsub OnCon2;
OnCon:	
	if(!getequipisenableref(@typr)) {
		mes "I can't refine this !...";
		close;
	}	
	if(getequiprefinerycnt(@typr)>=10) {
		mes "It's not possible to refine this better than +10.";
		close;
	}	
	if(Zeny<nZeny(@typr)) {
		mes "You don't have enough Zeny. Your Zeny is lower than "+nZeny(@typr)+".";
		close;
	}

	if( @use3 ) {
		if( !countitem(@use3) ) {
			mes "You don't have any "+getitemname(@use3)+".";
			close;
		}
	}
	else{
		if( !countitem(set(@use2,nItem(@typr,select("^FF3355Use normal Ore!^000000","^000088Use purified Ore!^000000"))))) {
			mes "You don't have any "+getitemname(@use2)+".";
			close;
		}
		set @use3,@use2;
	}
	return;
OnCon2:
	if(.Scroll) {
		if( @menu2==2 ) {
			if(!countitem(.Scroll)) {
				mes "You don't have a Protection Scroll.";
				close;
			}
		}else{
			if( select("^FF3355Go ahead without protection Scroll!^000000.","^000088Use Protection Scroll!^000000.")==2) {
				if(!countitem(.Scroll)) {
					mes "your don't have Protection Scroll.";
					close;
				}
			}else
				mes " ";
		}

	}
	set Zeny,Zeny-nZeny(@typr);

	if(.Scroll) {
		if( @menu==2 || @menu2==2 )
			if( @rate >= 100 )
				mes "100% of success, so automatically cancel using the protection scroll";
		else
			delitem .Scroll,1;
	}
	delitem @use2,1;
	
	if(.Scroll) {
		if( @menu==2 || @menu2==2 ) {
			if(@rate<rand(1,100)) {
				if(.back<0) {
					getitem2 getequipid(@typr),1,1,-(.back<-10?-10:.back),0,getequipcardid(@typr,0),getequipcardid(@typr,1),getequipcardid(@typr,2),getequipcardid(@typr,3);
					failedrefitem @typr;
					if( getequiprefinerycnt(@typr)+1 >= 7 )
						announce strcharinfo(0)+" tried to refine a +"+getequiprefinerycnt(@typr)+" "+getequipname(@typr)+" to +"+(getequiprefinerycnt(@typr)+1)+" and FAILED!",0;
					close;
				}
				else {
					set .@D,set(.@D,getequiprefinerycnt(@typr)-.back)<0?0:.@D;
					if(getequiprefinerycnt(@typr)<=10) {
						getitem2 getequipid(@typr),1,1,.@D,0,getequipcardid(@typr,0),getequipcardid(@typr,1),getequipcardid(@typr,2),getequipcardid(@typr,3);
						failedrefitem @typr;
						if( getequiprefinerycnt(@typr)+1 >= 7 )
							announce strcharinfo(0)+" tried to refine a +"+getequiprefinerycnt(@typr)+" "+getequipname(@typr)+" to +"+(getequiprefinerycnt(@typr)+1)+" and FAILED!",0;
						close;
					}
					else {
						while(getequiprefinerycnt(@typr)!=.@D) {
							successrefitem @typr;
							if( getequiprefinerycnt(@typr) >= 7 )
								announce strcharinfo(0)+" tried to refine a +"+( getequiprefinerycnt(@typr) -1 )+" "+getequipname(@typr)+" to +"+getequiprefinerycnt(@typr)+" and SUCCEED!",0;
						}
					}
				}
			}
			else {
				successrefitem @typr;
				if( getequiprefinerycnt(@typr) >= 7 )
					announce strcharinfo(0)+" tried to refine a +"+( getequiprefinerycnt(@typr) -1 )+" "+getequipname(@typr)+" to +"+getequiprefinerycnt(@typr)+" and SUCCEED!",0;
			}
			CHose(@use2,@menu);
		}
	}
	if(@rate<rand(1,100))
	{
		if( getequiprefinerycnt(@typr) >= 7 )
			announce strcharinfo(0)+" tried to refine a +"+getequiprefinerycnt(@typr)+" "+getequipname(@typr)+" to +"+(getequiprefinerycnt(@typr)+1)+" and FAILED!",0;
		failedrefitem @typr;
		close;
	}
	else {
		successrefitem @typr;
		if( getequiprefinerycnt(@typr) >= 7 )
			announce strcharinfo(0)+" tried to refine a +"+( getequiprefinerycnt(@typr) -1 )+" "+getequipname(@typr)+" to +"+getequiprefinerycnt(@typr)+" and SUCCEED!",0;
	}
	CHose(@use2,@menu);

// functions
// ---------
function nZeny {
	switch(getequipweaponlv(getarg(0))) {
		case 1:
			return 500;
		case 2:
			return 2000;
		case 0:
		case 3:
		case 4:
			return 5000;
		default:
			return 0;
	}
}

function nItem {
	if(getarg(1)==1){
		switch(getequipweaponlv(getarg(0))) {
			case 0:
				return 985;
			case 1:
				return 1010;
			case 2:
				return 1011;
			case 3:
			case 4:
				return 984;
			default:
				return 0;
		}
	} else {
		switch(getequipweaponlv(getarg(0))) {
			case 0:
				return 6241;
			case 1:
			case 2:
			case 3:
			case 4:
				return 6240;
			default:
				return 0;
		}
	}
}

function nRate {
	function aRate {
		return getarg(getarg(0,0)+1,0);
	}
	switch(getequipweaponlv(getarg(0))) {
		case 0:
			return aRate(getarg(1),
			100,100,100,100,60,
			40,40,20,20,10,
			50,30,20,10,10,
			10,10,10,10,10);
			
		case 1:
			return aRate(getarg(1),
			100,100,100,100,100,
			100,100,60,40,20,
			70,70,50,50,30,
			30,20,20,10,10);
			
		case 2:
			return aRate(getarg(1),
			100,100,100,100,100,
			100,60,40,20,20,
			70,50,50,30,30,
			20,20,10,10,10);
			
		case 3:
			return aRate(getarg(1),
			100,100,100,100,100,
			60,50,20,20,20,
			50,50,30,30,20,
			20,10,10,10,10);
			
		case 4:
			return aRate(getarg(1),
			100,100,100,100,60,
			40,40,20,20,10,
			50,30,30,20,20,
			10,10,10,10,10);
	}
}

function sRater {
	mes "[Successful rate]["+set(@rate,(nRate(@typr,getequiprefinerycnt(@typr))+(@use2>6000?10:0)))+"%]";
	return;
}

function CHose {
	set @menu2,@menu2?@menu2:@menu;
	set @use3,@use3?@use3:@use2;
	next;
	sRater;
	if( select("[^000088continue^000000]","[^FF3355End^000000]") == 2 )
		close;
	else
		callsub OnCon,1;
	callsub OnCon2;
}


OnInit:
	set .Scroll,7199;//'Protection Scroll' item id
	set .back,0;
	end;
}

 

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