donkeyg Posted March 15, 2013 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Share Posted March 15, 2013 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 Quote Link to comment Share on other sites More sharing options...
Shakto Posted March 15, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 416 Reputation: 96 Joined: 02/07/13 Last Seen: Saturday at 01:08 PM Share Posted March 15, 2013 (edited) Just make a selling npc and add all id manually ? What do you want to say by "random" ? Edited March 15, 2013 by Shakto Quote Link to comment Share on other sites More sharing options...
donkeyg Posted March 19, 2013 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Author Share Posted March 19, 2013 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 Quote Link to comment Share on other sites More sharing options...
Shakto Posted March 19, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 416 Reputation: 96 Joined: 02/07/13 Last Seen: Saturday at 01:08 PM Share Posted March 19, 2013 (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 March 19, 2013 by Shakto Quote Link to comment Share on other sites More sharing options...
Capuche Posted March 19, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted March 19, 2013 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 Quote Link to comment Share on other sites More sharing options...
mrlongshen Posted March 21, 2013 Group: Members Topic Count: 98 Topics Per Day: 0.02 Content Count: 1302 Reputation: 79 Joined: 12/04/12 Last Seen: September 26, 2019 Share Posted March 21, 2013 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 ? Quote Link to comment Share on other sites More sharing options...
donkeyg Posted March 22, 2013 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Author Share Posted March 22, 2013 hmm.. errors Quote Link to comment Share on other sites More sharing options...
Capuche Posted March 22, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted March 22, 2013 (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 March 22, 2013 by Capuche 1 Quote Link to comment Share on other sites More sharing options...
donkeyg Posted March 23, 2013 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Author Share Posted March 23, 2013 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? Quote Link to comment Share on other sites More sharing options...
Capuche Posted March 25, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted March 25, 2013 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 completescript 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; Quote Link to comment Share on other sites More sharing options...
donkeyg Posted March 25, 2013 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Author Share Posted March 25, 2013 (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 March 25, 2013 by donkeyg Quote Link to comment Share on other sites More sharing options...
donkeyg Posted March 25, 2013 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Author Share Posted March 25, 2013 · Hidden by Emistry, March 26, 2013 - empty post ? Hidden by Emistry, March 26, 2013 - empty post ? Link to comment
Capuche Posted March 26, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted March 26, 2013 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 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. Quote Link to comment Share on other sites More sharing options...
donkeyg Posted March 28, 2013 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Author Share Posted March 28, 2013 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 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 Quote Link to comment Share on other sites More sharing options...
Capuche Posted March 28, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted March 28, 2013 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. Quote Link to comment Share on other sites More sharing options...
Question
donkeyg
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
Link to comment
Share on other sites
14 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.