Esempio n. 1
0
 public UnequipItem(PlayerItem PlayerItem, WorldEntity Entity)
     : base(0x06, 10)
 {
     writer.Write(Entity.WorldId);
     writer.Write(PlayerItem.IID);
     writer.Write((ushort)PlayerItem.Index);
 }
Esempio n. 2
0
        public Drop(PlayerItem PlayerItem, Vector3 Position)
        {
            this.PlayerItem = PlayerItem;

            this.Position.X = Position.X;
            this.Position.Y = Position.Y;
            this.Position.Z = Position.Z;
        }
Esempio n. 3
0
        public void Execute(Character Character, string Message)
        {
            string[] args = Message.Split(' ');
            int index = Convert.ToInt32(args[1]);

            //check if the item exists
            if (Item.FindByIndex(index) != null)
            {
                PlayerItem pItem = new PlayerItem();
                pItem.Index = index;
                pItem.MaxEnd = (byte)pItem.Item.Endurance;
                pItem.CurEnd = pItem.MaxEnd;
                pItem.Num = 1;
                Character.Inventory.AddItem(pItem);
            }
            else
            {
                ServerConsole.WriteLine("Index {0} does not exist", MessageLevel.Error, index);
            }
        }
Esempio n. 4
0
 public AddToInventory(PlayerItem PlayerItem)
     : base(0x07, 26)
 {
     writer.Write((int)PlayerItem.IID);
     writer.Write((ushort)PlayerItem.Index);
     writer.Write((byte)PlayerItem.Prefix);
     writer.Write((int)PlayerItem.Info);
     writer.Write((int)PlayerItem.Num);
     writer.Write((byte)PlayerItem.MaxEnd);
     writer.Write((byte)PlayerItem.CurEnd);
     writer.Write((byte)PlayerItem.SetGem); // SetGem
     writer.Write((byte)PlayerItem.XAttack);
     writer.Write((byte)PlayerItem.XMagic);
     writer.Write((byte)PlayerItem.XDefense);
     writer.Write((byte)PlayerItem.XHit);
     writer.Write((byte)PlayerItem.XDodge);
     writer.Write((byte)PlayerItem.Protect);
     writer.Write((byte)PlayerItem.UpgrLevel);
     writer.Write((byte)PlayerItem.UpgrRate);
     ServerConsole.WriteLine("added {0} to inventory", MessageLevel.Message, PlayerItem.Index);
 }
Esempio n. 5
0
        public virtual PlayerItem Split(int Quantity)
        {
            if (this.Num > Quantity && Quantity > 0)
            {
                this.Num -= Quantity;

                PlayerItem newPlayerItem = new PlayerItem();
                newPlayerItem.IID = 0;
                newPlayerItem.PID = 0;
                newPlayerItem.Index = this.Index;
                newPlayerItem.Prefix = this.Prefix;
                newPlayerItem.Info = this.Info;
                newPlayerItem.Num = Quantity;
                newPlayerItem.MaxEnd = this.MaxEnd;
                newPlayerItem.CurEnd = this.CurEnd;
                newPlayerItem.SetGem = this.SetGem;
                newPlayerItem.XAttack = this.XAttack;
                newPlayerItem.XMagic = this.XMagic;
                newPlayerItem.XDefense = this.XDefense;
                newPlayerItem.XHit = this.XHit;
                newPlayerItem.XDodge = this.XDodge;
                newPlayerItem.Protect = this.Protect;
                newPlayerItem.UpgrLevel = this.UpgrLevel;
                newPlayerItem.UpgrRate = this.UpgrRate;

                Database.Update(Database.KalDB, this);

                return newPlayerItem;
            }
            else
            {
                throw new Exception("Unable to split item");
            }
        }
Esempio n. 6
0
 public virtual void Join(PlayerItem PlayerItem)
 {
     if (CanJoin(PlayerItem))
     {
         Num += PlayerItem.Num;
         PlayerItem.Num = 0;
         Database.Update(Database.KalDB, this);
     }
 }
Esempio n. 7
0
        public virtual PlayerItem Copy()
        {
            PlayerItem newPlayerItem = new PlayerItem();
            newPlayerItem.IID = this.IID;
            newPlayerItem.PID = this.PID;
            newPlayerItem.Index = this.Index;
            newPlayerItem.Prefix = this.Prefix;
            newPlayerItem.Info = this.Info;
            newPlayerItem.Num = this.Num;
            newPlayerItem.MaxEnd = this.MaxEnd;
            newPlayerItem.CurEnd = this.CurEnd;
            newPlayerItem.SetGem = this.SetGem;
            newPlayerItem.XAttack = this.XAttack;
            newPlayerItem.XMagic = this.XMagic;
            newPlayerItem.XDefense = this.XDefense;
            newPlayerItem.XHit = this.XHit;
            newPlayerItem.XDodge = this.XDodge;
            newPlayerItem.Protect = this.Protect;
            newPlayerItem.UpgrLevel = this.UpgrLevel;
            newPlayerItem.UpgrRate = this.UpgrRate;

            return newPlayerItem;
        }
Esempio n. 8
0
 public virtual bool CanJoin(PlayerItem PlayerItem)
 {
     return (Index == PlayerItem.Index &&
         Prefix == PlayerItem.Prefix &&
         Info == PlayerItem.Info &&
         MaxEnd == PlayerItem.MaxEnd &&
         CurEnd == PlayerItem.CurEnd &&
         SetGem == PlayerItem.SetGem &&
         XAttack == PlayerItem.XAttack &&
         XMagic == PlayerItem.XMagic &&
         XDefense == PlayerItem.XDefense &&
         XHit == PlayerItem.XHit &&
         XDodge == PlayerItem.XDodge &&
         Protect == PlayerItem.Protect &&
         UpgrLevel == PlayerItem.UpgrLevel &&
         UpgrRate == PlayerItem.UpgrRate && PlayerItem.Item.Plural == 1);
 }