Register for your free account! | Forgot your password?

You last visited: Today at 08:34

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help]Randoms

Discussion on [Help]Randoms within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
[Help]Randoms

could someone help me with making a random for moonboxes so that when they open a moonbox it gives random items from a txt file.
coreymills is offline  
Old 02/08/2010, 00:14   #2
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
Just use,

Code:
#region MoonBox2
                    case 721080:
                        {
                            Random R = new Random(); // New Random
                            int Nr = R.Next(1, 6); // "Randomally" Picks a number 1-10 
                            if (Nr == 1) //Random Spot 1
                            {
                                AddItem(111006);//Helm
                                RemoveItem(I);
                            }
                            if (Nr == 2) //Random Spot 2
                            {
                                AddItem(112058);//Veil
                                RemoveItem(I);
                            }
                            if (Nr == 3) //Random Spot 3
                            {
                                AddItem(720027);//MetScroll
                                RemoveItem(I);
                            }
                            if (Nr == 4) //Random Spot 4
                            {
                                AddItem(723711);//met Tear Pack
                                RemoveItem(I);
                            }
                            if (Nr == 5) //Random Spot 5
                            {
                                AddItem(723700);//Exp Ball
                                RemoveItem(I);
                            }
                            if (Nr == 6) //Random Spot 6
                            {
                                AddItem(723584);//Black Tulip
                                RemoveItem(I);
                            }
                            break;
                        }
                    #endregion
-Shunsui- is offline  
Thanks
1 User
Old 02/08/2010, 00:24   #3
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
question solved
#request Close
coreymills is offline  
Old 02/08/2010, 03:07   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,377
Why on earth would you want a script like that where you only get a pre-specified item?

Take advantage of the item type already loaded and select random equipment/armor from that

random code snippet from a co emu based source

Code:
List<Struct.ItemData> ItemData = new List<Struct.ItemData>();
                        foreach (KeyValuePair<int, Struct.ItemData> Items in Nano.Items)
                            ItemData.Add(Items.Value);
Setup the item stats and use something like

Code:
Item.ItemID = Nano.Rand.Next(111003, 601339);
                            while (!Nano.Items.ContainsKey(Item.ItemID))
                                Item.ItemID = Nano.Rand.Next(111003, 601339);
to select a random item id between 111003, 601339. If it doesn't exist in the loaded items, it tries again.

Do a calculation to get the base item (knock off the final digit) and use a percent success calculation to re-attach an item quality (1-9)

Other info such as sockets/+/bless can be done in the exact same way (seeing as you already have the item structure, you are just filling in the fields and then adding the item.
pro4never is offline  
Old 02/08/2010, 03:15   #5
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
i hardly know any C# i'm still learning what Shunshi gave is perfect for a beginner like me
coreymills is offline  
Reply


Similar Threads Similar Threads
[RELEASE] 9900 Clovers,Randoms and TownPortal Vendor
03/21/2010 - EO PServer Guides & Releases - 11 Replies
Hi, I'm Murtah and I want to release this NPC in Market that will sell a 9900 Pack of RandomPortals, EudemonClovers and TownPortals. Just run this sql Script and restart your server. Dont forget to give Thanks if you like it =P I'll have some Translations coming later today. Enjoy! Ive added 9900 Universals to the NPC now, Please Redownload. Thanks revolution263
Anyone Using RSBOT - randoms do not work
03/01/2009 - Runescape - 0 Replies
pretty sure if you you use rbsot you should already know but just in case: as of right now anyone using rsbot should note that the randoms do not work, because of the new updates, yes rsbot does work,but scripts for the randoms are out of date just warning you in case you don't know
TQ's randoms (lottery, sockets, drops, etc)
12/04/2008 - Conquer Online 2 - 11 Replies
ok well ive been trying to think of ways to "beat the system" so to speak. I've been looking into the source for generic C random num generators (who would write a game in a different language?). Essentially if they wrote the game using windows then theres still a chance, but if they were using linux, and used the generic linux rand num generator then there's no way. I'm planning on writing a program to monitor the packets from conquer (since i dont have a translator for their chat logs) and...
Randoms mischen?
03/06/2008 - Guild Wars - 4 Replies
Hi, das is mein erster Post und ich hätte gleich ne frage :o ^^ Ich gucke mich jetzt schon seit ner weile hier im forum um und beschäftige mich so n bisschen mit autoIT nicht des geldes wegen, sondern weils mir einfach spaß macht, an sowas zu basteln und dann zu sehen, dass es geht :) Jetzt mach ich mir gerade ein simples Säufermacro (nicht, dass der DrunkenMaster von guild_wars_gamer schlecht wäre - der ist sogar ziemlich geil^^ - aber mir macht das Basteln halt spaß) und bin bis jetzt so...



All times are GMT +2. The time now is 08:34.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.