Jump to content

Question

Posted (edited)

Hey guys^^

 

I've got this script:

prt_in,63,60,4	script	Refiner	85,{

	set .Scroll,7199;//'Protection Scroll' item id

	set .back,0;
	//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;

	function	CHose	;
	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;
	}

	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;
					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;
						close;
					}else
						while(getequiprefinerycnt(@typr)!=.@D)successrefitem @typr;
				}
			}else
				successrefitem @typr;
			CHose(@use2,@menu);
		}
	}
	if(@rate<rand(1,100))
	{

		failedrefitem @typr;
		close;
	}else
		successrefitem @typr;
	CHose(@use2,@menu);
	
	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;
	}
}

It's an protection scroll refining script, where you can use protection scrolls so the item will not be destroyt when refining more then +4

 

 

 

and I want it to be edited so a announce will appear after the +7 of refining..

for example im gonna refine tidal shoes more than +7 = announce will appear: "[NAME] tried to refine his [EQUIP/WEAPON] to [REFINE GRADE] and [FAILED/SUCCEED]

can u help me please? :P

Edited by leertaste

17 answers to this question

Recommended Posts

Posted
prt_in,63,60,4    script    Refiner    85,{
    set .Scroll,7199;//'Protection Scroll' item id
    set .back,0;
    //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;

    function    CHose;
    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;
    }

    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;
                    announce strcharinfo(0)+" tried to refine a +"+getequiprefinerycnt(@typr)+" "+getequipname(@typr)+" to +"+(getequiprefinerycnt(@typr)+1)+" and FAILED!";
                    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;
                        announce strcharinfo(0)+" tried to refine a +"+getequiprefinerycnt(@typr)+" "+getequipname(@typr)+" to +"+(getequiprefinerycnt(@typr)+1)+" and FAILED!";
                        close;
                    }else
                        while(getequiprefinerycnt(@typr)!=.@D) {
                        successrefitem @typr;
                        announce strcharinfo(0)+" tried to refine a +"+getequiprefinerycnt(@typr)+" "+getequipname(@typr)+" to +"+(getequiprefinerycnt(@typr)+1)+" and SUCCEED!";
                        }
                }
            }else
                successrefitem @typr;
                CHose(@use2,@menu);
        }
    }
    if(@rate<rand(1,100))
    {
        announce strcharinfo(0)+" tried to refine a +"+getequiprefinerycnt(@typr)+" "+getequipname(@typr)+" to +"+(getequiprefinerycnt(@typr)+1)+" and FAILED!";
        failedrefitem @typr;
        close;
    }else
        successrefitem @typr;
        announce strcharinfo(0)+" tried to refine a +"+getequiprefinerycnt(@typr)+" "+getequipname(@typr)+" to +"+(getequiprefinerycnt(@typr)+1)+" and SUCCEED!";
        CHose(@use2,@menu);
    
    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;
    }
}
  • Upvote 1
Posted
prt_in,63,60,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;
}

nanakiwurtz made some error.

It works also with eA

Posted (edited)

nice that works :P

but where's the announce when it failed? :(((

 

ah i see it only appears, when the gear breaks =)
this sould appear also when i fail when using protection scroll^^

Edited by leertaste
Posted

Try to understand the script...

 

Search 
	if(getequiprefinerycnt(@typr)>=10) {
		mes "It's not possible to refine this better than +10.";
		close;
	}
To
	if(getequiprefinerycnt(@typr)>=20) {
		mes "It's not possible to refine this better than +20.";
		close;
	}
  • Upvote 1
Posted (edited)

thx alot bro :P

but i get the problem. when i have change it to 20.

 

when i want continue ++ my item. i had to cancel the npc and enter back. i cannot continue. why ? 

 

i can continue by spam the continue. and the npc are always success. OMG!   /wah

Edited by mrlongshen
Posted

shakto can u help me

with my problem??

 

Change all matchs between : if(.Scroll)

}

 

Find : 
failedrefitem @typr;

To
downrefitem @typr;

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...