예제 #1
0
 private void ObjectPlayer(S.ObjectPlayer p)
 {
     PlayerObject player = new PlayerObject(p.ObjectID);
     player.Load(p);
 }
예제 #2
0
        public void AddBuffEffect(BuffType type)
        {
            for (int i = 0; i < Effects.Count; i++)
            {
                if (!(Effects[i] is BuffEffect))
                {
                    continue;
                }
                if (((BuffEffect)(Effects[i])).BuffType == type)
                {
                    return;
                }
            }

            PlayerObject ob = null;

            if (Race == ObjectType.Player)
            {
                ob = (PlayerObject)this;
            }

            switch (type)
            {
            case BuffType.Fury:
                Effects.Add(new BuffEffect(Libraries.Magic3, 190, 7, 1400, this, true, type)
                {
                    Repeat = true
                });
                break;

            case BuffType.ImmortalSkin:
                Effects.Add(new BuffEffect(Libraries.Magic3, 570, 5, 1400, this, true, type)
                {
                    Repeat = true
                });
                break;

            case BuffType.SwiftFeet:
                if (ob != null)
                {
                    ob.Sprint = true;
                }
                break;

            case BuffType.MoonLight:
            case BuffType.DarkBody:
                if (ob != null)
                {
                    ob.Sneaking = true;
                }
                break;

            case BuffType.VampireShot:
                Effects.Add(new BuffEffect(Libraries.Magic3, 2110, 6, 1400, this, true, type)
                {
                    Repeat = false
                });
                break;

            case BuffType.PoisonShot:
                Effects.Add(new BuffEffect(Libraries.Magic3, 2310, 7, 1400, this, true, type)
                {
                    Repeat = false
                });
                break;

            case BuffType.EnergyShield:
                BuffEffect effect;

                Effects.Add(effect = new BuffEffect(Libraries.Magic2, 1880, 9, 900, this, true, type)
                {
                    Repeat = false
                });
                SoundManager.PlaySound(20000 + (ushort)Spell.EnergyShield * 10 + 0);

                effect.Complete += (o, e) =>
                {
                    Effects.Add(new BuffEffect(Libraries.Magic2, 1900, 2, 800, this, true, type)
                    {
                        Repeat = true
                    });
                };
                break;

            case BuffType.MagicBooster:
                Effects.Add(new BuffEffect(Libraries.Magic3, 90, 6, 1200, this, true, type)
                {
                    Repeat = true
                });
                break;

            case BuffType.PetEnhancer:
                Effects.Add(new BuffEffect(Libraries.Magic3, 230, 6, 1200, this, true, type)
                {
                    Repeat = true
                });
                break;

            case BuffType.GameMaster:
                Effects.Add(new BuffEffect(Libraries.CHumEffect[5], 0, 1, 1200, this, true, type)
                {
                    Repeat = true
                });
                break;
            }
        }