Exemple #1
0
 protected SREntity(SREntity value)
 {
     ID         = value.ID;
     ServerName = value.ServerName;
     Name       = value.Name;
     ID1        = value.ID1;
     ID2        = value.ID2;
     ID3        = value.ID3;
     ID4        = value.ID4;
     m_data     = value.m_data;
 }
        public SRTeleport(SREntity value) : base(value)
        {
            List <NameValueCollection> linkData = DataManager.GetTeleportLinks(this.ID);

            TeleportOptions = new List <SRTeleportOption>();
            if (linkData.Count > 0)
            {
                TeleportName = linkData[0]["name"];
                foreach (NameValueCollection link in linkData)
                {
                    SRTeleportOption Teleport = new SRTeleportOption();
                    Teleport.ID         = uint.Parse(link["destinationid"]);
                    Teleport.Name       = link["destination"];
                    Teleport.ServerName = link["servername"];

                    TeleportOptions.Add(Teleport);
                }
            }
            else
            {
                TeleportName = this.Name;
            }
        }
 public SRModel(SREntity value) : base(value)
 {
     HPMax = uint.Parse(m_data["hp"]);
     HP    = HPMax;
 }
Exemple #4
0
 public SRDrop(SREntity value) : base(value)
 {
 }
Exemple #5
0
        public static SREntity Create(uint ID)
        {
            SREntity obj = new SREntity(ID);

            if (obj.isSkillZone())
            {
                return(new SRSkillZone());
            }
            if (obj.isModel())
            {
                SRModel model = new SRModel(obj);
                obj = model;

                if (model.isPlayer())
                {
                    SRPlayer player = new SRPlayer(model);
                    obj = player;
                }
                else if (model.isNPC())
                {
                    SRNpc npc = new SRNpc(model);
                    obj = npc;

                    if (npc.isMob())
                    {
                        SRMob mob = new SRMob(npc);
                        obj = mob;
                    }
                    else if (npc.isGuide())
                    {
                        SRGuide guide = new SRGuide(npc);
                        obj = guide;
                    }
                    else if (npc.isCOS())
                    {
                        SRCoService cos = new SRCoService(npc);
                        obj = cos;

                        if (cos.isAttackPet())
                        {
                            SRAttackPet pet = new SRAttackPet(cos);
                            obj = pet;
                        }
                        else if (cos.isPickPet())
                        {
                            SRPickPet pet = new SRPickPet(cos);
                            obj = pet;
                        }
                    }
                    else if (npc.isFortressStruct())
                    {
                        SRFortressCos fCos = new SRFortressCos(npc);
                        obj = fCos;
                    }
                    else if (npc.isFortressStruct())
                    {
                        SRFortressStruct fStruct = new SRFortressStruct(npc);
                        obj = fStruct;
                    }
                }
            }
            else if (obj.isDrop())
            {
                SRDrop drop = new SRDrop(obj);
                obj = drop;
            }
            else if (obj.isTeleport())
            {
                SRTeleport teleport = new SRTeleport(obj);
                obj = teleport;
            }
            return(obj);
        }