Jump to content
  • 0
Dolphincute

Script Error : script:set_reg: failed to set param 'Zeny' to -100.

Question

Hello guys i need some expert help with this script, it was provided by Emistry from rAthena

as i request it from there, but i had bumped to error when testing here are the error details :

 

script:set_reg: failed to set param 'Zeny' to -100.

 

and here is a copy of the whole script : http://upaste.me/r/7216df

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Find this:

if ( Zeny < $rent_cost ) close;

Change to:

if ( Zeny < $rental_cost ) close;

 

Was just a small typo. It was checking to see if your Zeny was less than the variable, if so do nothing. However, the variable it was checking was 0. So it'd say you had enough zeny and then attempted to subtract some. Easy mistake, easy fix.

Share this post


Link to post
Share on other sites
  • 0

Find this:

if ( Zeny < $rent_cost ) close;

Change to:

if ( Zeny < $rental_cost ) close;

 

Was just a small typo. It was checking to see if your Zeny was less than the variable, if so do nothing. However, the variable it was checking was 0. So it'd say you had enough zeny and then attempted to subtract some. Easy mistake, easy fix.

 

 

 

You may also want to fix this one line too:

 

dispbottom "Healing Cost: "+$rent_cost+" Zeny";

 

thanks for the fast reply i will check them now

 

Question what if i want to make a duplicate of this npc but each npc has diffrents owners?

for all town map and dungen?

Edited by Dolphincute

Share this post


Link to post
Share on other sites
  • 0
prontera,155,181,5	script	Healer#rent	757,{	// item to rent NPC	.@item_id = 7539;	// rent NPC for how many days	.@rent_day = 30;		.@aid = getcharid(3);	if ( getd(".rent_aid"+strnpcinfo(3)+"") && getd(".rent_duration"+strnpcinfo(3)+"") > gettimetick(2) ) {			if ( getd(".rent_aid"+strnpcinfo(3)+"") == .@aid ) {			if ( select( "Continue","Set Healer Cost","Collect Zeny" ) == 2 ) {				input .@rental_cost;				setd ".rental_cost"+strnpcinfo(3)+"", .@rental_cost;			}			else if ( @menu == 3 ) {				Zeny += getd(".rental_accumulate"+strnpcinfo(3)+"");				dispbottom "Collected "+getd(".rental_accumulate"+strnpcinfo(3)+"")+" Zeny";				setd ".rental_accumulate"+strnpcinfo(3)+"", 0;			}		}				if ( getd(".rental_cost"+strnpcinfo(3)+"") ) {			dispbottom "Healing Cost: "+getd(".rental_cost"+strnpcinfo(3)+"")+" Zeny";			if ( Zeny < getd(".rental_cost"+strnpcinfo(3)+"") ) close;						Zeny -= getd(".rental_cost"+strnpcinfo(3)+"");			$rental_accumulate += getd(".rental_cost"+strnpcinfo(3)+"");		}				percentheal 100,100;		// your desired buff heres			}	else if ( countitem( .@item_id ) ) {		mes "Rent Healer NPC ?";		mes "Rental Cost: 1 x "+getitemname( .@item_id );				if ( select( "Yes","No" ) == 1 ) {			delitem .@item_id,1;			setd ".rent_aid"+strnpcinfo(3)+"", .@aid;			setd ".rent_duration"+strnpcinfo(3)+"", gettimetick(2) + ( .@rent_day * 86400 ); 			mes "NPC belong to you.";		}	}	else {		mes "NPC isnt available.";		mes "Rental Cost: 1 x "+getitemname( .@item_id );	}	close;}

Share this post


Link to post
Share on other sites
  • 0

 

prontera,155,181,5	script	Healer#rent	757,{	// item to rent NPC	.@item_id = 7539;	// rent NPC for how many days	.@rent_day = 30;		.@aid = getcharid(3);	if ( getd(".rent_aid"+strnpcinfo(3)+"") && getd(".rent_duration"+strnpcinfo(3)+"") > gettimetick(2) ) {			if ( getd(".rent_aid"+strnpcinfo(3)+"") == .@aid ) {			if ( select( "Continue","Set Healer Cost","Collect Zeny" ) == 2 ) {				input .@rental_cost;				setd ".rental_cost"+strnpcinfo(3)+"", .@rental_cost;			}			else if ( @menu == 3 ) {				Zeny += getd(".rental_accumulate"+strnpcinfo(3)+"");				dispbottom "Collected "+getd(".rental_accumulate"+strnpcinfo(3)+"")+" Zeny";				setd ".rental_accumulate"+strnpcinfo(3)+"", 0;			}		}				if ( getd(".rental_cost"+strnpcinfo(3)+"") ) {			dispbottom "Healing Cost: "+getd(".rental_cost"+strnpcinfo(3)+"")+" Zeny";			if ( Zeny < getd(".rental_cost"+strnpcinfo(3)+"") ) close;						Zeny -= getd(".rental_cost"+strnpcinfo(3)+"");			$rental_accumulate += getd(".rental_cost"+strnpcinfo(3)+"");		}				percentheal 100,100;		// your desired buff heres			}	else if ( countitem( .@item_id ) ) {		mes "Rent Healer NPC ?";		mes "Rental Cost: 1 x "+getitemname( .@item_id );				if ( select( "Yes","No" ) == 1 ) {			delitem .@item_id,1;			setd ".rent_aid"+strnpcinfo(3)+"", .@aid;			setd ".rent_duration"+strnpcinfo(3)+"", gettimetick(2) + ( .@rent_day * 86400 ); 			mes "NPC belong to you.";		}	}	else {		mes "NPC isnt available.";		mes "Rental Cost: 1 x "+getitemname( .@item_id );	}	close;}

 

sir could you add GM menu so that GM can reset npc?

like if GM lvl 99 goto GM menu? sorry i dont know how to add reset commands

 

is this correct to add a another rent healer?

 

prontera,155,181,5	script	Healer#rent1	757,{

 

found error with GmOcean modifty script :

 

[Warning]: Incorrect use of 'close' command! (source:Healer#rent / path:npc/basi                                                               cnpc/renthealer.txt)
Edited by Dolphincute

Share this post


Link to post
Share on other sites
  • 0

I can't reproduce your problem. Something else must be going on. Also it seems your original script was charging the owner zeny even if they were just changing the settings. This included collecting zeny. Resulting in getting 1 payment less. I cleaned that issue up.

prontera,155,181,5	script	Healer#rent	757,{	// item to rent NPC	.@item_id = 7539;	// rent NPC for how many days	.@rent_day = 30;		.@aid = getcharid(3);	if ( getd(".rent_aid"+strnpcinfo(3)+"") && getd(".rent_duration"+strnpcinfo(3)+"") > gettimetick(2) ) {			if ( getd(".rent_aid"+strnpcinfo(3)+"") == .@aid ) {			if ( select( "Continue","Set Healer Cost","Collect Zeny" ) == 2 ) {				input .@rental_cost;				setd ".rental_cost"+strnpcinfo(3)+"", .@rental_cost;			}			else if ( @menu == 3 ) {				Zeny += getd(".rental_accumulate"+strnpcinfo(3)+"");				dispbottom "Collected "+getd(".rental_accumulate"+strnpcinfo(3)+"")+" Zeny";				setd ".rental_accumulate"+strnpcinfo(3)+"", 0;			close;			}		}				if ( getd(".rental_cost"+strnpcinfo(3)+"") ) {			dispbottom "Healing Cost: "+getd(".rental_cost"+strnpcinfo(3)+"")+" Zeny";			if ( Zeny < getd(".rental_cost"+strnpcinfo(3)+"") ) close;						Zeny -= getd(".rental_cost"+strnpcinfo(3)+"");			setd ".rental_accumulate"+strnpcinfo(3)+"", getd(".rental_accumulate"+strnpcinfo(3)+"") + getd(".rental_cost"+strnpcinfo(3)+"");		}				percentheal 100,100;		// your desired buff heres			}	else if ( countitem( .@item_id ) ) {		mes "Rent Healer NPC ?";		mes "Rental Cost: 1 x "+getitemname( .@item_id );				if ( select( "Yes","No" ) == 1 ) {			delitem .@item_id,1;			setd ".rent_aid"+strnpcinfo(3)+"", .@aid;			setd ".rent_duration"+strnpcinfo(3)+"", gettimetick(2) + ( .@rent_day * 86400 ); 			mes "NPC belong to you.";		}	}	else {		mes "NPC isnt available.";		mes "Rental Cost: 1 x "+getitemname( .@item_id );	}	close;}prontera,155,181,5	duplicate(rent)	Healer#rent1	757

 

As for duplicates check the bottom of the script for the syntax.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.