[Coemu]Dis City map..

09/03/2009 19:54 1supertao#1
Im adding DisCity.. but i need soul stones to ONLY drop in the 2021 Map.. or need sertain monsters to drop items... can someone give me a code.. so i can make it by map.. or monster name



Would this be correct?

Code:
                if (Calculation.PercentSuccess(20))
                {
                    Struct.ItemGround IG = new Struct.ItemGround();
                    if (Calculation.PercentSuccess(20))
                        IG.ItemID = 723085;
                    else
                        IG.ItemID = 729911;
                    [COLOR="Red"]IG.Map = 2021;[/COLOR]
                    IG.X = (X - Nano.Rand.Next(4) + Nano.Rand.Next(4));
                    IG.Y = (Y - Nano.Rand.Next(4) + Nano.Rand.Next(4));
                    if (Nano.Maps.ContainsKey(IG.Map))
                    {
                        Struct.DmapData Mapping = Nano.Maps[IG.Map];
                        byte tries = 0;
                        while (!Mapping.CheckLoc((ushort)IG.X, (ushort)IG.Y))
                        {
                            IG.X = (X - Nano.Rand.Next(4) + Nano.Rand.Next(4));
                            IG.Y = (Y - Nano.Rand.Next(4) + Nano.Rand.Next(4));
                            tries++;
                            if (tries > 8)
                                break;
                        }
                    }
                    IG.OwnerOnly = new System.Timers.Timer();
                    IG.OwnerOnly.Interval = 10000;
                    IG.OwnerOnly.AutoReset = false;
                    IG.OwnerID = Killer;
                    IG.UID = Nano.Rand.Next(1000, 9999999);
                    while (Nano.ItemFloor.ContainsKey(IG.UID))
                    {
                        IG.UID = Nano.Rand.Next(1000, 9999999);
                    }
                    //TODO: UID generation that is better.
                    IG.Dispose = new System.Timers.Timer();
                    IG.Dispose.Interval = 60000;
                    IG.Dispose.AutoReset = false;
                    IG.Dispose.Elapsed += delegate { IG.Disappear(); };
                    IG.Dispose.Start();
                    IG.OwnerOnly.Start();
                    //lock(Nano.ItemFloor)
                    //{
                    try
                    {
                        Monitor.Enter(Nano.ItemFloor);
                        Nano.ItemFloor.Add(IG.UID, IG);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.ToString());
                    }
                    finally
                    {
                        Monitor.Exit(Nano.ItemFloor);
                    }
                    //}
                    ConquerPacket.ToLocal(ConquerPacket.DropItem(IG.UID, IG.ItemID, IG.X, IG.Y, IG.Color), IG.X, IG.Y, IG.Map, 0, 0);
                }
09/03/2009 19:55 PeTe Ninja#2
all that for adrop?
09/03/2009 19:58 1supertao#3
haha i know... Im not sure how to make a sertain monster.. or map.. drop sertain things.. lmao.. thats just the normal drop.. for dbs.. but i changed it to a cp drop... and SoulStone... simple.. but idk how to do the map
09/03/2009 20:03 PeTe Ninja#4
lol you could make it so much easiser to create drops that it will be like 1 line or less of codes ( and not a long line )
09/03/2009 20:33 1supertao#5
>.< I know that.. but I have no CLUE how to do it
lol

Something like?

Quote:
if(CSocket.Client.Monster.ID == IDMONSTER)
{
Struct.ItemGround IG = new Struct.ItemGround();
if (Calculation.PercentSuccess(20))
IG.ItemID = 723085;
09/03/2009 20:42 samehvan#6
Quote:
Originally Posted by PeTe Ninja View Post
lol you could make it so much easiser to create drops that it will be like 1 line or less of codes ( and not a long line )
he is using Coemu so no he can't :p

and i think anyother source wont be that easy neither coz he wanna do some special drops for certain maps or certain events ,so here is how i dd it , may be u have another easiest way (if so i would appreciate f u let me know about it) but that is my way anyhow

1-Find

Code:
if(Calculation.PercentSuccess(27)) //Drop an item
you will c after it

Code:
                                        int Quality = Nano.Rand.Next(3, 6);
					int Soc1 = 0;
					int Soc2 = 0;
					int Bless = 0;
					int Plus = 0;
2-Add after them this line

Code:
int ItemID = 0; int Quality = 0;
u will find 2 errors saying that the ItemId and Quality can't be declared at the next positions , if this happens then remove the word int from both of them (not from the line i put up there but from the lines will have errors)

3-now r8 after that line add this

Code:
if (SpecialDrop())//For Quests
                    {
                        ItemID = SpecialDrop(1);
                    }
and the check quality lines after that put them between else { statements } like this

Code:
else
                    {
                        Quality = Nano.Rand.Next(3, 6);
                        if (Calculation.PercentSuccess(2))
                            Plus = 1;
                        if (Calculation.PercentSuccess(2))
                            Quality = 7;
                        if (Calculation.PercentSuccess(1))
                            Quality = 8;
                        if (Calculation.PercentSuccess(.578))
                            Quality = 9;
                        ItemID = Calculation.Item(Level, Quality);
                    }
4-add this 2 functions at the bottom of same class

A-this one to check if it is a special drops , u can add here all maps,mobs and events u want
Code:
public bool SpecialDrop()
        {
            if (Map == 2021 || Map == 2022 || Map == 2023 || Map == 2024) return true;
            else return false;
        }
B-here u determine what item should drop u can also add what u want at some maps or events as u wish , i made the Type as 0=Drop Money and 1=Drop an item
Code:
public int SpecialDrop(byte Type)
        {
            int ItemId = 0;
            if (Type == 0)//Money
            {
                if (Map == 2021) ItemId = Nano.Rand.Next(1000, 10000);
                else if (Map == 2022) ItemId = Nano.Rand.Next(2000, 50000);
            }
            else //Item
            {
                switch (Map)
                {
                    case 2021://DisCity Stage1
                        {
                            byte Chances = (byte)Nano.Rand.Next(100);
                            if (Chances < 10) ItemId = 723085;//SoulStone
                            else if (Chances < 40) ItemId = 1002050;
                            else if (Chances < 70) ItemId = 1002040;
                            else ItemId = 1050002;
                            break;
                        }
                    case 2022://DisCity Stage2
                        {
                            byte Chances = (byte)Nano.Rand.Next(100);
                            if (Chances < 33) ItemId = 1002050;
                            else if (Chances < 66) ItemId = 1002040;
                            else ItemId = 1050002;
                            break;
                        }
                    case 2023://DisCity Stage3
                        {
                            byte Chances = (byte)Nano.Rand.Next(250);
                            if (Chances < 3) ItemId = 725016;//NightDevil
                            break;
                        }
                }
            }
            return ItemId;
        }
09/03/2009 21:34 1supertao#7
You never seize to amaze me samehvan... ^.^ .. one more things..

Quote:
Error 1 A local variable named 'Quality' is already defined in this scope C:\Documents and Settings\M@tt0\Desktop\CoEmu v2\CoEmu v2 GameServer\Entities\Monster.cs 204 25 CoEmu v2 GameServer
09/03/2009 21:54 PeTe Ninja#8
Actually samehvan he could if he just recoded it a tiny bit =]
09/03/2009 22:02 1supertao#9
I did it.. already... ty samehvan.. im working on Exppot.. pm me if u want wat i have.. and we can put are brains togethor
09/04/2009 05:09 samehvan#10
Quote:
Originally Posted by 1supertao View Post
I did it.. already... ty samehvan.. im working on Exppot.. pm me if u want wat i have.. and we can put are brains togethor
i have the Exp Potions already it is not so hard tho , it's one variable , 2 lines at useitem.cs , 1 line at GiveExp void and 1 line at Global timer we made be4 , the more important than this is the skills we don't know about yet , like PoisonStar ,Fatal strike and other new skills ,u can also try ur best at Ranks (flowers and nobilities) the Honor system we already dd it be4 ,and if u had any luck with any of them just make me happy by telling me your progress :p
09/04/2009 05:58 © Haydz#11
Soul Stones? are they the uhh, little green things that drop?

(Curiosity)
09/04/2009 06:19 1supertao#12
Umm.. i did the exppotion.. expect can u send me the timer? and the Top left icon? My timer.. is all tweaked:)