Jump to content
  • 0

help with this script


Question

5 answers to this question

Recommended Posts

Posted (edited)

I think the hard part about this script is the cards are stackable
if I have 2 poring card and 1 drops card,
the script needs to convert into 1 poring card + 1 poring card + 1 drops card ... in order to get your any 10 cards condition
 

prontera,150,188,5	script	kjhdfkjsdhf	100,{
	getinventorylist;
	while ( .@i < @inventorylist_count ) {
		if ( getiteminfo( @inventorylist_id[.@i], 2 ) == IT_CARD ) {
			.@j = 0;
			while ( .@j < @inventorylist_amount[.@i] ) {
				.@card[.@c] = @inventorylist_id[.@i];
				.@c++;
				if ( .@c >= 10 ) break;
				.@j++;
			}
		}
		if ( .@c >= 10 ) break;
		.@i++;
	}
	if ( .@c < 10 ) {
		mes "you have less than 10 cards";
		close;
	}
//	for ( .@i = 0; .@i < .@c; .@i++ )
//		mes getitemname( .@card[.@i] );
	for ( .@i = 0; .@i < 10; .@i++ )
		delitem .@card[.@i], 1;
	if ( rand(10000) )
		getitem callfunc( "F_Rand", 4054,4241,4391,4428,4426,4290,4300,4392,4397,4174,4398,4179,4266,4451,4250,4423,4354,4047,4163,4384,4431,4394,4395,4197,4198,4393,4203,4207,4440,4396,4254,4238,4237,4429,4406,4427,4306,4183 ), 1;
	else
		getitem callfunc( "F_Rand", 4236,4359,4425,4145,4168,4386,4142,4134,4137,4123,4330,4441,4352,4408,4128,4324,4363,4365,4430,4403,4419,4376,4357,4276,4361,4146,4399,4132,4131,4143,4135,4144,4148,4121,4407,4342,4263,4367,4318,4302,4305,4374,4372 ), 1;
	close;
}

EDIT:
thx to post below

Edited by Capuche
F_Rand doesn't need the arg count
Posted (edited)

ahhh ... I just realise I still have F_RandMes in my old script

no wonder my map-server didn't throw error at me ...

can you pls update this pinned topic and change it into F_Rand ?

not feeling like applying for scripting mod at the moment ...

and how the developer can simply change a popular command as they like ...

... many scripts going to break =/

changed F_RandMes into F_Rand, but didn't change F_SexMes into F_Sex ... /hum

Edited by AnnieRuru

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