Beispiel #1
0
        //bool CheckResurrection()
        //{
        //    for (int i = 0; i < 4; i++)
        //    {
        //        Item item = Inventory[i];
        //        if (item == null || !item.Resurrects) continue;
        //        HP = Stats[0] + Stats[0];
        //        MP = Stats[1] + Stats[1];
        //        Inventory[i] = null;
        //        Owner.BroadcastPacket(new TextPacket()
        //        {
        //            BubbleTime = 0,
        //            Stars = -1,
        //            Name = "",
        //            Text = string.Format("{0}'s {1} breaks and he teleports to the nexus!", Name, item.ObjectId)
        //        }, null);
        //        psr.Reconnect(new ReconnectPacket()
        //        {
        //            Host = "",
        //            Port = 2050,
        //            GameId = World.NEXUS_ID,
        //            Name = "Nexus",
        //            Key = Empty<byte>.Array,
        //        });
        //        return true;
        //    }
        //    return false;
        //}
        void GenerateGravestone()
        {
            int maxed = 0;

            foreach (var i in XmlDatas.TypeToElement[ObjectType].Elements("LevelIncrease"))
            {
                int limit = int.Parse(XmlDatas.TypeToElement[ObjectType].Element(i.Value).Attribute("max").Value);
                int idx   = StatsManager.StatsNameToIndex(i.Value);
                if (Stats[idx] >= limit)
                {
                    maxed++;
                }
            }

            short objType;
            int?  time;

            switch (maxed)
            {
            case 8:
                objType = 0x0735; time = null;
                break;

            case 7:
                objType = 0x0734; time = null;
                break;

            case 6:
                objType = 0x072b; time = null;
                break;

            case 5:
                objType = 0x072a; time = null;
                break;

            case 4:
                objType = 0x0729; time = null;
                break;

            case 3:
                objType = 0x0728; time = null;
                break;

            case 2:
                objType = 0x0727; time = null;
                break;

            case 1:
                objType = 0x0726; time = null;
                break;

            default:
                if (Level <= 1)
                {
                    objType = 0x0723; time = 30 * 1000;
                }
                else if (Level < 20)
                {
                    objType = 0x0724; time = 60 * 1000;
                }
                else
                {
                    objType = 0x0725; time = 5 * 60 * 1000;
                }
                break;
            }
            StaticObject obj = new StaticObject(objType, time, true, time == null ? false : true, false);

            obj.Move(X, Y);
            obj.Name = this.Name;
            Owner.EnterWorld(obj);
        }
Beispiel #2
0
        //bool CheckResurrection()
        //{
        //    for (int i = 0; i < 4; i++)
        //    {
        //        Item item = Inventory[i];
        //        if (item == null || !item.Resurrects) continue;
        //        HP = Stats[0] + Stats[0];
        //        MP = Stats[1] + Stats[1];
        //        Inventory[i] = null;
        //        Owner.BroadcastPacket(new TextPacket()
        //        {
        //            BubbleTime = 0,
        //            Stars = -1,
        //            Name = "",
        //            Text = string.Format("{0}'s {1} breaks and he teleports to the nexus!", Name, item.ObjectId)
        //        }, null);
        //        psr.Reconnect(new ReconnectPacket()
        //        {
        //            Host = "",
        //            Port = 2050,
        //            GameId = World.NEXUS_ID,
        //            Name = "Nexus",
        //            Key = Empty<byte>.Array,
        //        });
        //        return true;
        //    }
        //    return false;
        //}
        void GenerateGravestone()
        {
            int maxed = 0;
            foreach (var i in XmlDatas.TypeToElement[ObjectType].Elements("LevelIncrease"))
            {
                int limit = int.Parse(XmlDatas.TypeToElement[ObjectType].Element(i.Value).Attribute("max").Value);
                int idx = StatsManager.StatsNameToIndex(i.Value);
                if (Stats[idx] >= limit)
                    maxed++;
            }

            short objType;
            int? time;
            switch (maxed)
            {
                case 8:
                    objType = 0x0735; time = null;
                    break;
                case 7:
                    objType = 0x0734; time = null;
                    break;
                case 6:
                    objType = 0x072b; time = null;
                    break;
                case 5:
                    objType = 0x072a; time = null;
                    break;
                case 4:
                    objType = 0x0729; time = null;
                    break;
                case 3:
                    objType = 0x0728; time = null;
                    break;
                case 2:
                    objType = 0x0727; time = null;
                    break;
                case 1:
                    objType = 0x0726; time = null;
                    break;
                default:
                    if (Level <= 1)
                    {
                        objType = 0x0723; time = 30 * 1000;
                    }
                    else if (Level < 20)
                    {
                        objType = 0x0724; time = 60 * 1000;
                    }
                    else
                    {
                        objType = 0x0725; time = 5 * 60 * 1000;
                    }
                    break;
            }
            StaticObject obj = new StaticObject(objType, time, true, time == null ? false : true, false);
            obj.Move(X, Y);
            obj.Name = this.Name;
            Owner.EnterWorld(obj);
        }