• 0
eirwanda

Emistry Vendor Script

Question

Morning Rathena !!

I need some help with Emistry Vendor Script.

The main problem is, after using the box, the box are not appear again .....

 

 

OnSetup:
getmapxy( [email protected]$,[email protected],[email protected],UNITTYPE_NPC,"vend_slot"[email protected] );
set [email protected]$,strnpcinfo(0);
while( [email protected]$ != "" ){
	if( getareausers( [email protected]$,[email protected],[email protected],[email protected],[email protected] ) ){
		hideonnpc [email protected]$;
	}else{
		hideoffnpc [email protected]$;
	 	//specialeffect 313;
	}
//	sleep 100;
}
end;
}

Here's the full script :

Quote
sanctum_in,102,174,5	script	Vending Helper#1	757,{
for( set [email protected],1; [email protected] <= .count; set [email protected],[email protected] + 1 ){
	getmapxy( [email protected]$,[email protected],[email protected],1,"#vend_slot"[email protected] );
	if( !getareausers( .map$,[email protected],[email protected],[email protected],[email protected] ) && [email protected] > 1 && [email protected] > 1 ){
		set [email protected],[email protected] + 1;
		set [email protected]$,[email protected]$ + "Slot - "[email protected]+":";
	}else{
		set [email protected]$,[email protected]$ + ":";
	}
}

if( [email protected] ){
	mes "Dont have any available slot.";
}else if( !getskilllv("MC_VENDING") ){
	mes "You dont have ^0055FFVending Skill^000000.";
}else{
	mes "Available Slot : "[email protected];
	mes "Please select a slot to vending.";
	set [email protected],select( [email protected]$ );
	getmapxy( [email protected]$,[email protected],[email protected],1,"#vend_slot"[email protected] );
	if( [email protected] == 1 || [email protected] == 1 ){
		mes "This NPC at invalid location...";
	}else{
		warp [email protected]$,[email protected],[email protected];
		hideonnpc "#vend_slot"[email protected];
	}
}
close;

OnInit:
sleep 1000;
// Map for vending
set .map$,"sanctum_in";
setcell .map$,48,133,151,135,cell_novending,1;

// x and y horizone ..
setarray .x_line,83,89,95,104,110,116;
setarray .y_line,165,163,161,159,157,155,153,151,149,143,141,139,137,135,133,131,129,119,117,115,113,111,109,107,105,103,97,95,93,91,89,87,85,83;

set .x_line_size,getarraysize( .x_line );
set .y_line_size,getarraysize( .y_line );
set .count,1;
for( set [email protected],0; [email protected] < .x_line_size; set [email protected],[email protected] + 1 )
	for( set [email protected],0; [email protected] < .y_line_size; set [email protected],[email protected] + 1 )
		if( checkcell( .map$,.x_line[[email protected]],.y_line[[email protected]],cell_chkpass ) ){
			movenpc "#vend_slot"+.count,.x_line[[email protected]],.y_line[[email protected]];
			setcell .map$,.x_line[[email protected]],.y_line[[email protected]],.x_line[[email protected]],.y_line[[email protected]],cell_novending,0;
			set .count,.count + 1;
		}
npctalk "Vending Spot : "+.count;
donpcevent "::OnSetup";
end;
}

-	script	vend_slot	-1,{
getmapxy( [email protected]$,[email protected],[email protected],1 );
if( !getskilllv("MC_VENDING") ){
	mes "You dont have ^0055FFVending Skill^000000.";
}else if( getareausers( [email protected]$,[email protected],[email protected],[email protected],[email protected] ) ){
	mes "Someone already selected this spot.";
}else{
	mes "Spot : ^777777Available^000000";
	mes "^0055FF[ Vending Rules ]^000000";
	mes "^FF0000 ~ Use proper Shop Name.^000000";
	mes "^FF0000 ~ Never sell Junk/Gifts.^000000";
	mes " ";
	mes "^777777Player will failed to follow these will be punished.^000000";
	if( select( "Select this Spot","Cancel" ) == 1 ){
		warp [email protected]$,[email protected],[email protected];
		hideonnpc strnpcinfo(0);
	}
}
close;

OnSetup:
getmapxy( [email protected]$,[email protected],[email protected],UNITTYPE_NPC,"vend_slot"[email protected] );
set [email protected]$,strnpcinfo(0);
while( [email protected]$ != "" ){
	if( getareausers( [email protected]$,[email protected],[email protected],[email protected],[email protected] ) ){
		hideonnpc [email protected]$;
	}else{
		hideoffnpc [email protected]$;
//	 	specialeffect 313;
	}
//	sleep2 100;
}
end;
}

// Add more if needed.
sanctum_in,1,1,5	duplicate(vend_slot)	#vend_slot1	858
sanctum_in,1,1,5	duplicate(vend_slot)	#vend_slot2	858
sanctum_in,1,1,5	duplicate(vend_slot)	#vend_slot3	858

 

Thanks in advance /thx/thx 

Edited by eirwanda
Adding full script

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

i believe your script already hit some error like infinity loop since you removed this line from the script.

//	sleep 100;

uncomment it

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now