Register for your free account! | Forgot your password?

You last visited: Today at 17:04

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

Advertisement



help me plaese??????

Discussion on help me plaese?????? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2009
Posts: 7
Received Thanks: 0
help me plaese??????

Hai everyone
I've got to serve Patch 5156
And setup on vps
And I've been having this problem
What is the solution please



go0ba is offline  
Old 02/25/2010, 03:28   #2
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
What is at line 520 of mobs.cs?
Arcо is offline  
Old 02/25/2010, 03:43   #3
 
elite*gold: 0
Join Date: Oct 2009
Posts: 7
Received Thanks: 0
That the contents of the line 520 in mob.cs

Char.Silvers += 10000;
go0ba is offline  
Old 02/25/2010, 03:47   #4
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
Quote:
Originally Posted by go0ba View Post
That the contents of the line 520 in mob.cs

Char.Silvers += 10000;
Post the entire mob code here please.
Arcо is offline  
Old 02/25/2010, 04:18   #5
 
elite*gold: 0
Join Date: Oct 2009
Posts: 7
Received Thanks: 0
This all code mob.cs my pro

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer.Game
{
    public enum AttackType : byte
    {
        Melee = 2,
        Ranged = 28,
        Magic = 21,
        Kill = 14,
        FatalStrike = 45,
        Scapegoat = 43
    }
    public enum MobBehaveour : byte
    {
        HuntPlayers = 1,
        HuntMobs = 2,
        HuntMobsAndPlayers = 3,
        HuntBlueNames = 4,
        HuntMobsAndBlue = 6
    }
    public class Mob
    {
        DateTime LastMove;
        public byte Direction = 0;
        public byte Action = 0;
        public uint EntityID;
        public Location Loc;
        public Location StartLoc;
        public bool Alive = true;
        public bool Dissappeared = false;
        public DateTime Died;
        public uint RandomTime = 30;
        public static Random Rnd = new Random();
        public static DateTime LastTarget = DateTime.Now;

        Character PlayerTarget;
        Mob MobTarget;
        public int MobID;
        public ushort Mesh;
        public byte Level;
        public uint MaxHP;
        public uint CurrentHP;
        public ushort Defense;
        public ushort MDef;
        public ushort MAttack;
        public ushort MinAttack;
        public ushort MaxAttack;
        public string Name;
        public MobBehaveour Type;
        public byte DmgReduceTimes;
        public AttackType AtkType;
        public byte Dodge;
        public bool Gives;
        public byte AttackDist;
        public ushort MagicSkill = 0;
        public byte MagicLvl = 0;
        public int MinSilvers;
        public int MaxSilvers;
        uint SpawnSpeed = 0;
        ushort MoveSpeed = 0;
        bool LevDifDmg = true;
        public PoisonType PoisonedInfo = null;
        public Mob(string Line)
        {
            LastMove = DateTime.Now;
            string[] Info = Line.Split(' ');
            MobID = int.Parse(Info[0]);
            Name = Info[1];
            Type = (MobBehaveour)byte.Parse(Info[2]);
            Mesh = ushort.Parse(Info[3]);
            Level = byte.Parse(Info[4]);
            MaxHP = uint.Parse(Info[5]);
            Defense = ushort.Parse(Info[6]);
            MDef = ushort.Parse(Info[7]);
            MAttack = ushort.Parse(Info[8]);
            MinAttack = ushort.Parse(Info[9]);
            MaxAttack = ushort.Parse(Info[10]);
            DmgReduceTimes = byte.Parse(Info[11]);
            Dodge = byte.Parse(Info[12]);
            AtkType = (AttackType)byte.Parse(Info[13]);
            if (AtkType == AttackType.Magic)
            {
                MagicSkill = ushort.Parse(Info[14]);
                MagicLvl = byte.Parse(Info[15]);
                Gives = bool.Parse(Info[16]);
                AttackDist = byte.Parse(Info[17]);
                MinSilvers = int.Parse(Info[18]);
                MaxSilvers = int.Parse(Info[19]);
                MoveSpeed = ushort.Parse(Info[20]);
                SpawnSpeed = uint.Parse(Info[21]);
                LevDifDmg = bool.Parse(Info[22]);
            }
            else
            {
                Gives = bool.Parse(Info[14]);
                AttackDist = byte.Parse(Info[15]);
                MinSilvers = int.Parse(Info[16]);
                MaxSilvers = int.Parse(Info[17]);
                MoveSpeed = ushort.Parse(Info[18]);
                SpawnSpeed = uint.Parse(Info[19]);
                LevDifDmg = bool.Parse(Info[20]);
            }

            CurrentHP = MaxHP;
        }
        public Mob(Mob M)
        {
            LastMove = DateTime.Now;
            MobID = M.MobID;
            Mesh = M.Mesh;
            Level = M.Level;
            MaxHP = M.MaxHP;
            CurrentHP = M.CurrentHP;
            Defense = M.Defense;
            MDef = M.MDef;
            MAttack = M.MAttack;
            MinAttack = M.MinAttack;
            MaxAttack = M.MaxAttack;
            Name = M.Name;
            Type = M.Type;
            DmgReduceTimes = M.DmgReduceTimes;
            Dodge = M.Dodge;
            AtkType = M.AtkType;
            Gives = M.Gives;
            AttackDist = M.AttackDist;
            MagicSkill = M.MagicSkill;
            MagicLvl = M.MagicLvl;
            MinSilvers = M.MinSilvers;
            MaxSilvers = M.MaxSilvers;
            MoveSpeed = M.MoveSpeed;
            SpawnSpeed = M.SpawnSpeed;
            LevDifDmg = M.LevDifDmg;
        }

        uint PrepareAttack()
        {
            if (AtkType == AttackType.Melee || AtkType == AttackType.Ranged)
                return (uint)Rnd.Next(MinAttack, MaxAttack);
            else
                return MAttack;
        }
        public bool NeedsPKMode
        {
            get
            {
                if (Type == MobBehaveour.HuntBlueNames || Type == MobBehaveour.HuntMobsAndBlue)
                    return true;
                return false;
            }
        }
        public uint TakeAttack(Character Attacker, ref uint Damage, AttackType AT, bool IsSkill)
        {
            if (AT != AttackType.Magic && Attacker.BuffOf(Features.SkillsClass.ExtraEffect.Superman).Eff == Features.SkillsClass.ExtraEffect.Superman)
                Damage *= 10;
            if (!IsSkill && Attacker.BuffOf(Features.SkillsClass.ExtraEffect.FatalStrike).Eff == Features.SkillsClass.ExtraEffect.FatalStrike)
            {
                AT = AttackType.FatalStrike;
                Damage *= 5;
            }
            double e = 1;
            if (Level + 4 < Attacker.Level)
                e = 0.1;
            if (Level + 4 >= Attacker.Level)
                e = 1;
            if (Level >= Attacker.Level)
                e = 1.1;
            if (Level - 4 > Attacker.Level)
                e = 1.3;

            if (Type == MobBehaveour.HuntBlueNames || Type == MobBehaveour.HuntMobsAndBlue)
            {
                Attacker.BlueName = true;
                if (Attacker.BlueNameLasts < 60)
                    Attacker.BlueNameLasts = 15;
            }
            if (AT != AttackType.Magic && !IsSkill)
            {
                short _Agi = (short)(Attacker.Agi + Attacker.EqStats.ExtraDex);

                Buff Accuracy = Attacker.BuffOf(Features.SkillsClass.ExtraEffect.Accuracy);
                if (Accuracy.Eff == Features.SkillsClass.ExtraEffect.Accuracy)
                    _Agi = (short)(_Agi * Accuracy.Value);
                Buff SM = Attacker.BuffOf(Features.SkillsClass.ExtraEffect.Superman);
                if (SM.StEff == StatusEffectEn.SuperMan)
                    _Agi *= 2;
                double MissValue = Rnd.Next(15 + _Agi, _Agi + Dodge + 15);
                if (MissValue <= Dodge && AT != AttackType.FatalStrike)
                    Damage = 0;
                else
                {
                    if (LevDifDmg) Damage = (uint)(Damage * MyMath.LevelDifference(Attacker.Level, Level));
                }
            }
            if (!IsSkill && Damage != 0)
            {
                if (AT == AttackType.Melee || AT == AttackType.FatalStrike)
                {
                    if (Defense >= Damage)
                        Damage = 1;
                    else
                        Damage -= Defense;

                    Damage += Attacker.EqStats.MeleeDamageIncrease;
                }
                else if (AT == AttackType.Ranged)
                {
                    Damage = (uint)((double)Damage * ((double)(200 - Dodge) / 100));
                    Damage += Attacker.EqStats.MeleeDamageIncrease;
                }
                else
                {
                    if (MDef >= Damage)
                        Damage = 1;
                    else
                        Damage -= MDef;

                    Damage += Attacker.EqStats.MagicDamageIncrease;
                }
                Damage = (uint)(Damage / DmgReduceTimes);
            }
            uint Exp = 0;
            if (Damage < CurrentHP)
            {
                CurrentHP -= Damage;
                if (!IsSkill)
                {
                    if (AT == AttackType.FatalStrike)
                    {
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, (ushort)(Loc.X + 1), (ushort)(Loc.Y + 1), Damage, (byte)AT).Get);
                        Attacker.Shift((ushort)(Loc.X), (ushort)(Loc.Y));
                    }
                    else if (AT == AttackType.Scapegoat)
                    {
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, 43).Get);
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, 2).Get);
                    }
                    else
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AT).Get);
                }
                if (Gives)
                {
                    Exp = (uint)(Damage * e);
                    if (!IsSkill)
                    {
                        if (AT == AttackType.Ranged || AT == AttackType.Melee || AT == AttackType.FatalStrike)
                        {
                            if (Attacker.Equips.RightHand.ID != 0)
                                Attacker.AddProfExp((ushort)Game.ItemIDManipulation.Part(Attacker.Equips.RightHand.ID, 0, 3), Damage);
                            if (Attacker.Equips.LeftHand.ID != 0)
                                Attacker.AddProfExp((ushort)Game.ItemIDManipulation.Part(Attacker.Equips.LeftHand.ID, 0, 3), Damage / 3 * 2);
                        }
                    }
                }
            }
            else
            {
                if (Attacker.MHunter == true & Attacker.HunterName == Name)
                {
                    Attacker.MonsterHunter++;
                }
                Attacker.XPKO++;
                if (Attacker.Superman || Attacker.Cyclone)
                    Attacker.TotalKO++;
                PlayerTarget = null;
                Alive = false;
                uint Benefit = CurrentHP;
                CurrentHP = 0;
                PoisonedInfo = null;
                Died = DateTime.Now;
                if (!IsSkill)
                {
                    if (AT == AttackType.FatalStrike)
                    {
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, (ushort)(Loc.X + 1), (ushort)(Loc.Y + 1), Damage, (byte)AT).Get);
                        Attacker.Shift((ushort)(Loc.X), (ushort)(Loc.Y));
                    }
                    else if (AT == AttackType.Scapegoat)
                    {
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, 43).Get);
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, 2).Get);
                    }
                    else
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AT).Get);
                }
                if (Attacker.Superman || Attacker.Cyclone)
                    World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, (uint)(65536 * Attacker.TotalKO), (byte)AttackType.Kill).Get);
                else
                    World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, (uint)(1), (byte)AttackType.Kill).Get);

                World.Action(this, Packets.Status(EntityID, Status.Effect, 2080).Get);

                Attacker.AtkMem.Attacking = false;
                Attacker.AtkMem.Target = 0;

                if (Gives)
                {
                    Exp = (uint)(Benefit * e);
                    if (Attacker.MyTeam != null)
                    {
                        foreach (Character C in Attacker.MyTeam.Members)
                        {
                            if (C != Attacker && C.Alive && MyMath.InBox(C.Loc.X, C.Loc.Y, Attacker.Loc.X, Attacker.Loc.Y, 18))
                            {
                                if (C.Level + 20 > Level || C.Level >= 70)
                                {
                                    C.IncreaseExp(MaxHP / 10, true);
                                }
                                else
                                {
                                    uint Amount = (uint)(356 + (C.Level * 27));
                                    byte Lev = C.Level;
                                    C.IncreaseExp(Amount, true);
                                    for (; Lev < C.Level; Lev++)
                                    {
                                        uint VPAmount = (uint)Math.Max(1, Lev * 12 - 17);
                                        Attacker.MyTeam.Leader.VP += VPAmount;
                                        Attacker.MyTeam.Message(Packets.ChatMessage(45216, "SYSTEM", "ALL", Attacker.MyTeam.Leader.Name + " gained " + VPAmount + " virtue points.", 2003, 0));
                                    }
                                }
                            }
                        }
                    }
                    Attacker.IncreaseExp(MaxHP / 10, false);
                    if (!IsSkill)
                    {
                        if (AT == AttackType.Ranged || AT == AttackType.Melee || AT == AttackType.FatalStrike)
                        {
                            if (Attacker.Equips.RightHand.ID != 0)
                                Attacker.AddProfExp((ushort)Game.ItemIDManipulation.Part(Attacker.Equips.RightHand.ID, 0, 3), Benefit);
                            if (Attacker.Equips.LeftHand.ID != 0)
                                Attacker.AddProfExp((ushort)Game.ItemIDManipulation.Part(Attacker.Equips.LeftHand.ID, 0, 3), Benefit / 3 * 2);
                        }
                    }
                    DropAnItem(Attacker.EntityID, Attacker.Level);
                }
            }

            if (!IsSkill)
                Attacker.IncreaseExp(Exp, false);
            return Exp;
        }
        public void TakeAttack(Mob Attacker, uint Damage, AttackType AT)
        {
            try
            {
                if (LevDifDmg) Damage = (uint)(Damage * MyMath.LevelDifference(Attacker.Level, Level));
                Damage = (uint)(Damage / DmgReduceTimes);
                if (AT == AttackType.Melee)
                {
                    if (Defense >= Damage)
                        Damage = 1;
                    else
                        Damage -= Defense;
                }
                else if (AT == AttackType.Ranged)
                    Damage = (uint)((double)Damage * ((double)Dodge / 100));
                else if (AT == AttackType.Magic)
                {
                    if (MDef >= Damage)
                        Damage = 1;
                    else
                        Damage -= MDef;
                }

                if (Damage < CurrentHP)
                {
                    CurrentHP -= Damage;
                    if (AT == AttackType.Magic)
                        World.Action(this, Packets.SkillUse(Attacker.EntityID, EntityID, Damage, Attacker.MagicSkill, Attacker.MagicLvl, Loc.X, Loc.Y).Get);
                    else
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AT).Get);
                }
                else
                {
                    PoisonedInfo = null;
                    PlayerTarget = null;
                    Alive = false;
                    uint Benefit = CurrentHP;
                    CurrentHP = 0;
                    Died = DateTime.Now;
                    if (AT == AttackType.Magic)
                        World.Action(this, Packets.SkillUse(Attacker.EntityID, EntityID, Damage, Attacker.MagicSkill, Attacker.MagicLvl, Loc.X, Loc.Y).Get);
                    else
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AT).Get);
                    World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AttackType.Kill).Get);
                    World.Action(this, Packets.Status(EntityID, Status.Effect, 2080).Get);

                    if (Gives)
                        DropAnItem(0, Attacker.Level);
                }
            }
            catch (Exception Exc) { Program.WriteLine(Exc); }
        }
        public void TakeAttack(Companion Attacker, uint Damage, AttackType AT)
        {
            try
            {
                if (LevDifDmg) Damage = (uint)(Damage * MyMath.LevelDifference(Attacker.Level, Level));
                Damage = (uint)(Damage / DmgReduceTimes);
                if (AT == AttackType.Melee)
                {
                    if (Defense >= Damage)
                        Damage = 1;
                    else
                        Damage -= Defense;
                }
                else if (AT == AttackType.Ranged)
                    Damage = (uint)((double)Damage * ((double)Dodge / 100));
                else if (AT == AttackType.Magic)
                {
                    if (MDef >= Damage)
                        Damage = 1;
                    else
                        Damage -= MDef;
                }

                if (Damage < CurrentHP)
                {
                    CurrentHP -= Damage;
                    if (AT == AttackType.Magic)
                        World.Action(this, Packets.SkillUse(Attacker.EntityID, EntityID, Damage, (ushort)Attacker.SkillUses, 0, Loc.X, Loc.Y).Get);
                    else
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AT).Get);

                    if (Gives)
                        Attacker.Owner.IncreaseExp(Damage, false);
                }
                else
                {
                    PoisonedInfo = null;
                    PlayerTarget = null;
                    Alive = false;
                    uint Benefit = CurrentHP;
                    CurrentHP = 0;
                    Died = DateTime.Now;
                    if (AT == AttackType.Magic)
                        World.Action(this, Packets.SkillUse(Attacker.EntityID, EntityID, Damage, (ushort)Attacker.SkillUses, 0, Loc.X, Loc.Y).Get);
                    else
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AT).Get);
                    World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AttackType.Kill).Get);
                    World.Action(this, Packets.Status(EntityID, Status.Effect, 2080).Get);

                    if (Gives)
                    {
                        DropAnItem(Attacker.Owner.EntityID, Attacker.Level);
                        Attacker.Owner.IncreaseExp(Benefit, false);
                    }
                }
            }
            catch (Exception Exc) { Program.WriteLine(Exc); }
        }
        void DropAnItem(uint Owner, byte OwnerLevel)
        {
            try
            {
                ArrayList Arr = (ArrayList)DropRates.Specifics[MobID];
                if (Arr != null)
                {
                    foreach (DropRates.RateItemInfo R in Arr)
                    {
                        if (MyMath.ChanceSuccess(R.DropChance) && Level + 20 > OwnerLevel)
                        {
                            DroppedItem DI = new DroppedItem();
                            DI.DropTime = DateTime.Now;
                            DI.UID = (uint)Rnd.Next(10000000);
                            DI.Loc = new Location();
                            DI.Loc.X = (ushort)(Loc.X + Rnd.Next(4) - Rnd.Next(4));
                            DI.Loc.Y = (ushort)(Loc.Y + Rnd.Next(4) - Rnd.Next(4));
                            DI.Loc.Map = Loc.Map;
                            DI.Info = new Item();
                            DI.Info.ID = R.ID;
                            DI.Info.UID = (uint)Rnd.Next(10000000);
                            DI.Info.Plus = R.Plus;
                            DI.Info.Bless = R.Bless;
                            if (R.Sockets >= 1)
                                DI.Info.Soc1 = Item.Gem.EmptySocket;
                            if (R.Sockets >= 2)
                                DI.Info.Soc2 = Item.Gem.EmptySocket;
                            try
                            {
                                DI.Info.MaxDur = DI.Info.DBInfo.Durability;
                                DI.Info.CurDur = DI.Info.MaxDur;
                            }
                            catch (Exception Exc) { Program.WriteLine(Exc); }
                            DI.Owner = Owner;
                            if (!DI.FindPlace((Hashtable)Game.World.H_Items[Loc.Map]))
                            {
                                DI.Loc.X = (ushort)(Loc.X + Rnd.Next(4) - Rnd.Next(4));
                                DI.Loc.Y = (ushort)(Loc.Y + Rnd.Next(4) - Rnd.Next(4));
                            }
                            if (!DI.FindPlace((Hashtable)Game.World.H_Items[Loc.Map])) continue;
                            DI.Drop();
                        }
                    }
                }

                DroppedItem DI2 = new DroppedItem();
                DI2.DropTime = DateTime.Now;
                DI2.UID = (uint)Rnd.Next(10000000);
                DI2.Loc = new Location();
                DI2.Loc.X = (ushort)(Loc.X + Rnd.Next(4) - Rnd.Next(4));
                DI2.Loc.Y = (ushort)(Loc.Y + Rnd.Next(4) - Rnd.Next(4));
                DI2.Loc.Map = Loc.Map;
                DI2.Info = new Item();
                DI2.Info.UID = (uint)Rnd.Next(10000000);
                DI2.Owner = Owner;
                Game.Character Char = null;
                if (Game.World.H_Chars.ContainsKey(Owner))
                    Char = (Character)Game.World.H_Chars[Owner];
                if (MyMath.ChanceSuccess(100))
                {

                    if (MobID == 1)
                    {
                        Char.Silvers += 10000;
                        Char.CPs += 10;

                        return;
                    }
                }
                {
                    if (MobID == 52)
                    {
                        Char.Silvers += 10000000;
                        Char.CPs += 20;

                        return;
                    }
                }
                if (MyMath.ChanceSuccess(30))
                {
                    DI2.Silvers = (uint)(Rnd.Next(MinSilvers, MaxSilvers) * DropRates.Silver);
                    if (Char != null)
                        if (Char.VipLevel >= 3)
                        {
                            Char.Silvers += DI2.Silvers;
                            return;
                        }
                    DI2.UID = (uint)Rnd.Next(10000000);
                    DI2.Loc.X = (ushort)(Loc.X + Rnd.Next(4) - Rnd.Next(4));
                    DI2.Loc.Y = (ushort)(Loc.Y + Rnd.Next(4) - Rnd.Next(4));
                    if (DI2.Silvers < 10)
                        DI2.Info.ID = 1090000;
                    else if (DI2.Silvers < 100)
                        DI2.Info.ID = 1090010;
                    else if (DI2.Silvers < 1000)
                        DI2.Info.ID = 1090020;
                    else if (DI2.Silvers < 3000)
                        DI2.Info.ID = 1091000;
                    else if (DI2.Silvers < 10000)
                        DI2.Info.ID = 1091010;
                    else
                        DI2.Info.ID = 1091020;

                    if (!DI2.FindPlace((Hashtable)Game.World.H_Items[Loc.Map])) return;
                    DI2.Drop();
                }
                else
                {
                    if (MyMath.ChanceSuccess(DropRates.DragonBall))
                    {
                        if (Char != null)
                            if (Char.VipLevel >= 3)
                            {
                                if (Char.Inventory.Count <= 39)
                                {
                                    Char.AddItem(1088000);
                                    return;
                                }
                            }
                        DI2.Info.ID = 1088000;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.Meteor))
                    {
                        DI2.Info.ID = 1088001;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.CPMiniBag))
                    {
                        if (Char != null)
                            if (Char.VipLevel >= 3)
                            {
                                if (Char.Inventory.Count <= 39)
                                {
                                    Char.AddItem(729910);
                                    return;
                                }
                            }
                        DI2.Info.ID = 729910;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.CPBag))
                    {
                        if (Char != null)
                            if (Char.VipLevel >= 3)
                            {
                                if (Char.Inventory.Count <= 39)
                                {
                                    Char.AddItem(729911);
                                    return;
                                }
                            }
                        DI2.Info.ID = 729911;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.HealthWine))
                    {
                        if (Char != null)
                            if (Char.VipLevel >= 6)
                            {
                                if (Char.Inventory.Count <= 39)
                                {
                                    Char.AddItem(723030);
                                    return;
                                }
                            }
                        DI2.Info.ID = 723030;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.BlackToken))
                    {
                        if (Char != null)
                        {
                            if (Char.Inventory.Count <= 39)
                            {
                                Char.AddItem(710564);
                                return;
                            }
                        }
                        DI2.Info.ID = 710564;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.CPBackpack))
                    {
                        if (Char != null)
                            if (Char.VipLevel >= 3)
                            {
                                if (Char.Inventory.Count <= 39)
                                {
                                    Char.AddItem(729912);
                                    return;
                                }
                            }
                        DI2.Info.ID = 729912;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.PointCard))
                    {
                        if (Char != null)
                            if (Char.VipLevel >= 3)
                            {
                                if (Char.Inventory.Count <= 39)
                                {
                                    Char.AddItem(780000);
                                    return;
                                }
                            }
                        DI2.Info.ID = 780000;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.PlusOneStone))
                    {
                        DI2.Info.ID = 730001;
                        DI2.Info.Plus = 1;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.PlusTwoStone))
                    {
                        DI2.Info.ID = 730002;
                        DI2.Info.Plus = 2;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.CleanWater))
                    {
                        DI2.Info.ID = 721258;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.Gem))
                    {
                        DI2.Info.ID = (uint)(700001 + Rnd.Next(8) * 10);
                        if (MyMath.ChanceSuccess(15)) DI2.Info.ID = 700121;
                        if (MyMath.ChanceSuccess(15)) DI2.Info.ID = 700101;
                        DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;
                        DI2.Info.CurDur = DI2.Info.MaxDur;
                    }
                    else if (MyMath.ChanceSuccess(DropRates.Item))
                    {
                        Item.ItemQuality Q = Item.ItemQuality.Simple;
                        if (MyMath.ChanceSuccess(DropRates.Refined))
                            Q = Item.ItemQuality.Refined;
                        if (MyMath.ChanceSuccess(DropRates.Unique))
                            Q = Item.ItemQuality.Unique;
                        if (MyMath.ChanceSuccess(DropRates.Elite))
                            Q = Item.ItemQuality.Elite;
                        if (MyMath.ChanceSuccess(DropRates.Super))
                            Q = Item.ItemQuality.Super;
                        uint ItemID = 0;

                        ArrayList From = new ArrayList();
                        foreach (DatabaseItem D in Database.DatabaseItems.Values)
                        {
                            if (D.LevReq + 5 > Level && D.LevReq - 5 <= Level)
                            {
                                if (D.LevReq != 0)
                                    From.Add(D.ID);
                            }
                        }
                        if (From != null)
                        {
                            byte Tries = (byte)Rnd.Next(0, From.Count);
                            ItemID = (uint)From[Tries];
                        }
                        if (ItemID != 0)
                        {
                            DI2.Info.ID = ItemID;
                            if (DI2.Info.DBInfo.LevReq != 1)
                            {
                                ItemIDManipulation E = new ItemIDManipulation(ItemID);
                                E.QualityChange(Q);
                                DI2.Info.ID = E.ToID();
                            }

                            DI2.Info.Color = Item.ArmorColor.Orange;
                            if (ItemIDManipulation.Digit(DI2.Info.ID, 1) == 4 || ItemIDManipulation.Digit(DI2.Info.ID, 1) == 5)
                            {
                                if (MyMath.ChanceSuccess(DropRates.OneSoc))
                                    DI2.Info.Soc1 = Item.Gem.EmptySocket;
                                if (MyMath.ChanceSuccess(DropRates.TwoSoc))
                                {
                                    DI2.Info.Soc1 = Item.Gem.EmptySocket;
                                    DI2.Info.Soc2 = Item.Gem.EmptySocket;
                                }
                            }

                            if (MyMath.ChanceSuccess(DropRates.PlusOne))
                                DI2.Info.Plus = 1;
                            DI2.Info.MaxDur = DI2.Info.DBInfo.Durability;

                            DI2.Info.CurDur = DI2.Info.MaxDur;
                            if (Q == Item.ItemQuality.Super || Q == Item.ItemQuality.Elite)
                                if (Char != null)
                                    if (Char.VipLevel >= 3)
                                    {
                                        if (Char.Inventory.Count <= 39)
                                        {
                                            Char.AddItem(DI2.Info.ID);
                                            return;
                                        }
                                    }
                        }
                    }
                    if (DI2.Info.ID != 0)
                    {
                        if (!DI2.FindPlace((Hashtable)Game.World.H_Items[Loc.Map])) return;
                        DI2.Drop();
                    }
                }
            }
            catch (Exception Exc) { Program.WriteLine(Exc); }
        }
        public void Respawn()
        {
            try
            {
                Loc = StartLoc;
                Alive = true;
                CurrentHP = MaxHP;
                Action = 100;
                World.Spawn(this, false);
                World.Action(this, Packets.String(EntityID, 10, "MBStandard").Get);
                Dissappeared = false;
            }
            catch (Exception Exc) { Program.WriteLine(Exc); }
        }
        public void Step()
        {
            try
            {
                if (!Alive)
                {
                    if (!Dissappeared && DateTime.Now > Died.AddSeconds(2))
                    {
                        World.Action(this, Packets.GeneralData(EntityID, 0, 0, 0, 135).Get);
                        Dissappeared = true;
                        RandomTime = (uint)(Rnd.Next(20, 60));
                    }
                    if (DateTime.Now > Died.AddSeconds(SpawnSpeed + RandomTime))//changed back to 30 by Ricardo
                        Respawn();
                }
                if (Alive && DateTime.Now > LastMove.AddMilliseconds(1000))
                {
                    LastMove = DateTime.Now;
                    if ((Type == MobBehaveour.HuntPlayers || Type == MobBehaveour.HuntMobsAndBlue) && PlayerTarget == null && MobTarget == null)
                    {
                        byte NDist = 11;
                        byte MaxDist = 10;
                        foreach (Character C in World.H_Chars.Values)
                        {
                            if (C.Loc.Map == Loc.Map)
                            {
                                if (C.Alive)
                                {
                                    if (C.CanBeMeleed || AtkType != AttackType.Melee)
                                    {
                                        byte Dst = (byte)MyMath.PointDistance(Loc.X, Loc.Y, C.Loc.X, C.Loc.Y);
                                        if (Dst <= MaxDist && Dst < NDist)
                                        {
                                            if (Type != MobBehaveour.HuntMobsAndBlue || C.BlueName)
                                            {
                                                NDist = (byte)MyMath.PointDistance(Loc.X, Loc.Y, C.Loc.X, C.Loc.Y);
                                                PlayerTarget = C;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if (Type == MobBehaveour.HuntMobs || Type == MobBehaveour.HuntMobsAndBlue && MobTarget == null && PlayerTarget == null)
                    {
                        byte NDist = 15;
                        byte MaxDist = 8;
                        foreach (Mob M in ((Hashtable)World.H_Mobs[Loc.Map]).Values)
                            if (M != this && M.Type == MobBehaveour.HuntPlayers && M.Alive && MyMath.PointDistance(Loc.X, Loc.Y, M.Loc.X, M.Loc.Y) <= MaxDist && MyMath.PointDistance(Loc.X, Loc.Y, M.Loc.X, M.Loc.Y) < NDist)
                            {
                                NDist = (byte)MyMath.PointDistance(Loc.X, Loc.Y, M.Loc.X, M.Loc.Y);
                                MobTarget = M;
                            }
                    }

                    #region Player Target
                    if (PlayerTarget != null && (PlayerTarget.CanBeMeleed || AtkType != AttackType.Melee) && PlayerTarget.Alive && PlayerTarget.MyClient != null && MyMath.PointDistance(Loc.X, Loc.Y, PlayerTarget.Loc.X, PlayerTarget.Loc.Y) < Math.Max(15, (int)AttackDist) && (Type != MobBehaveour.HuntMobsAndBlue || PlayerTarget.BlueName))
                    {
                        if (MyMath.PointDistance(Loc.X, Loc.Y, PlayerTarget.Loc.X, PlayerTarget.Loc.Y) >= AttackDist)
                        {
                            byte ToDir = (byte)(7 - (Math.Floor(MyMath.PointDirecton(Loc.X, Loc.Y, PlayerTarget.Loc.X, PlayerTarget.Loc.Y) / 45 % 8)) - 1 % 8);
                            Direction = (byte)((int)ToDir % 8);

                            Location eLoc = Loc;
                            eLoc.Walk(Direction);
                            System.Collections.Hashtable H = (System.Collections.Hashtable)World.H_Mobs[Loc.Map];
                            bool PlaceFree = true;
                            if (DMaps.Loaded)
                            {
                                if (((DMap)DMaps.H_DMaps[Loc.Map]).GetCell(eLoc.X, eLoc.Y).NoAccess) PlaceFree = false;
                            }
                            foreach (Mob M in H.Values)
                                if (M != this && M.Loc.X == eLoc.X && M.Loc.Y == eLoc.Y && M.Alive)
                                {
                                    PlaceFree = false;
                                    break;
                                }
                            if (PlaceFree)
                            {
                                World.Action(this, Packets.Movement(EntityID, Direction).Get);
                                World.Spawn(this, true);
                                Loc.Walk(Direction);
                            }
                            else
                            {
                                for (int i = 0; i < 7; i++)
                                {
                                    PlaceFree = true;
                                    eLoc = Loc;
                                    Direction = (byte)((Direction + 1) % 8);
                                    eLoc.Walk(Direction);

                                    if (DMaps.Loaded)
                                        if (((DMap)DMaps.H_DMaps[Loc.Map]).GetCell(eLoc.X, eLoc.Y).NoAccess) PlaceFree = false;

                                    foreach (Mob M in H.Values)
                                        if (M != this && M.Loc.X == eLoc.X && M.Loc.Y == eLoc.Y && M.Alive)
                                        {
                                            PlaceFree = false;
                                            break;
                                        }
                                    if (PlaceFree)
                                    {
                                        World.Action(this, Packets.Movement(EntityID, Direction).Get);
                                        World.Spawn(this, true);
                                        Loc.Walk(Direction);
                                        break;
                                    }
                                }
                            }
                        }
                        else
                        {
                            if (MyMath.ChanceSuccess(15) || Type == MobBehaveour.HuntMobsAndBlue)
                                PlayerTarget.TakeAttack(this, PrepareAttack(), AtkType);
                            else
                                PlayerTarget.TakeAttack(this, 0, AtkType);
                        }
                    }
                    else PlayerTarget = null;
                    #endregion
                    #region Mob Target
                    if (MobTarget != null && MobTarget.Alive && MyMath.PointDistance(Loc.X, Loc.Y, MobTarget.Loc.X, MobTarget.Loc.Y) < 13)
                    {
                        if (MyMath.PointDistance(Loc.X, Loc.Y, MobTarget.Loc.X, MobTarget.Loc.Y) >= AttackDist)
                        {
                            byte ToDir = (byte)(7 - (Math.Floor(MyMath.PointDirecton(Loc.X, Loc.Y, MobTarget.Loc.X, MobTarget.Loc.Y) / 45 % 8)) - 1 % 8);
                            Direction = (byte)((int)ToDir % 8);

                            Location eLoc = Loc;
                            eLoc.Walk(Direction);
                            System.Collections.Hashtable H = (System.Collections.Hashtable)World.H_Mobs[Loc.Map];
                            bool PlaceFree = true;

                            if (((DMap)DMaps.H_DMaps[Loc.Map]).GetCell(eLoc.X, eLoc.Y).NoAccess) PlaceFree = false;

                            foreach (Mob M in H.Values)
                                if (M != this && M.Loc.X == eLoc.X && M.Loc.Y == eLoc.Y && M.Alive)
                                {
                                    PlaceFree = false;
                                    break;
                                }
                            if (PlaceFree)
                            {
                                World.Action(this, Packets.Movement(EntityID, Direction).Get);
                                World.Spawn(this, true);
                                Loc.Walk(Direction);
                            }
                            else
                            {
                                for (int i = 0; i < 7; i++)
                                {
                                    PlaceFree = true;
                                    eLoc = Loc;
                                    Direction = (byte)((Direction + 1) % 8);
                                    eLoc.Walk(Direction);

                                    if (((DMap)DMaps.H_DMaps[Loc.Map]).GetCell(eLoc.X, eLoc.Y).NoAccess) PlaceFree = false;

                                    foreach (Mob M in H.Values)
                                        if (M != this && M.Loc.X == eLoc.X && M.Loc.Y == eLoc.Y && M.Alive)
                                        {
                                            PlaceFree = false;
                                            break;
                                        }
                                    if (PlaceFree)
                                    {
                                        World.Action(this, Packets.Movement(EntityID, Direction).Get);
                                        World.Spawn(this, true);
                                        Loc.Walk(Direction);
                                        break;
                                    }
                                }
                            }
                        }
                        else
                        {
                            MobTarget.TakeAttack(this, PrepareAttack(), AtkType);
                        }
                    }
                    else MobTarget = null;
                    #endregion
                }
            }
            catch { }
        }
    }
}
go0ba is offline  
Old 02/25/2010, 04:19   #6
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
No I meant the entire code for Line 520.
Arcо is offline  
Old 02/25/2010, 04:41   #7
 
elite*gold: 0
Join Date: Oct 2009
Posts: 7
Received Thanks: 0
this my pro

Code:
DroppedItem DI2 = new DroppedItem();
                DI2.DropTime = DateTime.Now;
                DI2.UID = (uint)Rnd.Next(10000000);
                DI2.Loc = new Location();
                DI2.Loc.X = (ushort)(Loc.X + Rnd.Next(4) - Rnd.Next(4));
                DI2.Loc.Y = (ushort)(Loc.Y + Rnd.Next(4) - Rnd.Next(4));
                DI2.Loc.Map = Loc.Map;
                DI2.Info = new Item();
                DI2.Info.UID = (uint)Rnd.Next(10000000);
                DI2.Owner = Owner;
                Game.Character Char = null;
                if (Game.World.H_Chars.ContainsKey(Owner))
                    Char = (Character)Game.World.H_Chars[Owner];
                if (MyMath.ChanceSuccess(100))
                {

                    if (MobID == 1)
                    {
                        Char.Silvers += 10000;
                        Char.CPs += 10;

                        return;
                    }
                }
                {
go0ba is offline  
Old 02/25/2010, 04:43   #8
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
Quote:
Originally Posted by go0ba View Post
this my pro

Code:
DroppedItem DI2 = new DroppedItem();
                DI2.DropTime = DateTime.Now;
                DI2.UID = (uint)Rnd.Next(10000000);
                DI2.Loc = new Location();
                DI2.Loc.X = (ushort)(Loc.X + Rnd.Next(4) - Rnd.Next(4));
                DI2.Loc.Y = (ushort)(Loc.Y + Rnd.Next(4) - Rnd.Next(4));
                DI2.Loc.Map = Loc.Map;
                DI2.Info = new Item();
                DI2.Info.UID = (uint)Rnd.Next(10000000);
                DI2.Owner = Owner;
                Game.Character Char = null;
                if (Game.World.H_Chars.ContainsKey(Owner))
                    Char = (Character)Game.World.H_Chars[Owner];
Try taht.
Arcо is offline  
Old 02/25/2010, 05:04   #9
 
elite*gold: 0
Join Date: Oct 2009
Posts: 7
Received Thanks: 0
What do you mean ؟
go0ba is offline  
Old 02/25/2010, 05:07   #10
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
Replace your code with mine.
Arcо is offline  
Old 02/25/2010, 08:54   #11
 
allizzel777's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 124
Received Thanks: 2
Hey do you have a reg site on that?
think you could help me set mine up on my VPS? im having alot of trouble...
allizzel777 is offline  
Old 02/25/2010, 16:35   #12
 
elite*gold: 0
Join Date: Oct 2009
Posts: 7
Received Thanks: 0
If you wish to advertise, post in the advertising forum.

Removed.

Korv~
go0ba is offline  
Old 02/25/2010, 16:38   #13
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
I have error also in mob.cs everytime i got to lab 4 i got error, but just only a few times.
salem rey is offline  
Reply


Similar Threads Similar Threads
plaese all some help me i need back old jump
01/15/2009 - Conquer Online 2 - 1 Replies
Any one know how can back jump old for I not like the new jump please some one help me OR any one can found or made patch for back againe old jump ( I perfer the back up one. ) :o



All times are GMT +1. The time now is 17:04.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.