Mob.cs coding problem(help)

06/22/2010 17:39 sohaib#1
hi, so i have co pserver 5165

i'm coding mob.cs, to make a monster droping an item so here is the script and tell me wha'ts wrong, because i made the Id of GoldDew [ID:721514]

PHP Code:
                    else if (MyMath.ChanceSuccess(DropRates.CPBag))
                    {
                        if (
Char != null)
                        if (
Char.VipLevel >= 3)
                        {
                            if (
Char.Inventory.Count <= 39)
                            {
                                
Char.AddItem(721514);
                                return;
                            }
                        }
                        
DI2.Info.ID 150279;
                        
DI2.Info.MaxDur DI2.Info.DBInfo.Durability;
                        
DI2.Info.CurDur DI2.Info.MaxDur;
                    }
                    else if (
MyMath.ChanceSuccess(DropRates.CPBackpack))
                        if (
Loc.Map == 1511)
                        {
                            if (
Name == "GhostBossL159")
                            {
                                if (
MyMath.ChanceSuccess(0.5))
                                {
                                    
DI2.Info.ID 721514;
                                    
DI2.Info.MaxDur DI2.Info.DBInfo.Durability;
                                    
DI2.Info.CurDur DI2.Info.MaxDur;
                                }
                            }
                        }
                        if (
Loc.Map == 4021)
                        {
                            if (
Name == "GhostBoss159")
                            {
                                if (
MyMath.ChanceSuccess(0.5))
                                {
                                    
DI2.Info.ID 721514;
                                    
DI2.Info.MaxDur DI2.Info.DBInfo.Durability;
                                    
DI2.Info.CurDur DI2.Info.MaxDur;
                                }
                            }
                        } 

but it drop CPBackPack, why, and if the code is wrong, give me the right code or p
06/23/2010 00:22 Adziunia#2
simply no offence but if u could just spend few more mins on it u would figure out wheres the problem look at this
Quote:
else if (MyMath.ChanceSuccess(DropRates.CPBackpack)) <<<<<<<<<< that's why u r getting cpbackpack instead of ur item change it and also add that item GoldDew to droprates as others r
if (Loc.Map == 1511)
{
if (Name == "GhostBossL159")
{
if (MyMath.ChanceSuccess(0.5))
{
DI2.Info.ID = 721514;
DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
DI2.Info.CurDur = DI2.Info.MaxDur;
}
}
}
06/23/2010 05:31 Arcо#3
" else if (MyMath.ChanceSuccess(DropRates.CPBackpack)) "
06/23/2010 11:41 sohaib#4
man, where i put the code,
Quote:
}
else if (MyMath.ChanceSuccess(DropRates.CPBackpack))
Here
{
or


Quote:
}
else if (MyMath.ChanceSuccess(DropRates.CPBackpack))
{
Here


so after the "{" or before?
06/23/2010 20:34 Arcо#5
Just remove it entirely.
06/23/2010 20:46 sohaib#6
how that?
06/23/2010 20:51 Arcо#7
Highlight....
Backspace.