Sign in to follow this  
Followers 0
Ragno

Add a Global Function to bring generical checkweight where needed

4 posts in this topic

Almost all the npcs makes checkweight checks prior to give items to players, but there are still some others that misses this checkquest and produces error in player's quest.

 

As an example, not too long it was added a custom checkweight to quest_13_2.txt script to avoid issues in player's quest when inventory is full.

 

So, what about introducing a global function to bring a generical checkweight to add to npcs with this problems? Generical message is this:

 

	if (checkweight(Knife,1) == 0 || MaxWeight - Weight < 1000) {
		mes "- Currently you're carrying -";
		mes "- too many items with you. -";
		mes "- Please try again after you -";
		mes "- lose some weight. -";
		close;
	}

And it also can be added an aditional argument to set specific weight values to check. This way it could bring easily those checks and also have a quick reference to know that check is custom.

Share this post


Link to post
Share on other sites

sometime, I just don't understand why must official server check for Knife or 1000 weight but not the target item/weight  :D

Share this post


Link to post
Share on other sites

sometime, I just don't understand why must official server check for Knife or 1000 weight but not the target item/weight  :D

 

Maybe they just have the template for it or it may be hard to search for specific values.

 

I'm actually working on this, mostly because the sign quest, we always have players who doesn't receive some quest items because inventory is full.

Share this post


Link to post
Share on other sites
callfunc( "F_CheckWeight", Knife, 1, 1000 );
function	F_CheckWeight	{
	[email protected] = getarg(0, Knife);
	[email protected] = getarg(1, 1);
	[email protected] = getarg(2, 1000);
	
	return (checkweight([email protected], [email protected]) && MaxWeight - Weight < [email protected]);
}

and

callfunc( "F_CheckWeight2", [email protected]_nameid, [email protected]_amount, 1000 );
function	F_CheckWeight2	{
	[email protected] = getarg(2, 1000);
	
	return (checkweight2(getarg(0), getarg(1)) && MaxWeight - Weight < [email protected]);
}

something like these i guess...

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
Sign in to follow this  
Followers 0