Jump to content
  • 0

help with this script


donkeyg

Question


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

someone could do this? :

add an npc that exchanges card with random cards. example, any 10 cards for 1 random miniboss card, with 0.01%
chance of mvp card


bump

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

bum;pp

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

@Annie : 

 

F_RandMes is already outdated. it has been changed to F_Rand ( npc/other/Global_Functions.txt#L151 ) so most probably the topic starter will have an error if he is using later rA version

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

I will when i got home :P

Link to comment
Share on other sites

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.

×
×
  • Create New...