Jump to content

Question

Posted

i would like to request a  NPC would give random ALL random headgears from ratemyserver (but not the newest, newest might makes error). Each gamble which cost 1 mil

14 answers to this question

Recommended Posts

Posted (edited)

Just make a selling npc and add all id manually ?

 

What do you want to say by "random" ?

Edited by Shakto
Posted

Just make a selling npc and add all id manually ?

 

What do you want to say by "random" ?

? random headgears.. not selling item.. it's like gamble, give u random headgears item

Posted (edited)

It's something like this :

 

I let you fill the end, it's simple.

 

setarray .@Hat$[0],5105,5106,5407; // You write all the id of hats here (50 pages on ratesmyserver gl )
set .@price,1000000;

set .@resrand,rand(xx); //xx is the number of id you added

if( Zeny > .@price ) {
         set Zeny, Zeny - .@price;
         getitem .@Hat$[.@resrand],1;
}
else {
         message strcharinfo(0),"I'll need " + .@price + " zeny to have your random hat";
}
Edited by Shakto
Posted
prontera,150,182,5	script	vbgnhjkl	56,{

	mes "gamble ?";
	next;
	if( select( "Yes", "No" ) -1 ) close;
	else if( Zeny < .cost ) {
		mes "you need "+ .cost +" Zeny";
		close;
	}
	do
		.@r = rand( .min_hat_id, .max_hat_id );
	while( ( getiteminfo( .@r,5 )&.hat_type ) == 0 || compare( .black_list$, .@r +"" ) );
	mes "here a "+ getitemname( .@r ) +" (ID: "+ .@r +")";
	getitem .@r, 1;
	Zeny -= .cost;
	close;
	
	
OnInit:
	.cost = 1000000; // Zeny gamble
	.max_hat_id = 5859;
	.min_hat_id = 5001;
	.hat_type = 1|256|512; // low + middle + head type hat
	set .black_list$, "5005|5006|5007"; // black list ID
	end;
}

Try this

Posted
prontera,150,182,5	script	vbgnhjkl	56,{

	mes "gamble ?";
	next;
	if( select( "Yes", "No" ) -1 ) close;
	else if( Zeny < .cost ) {
		mes "you need "+ .cost +" Zeny";
		close;
	}
	do
		.@r = rand( .min_hat_id, .max_hat_id );
	while( ( getiteminfo( .@r,5 )&.hat_type ) == 0 || compare( .black_list$, .@r +"" ) );
	mes "here a "+ getitemname( .@r ) +" (ID: "+ .@r +")";
	getitem .@r, 1;
	Zeny -= .cost;
	close;
	
	
OnInit:
	.cost = 1000000; // Zeny gamble
	.max_hat_id = 5859;
	.min_hat_id = 5001;
	.hat_type = 1|256|512; // low + middle + head type hat
	set .black_list$, "5005|5006|5007"; // black list ID
	end;
}

Try this

 

how to use this for usable item, or etc item ? can u help me ?

Posted (edited)
how to use this for usable item, or etc item ? can u help me ?

 

 

Change this part in the setting

	.max_hat_id = 5859; // max ID
	.min_hat_id = 5001; // min ID range
	.hat_type = 1|256|512; // delete this variable

( delete .hat_type )

 

 

and

while( ( getiteminfo( .@r,5 )&.hat_type ) == 0 || compare( .black_list$, .@r +"" ) );

to

while( getiteminfo( .@r,2 ) != 2 || compare( .black_list$, .@r +"" ) );

for Usable item

 

 

or

while( getiteminfo( .@r,2 ) != 3 || compare( .black_list$, .@r +"" ) );

for Etc item

 

or

while( ( getiteminfo( .@r,2 ) != 2 && getiteminfo( .@r,2 ) != 3 ) || compare( .black_list$, .@r +"" ) );

for etc + usable

 

 

 

according to the table

Type: 
	0	Healing item.
	2	Usable item.
	3	Etc item
	4	Weapon
	5	Armor/Garment/Boots/Headgear
	6	Card
	7	Pet egg
	8	Pet equipment
	10	Ammo (Arrows/Bullets/etc)
	11	Usable with delayed consumption (item is lost from inventory
		after selecting a target, for use with skills and pet lures)
	18	Another delayed consume that requires user confirmation before
		using item.

 

 

@donkeyg

What kind of error ?

Edited by Capuche
  • Upvote 1
Posted

 

how to use this for usable item, or etc item ? can u help me ?

 

 

Change this part in the setting

	.max_hat_id = 5859; // max ID
	.min_hat_id = 5001; // min ID range
	.hat_type = 1|256|512; // delete this variable

( delete .hat_type )

 

 

and

while( ( getiteminfo( .@r,5 )&.hat_type ) == 0 || compare( .black_list$, .@r +"" ) );

to

while( getiteminfo( .@r,2 ) != 2 || compare( .black_list$, .@r +"" ) );

for Usable item

 

 

or

while( getiteminfo( .@r,2 ) != 3 || compare( .black_list$, .@r +"" ) );

for Etc item

 

or

while( ( getiteminfo( .@r,2 ) != 2 && getiteminfo( .@r,2 ) != 3 ) || compare( .black_list$, .@r +"" ) );

for etc + usable

 

 

 

according to the table

Type: 
	0	Healing item.
	2	Usable item.
	3	Etc item
	4	Weapon
	5	Armor/Garment/Boots/Headgear
	6	Card
	7	Pet egg
	8	Pet equipment
	10	Ammo (Arrows/Bullets/etc)
	11	Usable with delayed consumption (item is lost from inventory
		after selecting a target, for use with skills and pet lures)
	18	Another delayed consume that requires user confirmation before
		using item.

 

 

@donkeyg

What kind of error ?

my bad. no errors lol.. btw, im confuse ... can u give me a complete script that can gives usable item/etc item and other weapon/armors please?

Posted

prontera,150,182,5	script	vbgnhjkl	56,{

	mes "gamble ?";
	next;
	if( select( "Yes", "No" ) -1 ) close;
	else if( Zeny < .cost ) {
		mes "you need "+ .cost +" Zeny";
		close;
	}
	do {
		.@r = rand( .min_hat_id, .max_hat_id );
		for( .@i = 0; .@i < .size_type; .@i++ ) {
			.@c = ( .item_Type[.@i] != 5 ? getiteminfo( .@r,2 ) == .item_Type[.@i] : ( getiteminfo( .@r,5 )&.hat_equip ) != 0 );
			if( .@c && !compare( .black_list$, .@r +"" ) ) {
				.@fullfit++;
				break;
			}
			else if( .@count == 100 ) {
				mes "I don't find any item !";
				close;
			}
			else
				.@count++;
		}
	}
	while( !.@fullfit );
	mes "here a "+ getitemname( .@r ) +" (ID: "+ .@r +")";
	getitem .@r, 1;
	Zeny -= .cost;
	close;
	
	
OnInit:
	.cost = 1000000; // Zeny gamble
	.max_hat_id = 5859;
	.min_hat_id = 5001;
	.hat_equip = 1|256|512; // low + middle + head type hat - .item_Type must contain type 5
	setarray .item_Type, 0, 2, 4;
	.size_type = getarraysize( .item_Type );
	set .black_list$, "5005|5006|5007"; // black list ID
	end;
}

// Type: 
	// 0	Healing item.
	// 2	Usable item.
	// 3	Etc item
	// 4	Weapon
	// 5	Armor/Garment/Boots/Headgear
	// 6	Card
	// 7	Pet egg
	// 8	Pet equipment
	// 10	Ammo (Arrows/Bullets/etc)
	// 11	Usable with delayed consumption (item is lost from inventory
		// after selecting a target, for use with skills and pet lures)
	// 18	Another delayed consume that requires user confirmation before
		// using item.

my bad. no errors lol.. btw, im confuse ... can u give me a complete

script that can gives usable item/etc item and other weapon/armors

please?

 

 

 

Set your setting here

OnInit:
	.cost = 1000000; // Zeny gamble
	.max_hat_id = 5859;
	.min_hat_id = 5001;
	.hat_equip = 1|256|512; // low + middle + head type hat - .item_Type must contain type 5
	setarray .item_Type, 0, 2, 4;
	.size_type = getarraysize( .item_Type );
	set .black_list$, "5005|5006|5007"; // black list ID
	end;

with the Type of item you want to give (etc, usable item...)

 

setarray .item_Type, 0, 2, 4;

following

// Type:

    // 0    Healing item.

    // 2    Usable item.

    // 3    Etc item

    // 4    Weapon

    // 5    Armor/Garment/Boots/Headgear

    // 6    Card

    // 7    Pet egg

    // 8    Pet equipment

    // 10    Ammo (Arrows/Bullets/etc)

    // 11    Usable with delayed consumption (item is lost from inventory

        // after selecting a target, for use with skills and pet lures)

    // 18    Another delayed consume that requires user confirmation before

        // using item.

 

 

 

 

And think about the range of item ID

	.max_hat_id = 5859;
	.min_hat_id = 5001;

If you want an item Type usable but there aren't usable item in the range of item ID, the npc tell you it doesn't find any item.

 

Resumed: the main setting are

	.max_hat_id = 5859;
	.min_hat_id = 5001;
    setarray .item_Type, 0, 2, 4;
Posted (edited)

Thanks for your explaination Capuche

Can i start it from #itemID 2000 ~ #item 5859 ? , but i wan to skip the item id from #3000 ~ #4000

 

and also  i set

    setarray .item_Type, 5;
 

 

but why still give cards? i wan the npc give Upper headgears only. ^^

 

 

also, can i make it only have 10% chance success to get a random gears? because i spam 300m , i can get 28 headgears,

Edited by donkeyg
Posted

but i wan to skip the item id from #3000 ~ #4000

	.black_range_max = 3000;
	.black_range_min = 4000;

 

but why still give cards? i wan the npc give Upper headgears only. ^^

.hat_equip = 256; // upper type hat only - .item_Type must contain type 5

set also this

I don't get card on my local server /hmm

 

 

 

can i make it only have 10% chance success to get a random gears?

Done

prontera,150,182,5	script	vbgnhjkl	56,{

	if( .max_hat_id < .min_hat_id ) {
		mes "wrong range";
		close;
	}
	mes "gamble ?";
	next;
	if( select( "Yes", "No" ) -1 ) close;
	else if( Zeny < .cost ) {
		mes "you need "+ .cost +" Zeny";
		close;
	}
	if( rand(10) ) {
		mes "Sorry you don't get anything !";
		close;
	}
	do {
		.@r = rand( .min_hat_id, .max_hat_id );
		if( .@r < .black_range_min || .@r > .black_range_max ) {
			for( .@i = 0; .@i < .size_type; .@i++ ) {
				.@c = ( .item_Type[.@i] != 5 ? getiteminfo( .@r,2 ) == .item_Type[.@i] : ( getiteminfo( .@r,5 )&.hat_equip ) != 0 );
				if( .@c && !compare( .black_list$, .@r +"" ) && getiteminfo( .@r,2 ) != -1 ) {
					.@fullfit++;
					break;
				}
				else if( .@count == 100 ) {
					mes "I don't find any item !";
					close;
				}
				else
					.@count++;
			}
		}
	}
	while( !.@fullfit );
	mes "here a "+ getitemname( .@r ) +" (ID: "+ .@r +")";
	getitem .@r, 1;
	Zeny -= .cost;
	close;
	
	
OnInit:
	.cost = 1000000; // Zeny gamble
	.max_hat_id = 5859;
	.min_hat_id = 2000;
	.black_range_max = 3000;
	.black_range_min = 4000;
	.hat_equip = 1|256|512; // low + middle + head type hat - .item_Type must contain type 5
	setarray .item_Type, 5;
	.size_type = getarraysize( .item_Type );
	set .black_list$, "5005|5006|5007"; // black list ID
	end;
}

// Type: 
	// 0	Healing item.
	// 2	Usable item.
	// 3	Etc item
	// 4	Weapon
	// 5	Armor/Garment/Boots/Headgear
	// 6	Card
	// 7	Pet egg
	// 8	Pet equipment
	// 10	Ammo (Arrows/Bullets/etc)
	// 11	Usable with delayed consumption (item is lost from inventory
		// after selecting a target, for use with skills and pet lures)
	// 18	Another delayed consume that requires user confirmation before
		// using item.

Posted

but i wan to skip the item id from #3000 ~ #4000

	.black_range_max = 3000;
	.black_range_min = 4000;

 

>but why still give cards? i wan the npc give Upper headgears only. ^^

.hat_equip = 256; // upper type hat only - .item_Type must contain type 5

set also this

I don't get card on my local server /hmm

 

 

 

can i make it only have 10% chance success to get a random gears?

Done

prontera,150,182,5	script	vbgnhjkl	56,{

	if( .max_hat_id < .min_hat_id ) {
		mes "wrong range";
		close;
	}
	mes "gamble ?";
	next;
	if( select( "Yes", "No" ) -1 ) close;
	else if( Zeny < .cost ) {
		mes "you need "+ .cost +" Zeny";
		close;
	}
	if( rand(10) ) {
		mes "Sorry you don't get anything !";
		close;
	}
	do {
		.@r = rand( .min_hat_id, .max_hat_id );
		if( .@r < .black_range_min || .@r > .black_range_max ) {
			for( .@i = 0; .@i < .size_type; .@i++ ) {
				.@c = ( .item_Type[.@i] != 5 ? getiteminfo( .@r,2 ) == .item_Type[.@i] : ( getiteminfo( .@r,5 )&.hat_equip ) != 0 );
				if( .@c && !compare( .black_list$, .@r +"" ) && getiteminfo( .@r,2 ) != -1 ) {
					.@fullfit++;
					break;
				}
				else if( .@count == 100 ) {
					mes "I don't find any item !";
					close;
				}
				else
					.@count++;
			}
		}
	}
	while( !.@fullfit );
	mes "here a "+ getitemname( .@r ) +" (ID: "+ .@r +")";
	getitem .@r, 1;
	Zeny -= .cost;
	close;
	
	
OnInit:
	.cost = 1000000; // Zeny gamble
	.max_hat_id = 5859;
	.min_hat_id = 2000;
	.black_range_max = 3000;
	.black_range_min = 4000;
	.hat_equip = 1|256|512; // low + middle + head type hat - .item_Type must contain type 5
	setarray .item_Type, 5;
	.size_type = getarraysize( .item_Type );
	set .black_list$, "5005|5006|5007"; // black list ID
	end;
}

// Type: 
	// 0	Healing item.
	// 2	Usable item.
	// 3	Etc item
	// 4	Weapon
	// 5	Armor/Garment/Boots/Headgear
	// 6	Card
	// 7	Pet egg
	// 8	Pet equipment
	// 10	Ammo (Arrows/Bullets/etc)
	// 11	Usable with delayed consumption (item is lost from inventory
		// after selecting a target, for use with skills and pet lures)
	// 18	Another delayed consume that requires user confirmation before
		// using item.

 

 

=.= it minus my zeny if i get the item.. it didnt minus my zeny if i didnt get the item lol

Posted

You're right ><

 

prontera,150,182,5	script	vbgnhjkl	56,{

	if( .max_hat_id < .min_hat_id ) {
		mes "wrong range";
		close;
	}
	mes "gamble ?";
	next;
	if( select( "Yes", "No" ) -1 ) close;
	else if( Zeny < .cost ) {
		mes "you need "+ .cost +" Zeny";
		close;
	}
	Zeny -= .cost;
	if( rand(10) ) {
		mes "Sorry you don't get anything !";
		close;
	}
	do {
		.@r = rand( .min_hat_id, .max_hat_id );
		if( .@r < .black_range_min || .@r > .black_range_max ) {
			for( .@i = 0; .@i < .size_type; .@i++ ) {
				.@c = ( .item_Type[.@i] != 5 ? getiteminfo( .@r,2 ) == .item_Type[.@i] : ( getiteminfo( .@r,5 )&.hat_equip ) != 0 );
				if( .@c && !compare( .black_list$, .@r +"" ) && getiteminfo( .@r,2 ) != -1 ) {
					.@fullfit++;
					break;
				}
				else if( .@count == 100 ) {
					mes "I don't find any item !";
					close;
				}
				else
					.@count++;
			}
		}
	}
	while( !.@fullfit );
	mes "here a "+ getitemname( .@r ) +" (ID: "+ .@r +")";
	getitem .@r, 1;
	close;
	
	
OnInit:
	.cost = 1000000; // Zeny gamble
	.max_hat_id = 5859;
	.min_hat_id = 2000;
	.black_range_max = 3000;
	.black_range_min = 4000;
	.hat_equip = 1|256|512; // low + middle + head type hat - .item_Type must contain type 5
	setarray .item_Type, 5;
	.size_type = getarraysize( .item_Type );
	set .black_list$, "5005|5006|5007"; // black list ID
	end;
}

// Type: 
	// 0	Healing item.
	// 2	Usable item.
	// 3	Etc item
	// 4	Weapon
	// 5	Armor/Garment/Boots/Headgear
	// 6	Card
	// 7	Pet egg
	// 8	Pet equipment
	// 10	Ammo (Arrows/Bullets/etc)
	// 11	Usable with delayed consumption (item is lost from inventory
		// after selecting a target, for use with skills and pet lures)
	// 18	Another delayed consume that requires user confirmation before
		// using item.

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