コード例 #1
0
        public override void Run(Player _client, ConquerItem _item)
        {
            if (_client.PK < 30)
            {
                _client.SendMessage("You must have 30 Pk Points or more to use it.");
            }
            else
            {
                _client.PK -= 30;
                _client.Send(UpdatePacket.Create(_client.UID, UpdateType.Pk, (ulong)_client.PK));
                _client.Save();
                _client.DeleteItem(_item);
                //If Between 30 and 99 and does not have Red Name.....then Add redname
                if (_client.PK >= 30 && _client.PK < 100 && !_client.HasEffect(ClientEffect.Red))
                {
                    _client.RemoveEffect(ClientEffect.Black);
                    _client.AddEffect(ClientEffect.Red, ((_client.PK - 29) * 6) * 60000, true);//Adds red name
                }

                //If under 30 PK, remove redname
                if (_client.PK < 30 && _client.HasEffect(ClientEffect.Red))
                {
                    _client.RemoveEffect(ClientEffect.Red);
                }
            }
        }
コード例 #2
0
 public override void Run(Player client, ConquerItem item)
 {
     if (!client.CombatManager.KnowsSkill(SkillID.Fire))
     {
         if (client.CombatManager.KnowsSkillLevel(SkillID.Thunder, 4))
         {
             if (client.Level >= 40)
             {
                 client.CombatManager.AddOrUpdateSkill(SkillID.Fire, 0);
                 client.DeleteItem(item);
             }
             else
             {
                 client.SendMessage("You need to be at least level 40 to learn Fire.", ChatType.Talk);
             }
         }
         else
         {
             client.SendMessage("Before learning Fire your Thunder must be at least level 40!", ChatType.Talk);
         }
     }
     else
     {
         client.SendMessage("You already know " + item.BaseItem.Name + "!", ChatType.Talk);
     }
 }
コード例 #3
0
 public override void Run(Player client, ConquerItem item)
 {
     if (!client.CombatManager.KnowsSkill(SkillID.Tornado))
     {
         if (client.CombatManager.KnowsSkillLevel(SkillID.Fire, 3))
         {
             if (client.ProfessionType == ProfessionType.FireTaoist && client.Level >= 90)
             {
                 client.CombatManager.AddOrUpdateSkill(SkillID.Tornado, 0);
                 client.DeleteItem(item);
             }
             else
             {
                 client.SendMessage("Only Fire Taoist of at least level 90 may learn Tornado.", ChatType.Talk);
             }
         }
         else
         {
             client.SendMessage("Before learning Tornado your Fire must be at least level 3!", ChatType.Talk);
         }
     }
     else
     {
         client.SendMessage("You already know " + item.BaseItem.Name + "!", ChatType.Talk);
     }
 }
コード例 #4
0
        public override void Run(Player _client, ConquerItem _item)
        {
            if (_client.Level >= 140)
            {
                return;
            }
            if (!_client.Tasks.ContainsKey(TaskType.ExpBall))
            {
                _client.Tasks.TryAdd(TaskType.ExpBall, new Task(_client.UID, TaskType.ExpBall, DateTime.Now.AddHours(24)));
            }
            var task = _client.Tasks[TaskType.ExpBall];

            if (DateTime.Now > task.Expires)
            {
                task.Expires = DateTime.Now.AddHours(24); task.Count = 0;
            }
            if (task.Count >= Constants.EXP_BALL_LIMIT)
            {
                _client.SendMessage("You have used too many exp balls. Please wait until tomorrow");
            }
            else
            {
                task.Count++;
                _client.DeleteItem(_item);
                _client.GainExpBall();
            }
        }
コード例 #5
0
ファイル: EquipmentCtrl.cs プロジェクト: uvbs/conquerserver
        public void LoadEquipment(GameClient Client)
        {
            SQLiteCommand Command = GetConnection().CreateCommand();

            Command.CommandText = "SELECT * FROM Equipments WHERE EntityUID = @UID;";
            Command.Parameters.Add("@UID", DbType.Int32).Value = Client.Entity.UID;

            SQLiteDataReader Reader = Command.ExecuteReader();

            while (Reader.Read())
            {
                ConquerItem Item = new ConquerItem(Client);
                Item.ID            = Convert.ToUInt32(Reader["ItemID"]);
                Item.Plus          = Convert.ToByte(Reader["Plus"]);
                Item.SocketOne     = Convert.ToByte(Reader["SocketOne"]);
                Item.SocketTwo     = Convert.ToByte(Reader["SocketTwo"]);
                Item.Mode          = Convert.ToUInt16(Reader["Mode"]);
                Item.Durability    = Convert.ToUInt16(Reader["Durability"]);
                Item.MaxDurability = Convert.ToUInt16(Reader["MaxDurability"]);
                Item.Effect        = Convert.ToUInt16(Reader["Effect"]);
                Item.Position      = (ItemPosition)Convert.ToByte(Reader["Position"]);

                Client.AddEquipment(Item, Item.Position);
            }
            Reader.Close();
        }
コード例 #6
0
 public override void Run(Player _client, ConquerItem _item)
 {
     _client.Character.HeavenBlessExpires = DateTime.Now.AddDays(30);
     _client.Send(UpdatePacket.Create(_client.UID, Enum.UpdateType.HeavenBlessing, Common.SecondsFromNow(_client.Character.HeavenBlessExpires)));
     _client.Send(UpdatePacket.Create(_client.UID, Enum.UpdateType.SizeAdd, 2));
     _client.Send(UpdatePacket.Create(_client.UID, Enum.UpdateType.OnlineTraining, 0));
     _client.DeleteItem(_item);
 }
コード例 #7
0
 public override void Run(Player _client, ConquerItem _item)
 {
     if (_client.Life >= _client.MaximumLife)
     {
         return;
     }
     _client.Life = Math.Min(_client.Life + _item.BaseItem.HealthAdd, _client.MaximumLife);
     _client.DeleteItem(_item);
 }
 public override void Run(Player _client, ConquerItem _item)
 {
     if (_client.Mana >= _client.MaximumMana)
     {
         return;
     }
     _client.Mana = (ushort)Math.Min(_client.Mana + _item.BaseItem.ManaAdd, _client.MaximumMana);
     _client.DeleteItem(_item);
 }
 public override void Run(Player _client, ConquerItem _item)
 {
     if (_client.Map.IsNoScrollEnabled)
     {
         return;
     }
     _client.ChangeMap(1000);
     _client.DeleteItem(_item);
 }
コード例 #10
0
 public void AddItem(ConquerItem _item)
 {
     if (Items == null)
     {
         Items = new List <ConquerItem>();
     }
     Items.Add(_item);
     Value = (uint)Items.Count;
 }
コード例 #11
0
 public static void ProcessItem(Player _client, ConquerItem _item)
 {
     try
     {
         var   type = Type.GetType("Redux.Items.Item_" + _item.StaticID);
         IItem item = Activator.CreateInstance(type) as IItem;
         item.Run(_client, _item);
     }
     catch { _client.SendMessage("Could not load script for item ID: " + _item.StaticID); }
 }
コード例 #12
0
        private static void Process_Item(Player client, string[] command)
        {
            if (client.Account.Permission < PlayerPermission.GM)
                return;
            uint uid;
            if(command.Length < 2 || !uint.TryParse(command[1], out uid))
            {            	
            	client.SendMessage("Error: Format should be /item {id}");
            	return;
            }
            var info = Database.ServerDatabase.Context.ItemInformation.GetById(uid);
            if (info == null)
            {
                client.SendMessage("Error: No such item ID as " + uid);
                return;
            }
            var item = new ConquerItem((uint)Common.ItemGenerator.Counter, info);
            byte val;
            if (command.Length > 2)
                if (byte.TryParse(command[2], out val))
                    item.Plus = val;
                else
                    client.SendMessage("Error: Format should be /item {id} {+}");

            if(command.Length > 3)
                if(byte.TryParse(command[3], out val))
                    item.Bless = val;
                else
                    client.SendMessage("Error: Format should be /item {id} {+} {-}");

            if (command.Length > 4)
                if (byte.TryParse(command[4], out val))
                    item.Enchant = val;
                else
                    client.SendMessage("Error: Format should be /item {id} {+} {-} {hp}");

            if (command.Length > 5)
                if (byte.TryParse(command[5], out val))
                    item.Gem1 = val;
                else
                    client.SendMessage("Error: Format should be /item {id} {+} {-} {hp} {gem1}");

            if (command.Length > 6)
                if (byte.TryParse(command[6], out val))
                    item.Gem2 = val;
                else
                    client.SendMessage("Error: Format should be /item {id} {+} {-} {hp} {gem1} {gem2}");
            
            item.SetOwner(client);
            if(client.AddItem(item))
            	client.Send(ItemInformationPacket.Create(item));
            else
            	client.SendMessage("Error adding item");             
        }
コード例 #13
0
 public void LoadItem(ConquerItem _item)
 {
     if (!items.ContainsKey((uint)_item.Location))
     {
         items.Add((uint)_item.Location, new Dictionary <uint, ConquerItem>());
     }
     if (!items[(uint)_item.Location].ContainsKey(_item.UniqueID))
     {
         items[(uint)_item.Location].Add(_item.UniqueID, _item);
     }
 }
コード例 #14
0
 public override void Run(Player _client, ConquerItem _Item)
 {
     if (_client.Inventory.Count > 35)
     {
         return;
     }
     _client.DeleteItem(_Item);
     for (var i = 0; i < 5; i++)
     {
         _client.CreateItem(Constants.STONE_ID);
     }
 }
コード例 #15
0
 public override void Run(Player client, ConquerItem item)
 {
     if (!client.CombatManager.KnowsSkill(SkillID.Roamer))
     {
         client.CombatManager.AddOrUpdateSkill(SkillID.Roamer, 0);
         client.DeleteItem(item);
     }
     else
     {
         client.SendMessage("You already know " + item.BaseItem.Name + "!", ChatType.Talk);
     }
 }
コード例 #16
0
 public override void Run(Player _client, ConquerItem _item)
 {
     if (_client.Inventory.Count > 30)
     {
         return;
     }
     _client.DeleteItem(_item);
     for (var i = 0; i < 10; i++)
     {
         _client.CreateItem(Constants.METEOR_ID);
     }
 }
コード例 #17
0
 public override void Run(Player _client, ConquerItem _item)
 {
     if (_client.Inventory.Count >= 37)
     {
         return;
     }
     for (var amt = 0; amt < 3; amt++)
     {
         _client.CreateItem(1001040);
     }
     _client.DeleteItem(_item);
 }
コード例 #18
0
 public bool TryGetItem(uint _whID, uint _itemID, out ConquerItem _item)
 {
     _item = null;
     if (HasItem(_whID, _itemID))
     {
         _item = items[_whID][_itemID];
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #19
0
 //To generate a new ground item we need a conquer item and location
 public GroundItem(ConquerItem _item, uint _uid, Point _location, Map _map, uint _killer = 0, CurrencyType _currency = CurrencyType.None, uint _value = 0)
 {
     Item        = _item;
     StaticID    = _item.GroundID;
     UID         = _uid;
     Location    = _location;
     Map         = _map;
     KillerUID   = _killer;
     DroppedAt   = Common.Clock;
     Currency    = _currency;
     Value       = _value;
     SpawnPacket = GroundItemPacket.Create(this, GroundItemAction.Create);
 }
コード例 #20
0
 public override void Run(Player _client, ConquerItem _item)
 {
     if (_client.Lookface % 2 == 0)
     {
         _client.Lookface--;
     }
     else
     {
         _client.Lookface++;
     }
     _client.Character.Lookface = _client.Lookface;
     _client.Save();
     _client.DeleteItem(_item);
 }
コード例 #21
0
 public DbItem(uint _owner, ConquerItem _item)
 {
     Owner      = _owner;
     UniqueID   = _item.UniqueID;
     StaticID   = _item.StaticID;
     Durability = _item.Durability;
     Location   = _item.Location;
     Plus       = _item.Plus;
     Bless      = _item.Bless;
     Enchant    = _item.Enchant;
     Gem1       = _item.Gem1;
     Gem2       = _item.Gem2;
     Effect     = _item.Effect;
     Locked     = _item.Locked;
 }
コード例 #22
0
        public override void Run(Player _client, ConquerItem _item)
        {
            ConquerItem arm;

            _client.TryGetEquipmentByLocation(Enum.ItemLocation.Armor, out arm);

            if (arm != null && arm.Color != 2)
            {
                arm.Color = 2;
                _client.SpawnPacket.ArmorColor = 2;
                _client.SendToScreen(_client.SpawnPacket, true);
                _client.Send(Packets.Game.ItemInformationPacket.Create(arm, Enum.ItemInfoAction.Update));
                arm.Save();
                _client.DeleteItem(_item);
            }
        }
コード例 #23
0
 public override void Run(Player client, ConquerItem item)
 {
     if (!client.CombatManager.KnowsSkill(SkillID.NightDevil))
     {
         if (client.Level >= 70)
         {
             client.CombatManager.AddOrUpdateSkill(SkillID.NightDevil, 0);
             client.DeleteItem(item);
         }
         client.SendMessage("You need to be at least level 70 to learn NightDevil.", ChatType.Talk);
     }
     else
     {
         client.SendMessage("You already know " + item.BaseItem.Name + "!", ChatType.Talk);
     }
 }
コード例 #24
0
 public override void Run(Player client, ConquerItem item)
 {
     if (!client.CombatManager.KnowsSkill(SkillID.Thunder))
     {
         if (client.Spirit >= 20)
         {
             client.CombatManager.AddOrUpdateSkill(SkillID.Thunder, 0);
             client.DeleteItem(item);
         }
         else
         {
             client.SendMessage("You need at least 20 spirit to learn Thunder", ChatType.Talk);
         }
     }
     else
     {
         client.SendMessage("You already know " + item.BaseItem.Name + "!", ChatType.Talk);
     }
 }
コード例 #25
0
 public override void Run(Player client, ConquerItem item)
 {
     if (!client.CombatManager.KnowsSkill(SkillID.Lightning))
     {
         if (client.ProfessionType == ProfessionType.TaoistAll && client.Spirit >= 25)
         {
             client.CombatManager.AddOrUpdateSkill(SkillID.Lightning, 0);
             client.DeleteItem(item);
         }
         else
         {
             client.SendMessage("Only taoist with at least 25 spirit can learn Lightning", ChatType.Talk);
         }
     }
     else
     {
         client.SendMessage("You already know " + item.BaseItem.Name + "!", ChatType.Talk);
     }
 }
コード例 #26
0
 public override void Run(Player client, ConquerItem item)
 {
     if (!client.CombatManager.KnowsSkill(SkillID.ScentSword))
     {
         if (client.CombatManager.CheckProficiency(420, 5))
         {
             client.CombatManager.AddOrUpdateSkill(SkillID.ScentSword, 0);
             client.DeleteItem(item);
         }
         else
         {
             client.SendMessage("Your sword proficiency needs to be at least level 5.", ChatType.Talk);
         }
     }
     else
     {
         client.SendMessage("You already know " + item.BaseItem.Name + "!", ChatType.Talk);
     }
 }
コード例 #27
0
 public override void Run(Player client, ConquerItem item)
 {
     if (!client.CombatManager.KnowsSkill(SkillID.DivineHare))
     {
         if (client.Level >= 54 && client.ProfessionType == ProfessionType.WaterTaoist)
         {
             client.CombatManager.AddOrUpdateSkill(SkillID.DivineHare, 0);
             client.DeleteItem(item);
         }
         else
         {
             client.SendMessage("Only Water Taoists of at least level 54 can learn DivineHare.", ChatType.Talk);
         }
     }
     else
     {
         client.SendMessage("You already know " + item.BaseItem.Name + "!", ChatType.Talk);
     }
 }
コード例 #28
0
 public override void Run(Player client, ConquerItem item)
 {
     if (!client.CombatManager.KnowsSkill(SkillID.SpeedLightning))
     {
         if (client.Level >= 70 && client.ProfessionType == ProfessionType.FireTaoist || client.ProfessionType == ProfessionType.WaterTaoist || client.ProfessionType == ProfessionType.TaoistAll)
         {
             client.CombatManager.AddOrUpdateSkill(SkillID.SpeedLightning, 0);
             client.DeleteItem(item);
         }
         else
         {
             client.SendMessage("Only taoist of at least level 70 can learn SpeedLightening", ChatType.Talk);
         }
     }
     else
     {
         client.SendMessage("You already know " + item.BaseItem.Name + "!", ChatType.Talk);
     }
 }
コード例 #29
0
 public override void Run(Player client, ConquerItem item)
 {
     if (!client.CombatManager.KnowsSkill(SkillID.FlyingMoon))
     {
         if (client.ProfessionType == ProfessionType.Warrior && client.Level >= 40)
         {
             client.CombatManager.AddOrUpdateSkill(SkillID.FlyingMoon, 0);
             client.DeleteItem(item);
         }
         else
         {
             client.SendMessage("Only Warriors of at least level 40 can learn FlyingMoon", ChatType.Talk);
         }
     }
     else
     {
         client.SendMessage("You already know " + item.BaseItem.Name + "!", ChatType.Talk);
     }
 }
コード例 #30
0
        public DbItem CreateNewItem(uint owner, ConquerItem info)
        {
            var item = new DbItem();

            item.UniqueID   = info.UniqueID;
            item.StaticID   = info.StaticID;
            item.Owner      = owner;
            item.Plus       = info.Plus;
            item.Durability = info.Durability;
            item.Location   = info.Location;
            item.Color      = info.Color;
            item.Bless      = info.Bless;
            item.Enchant    = info.Enchant;
            item.Gem1       = info.Gem1;
            item.Gem2       = info.Gem2;
            item.Effect     = info.Effect;
            item.Locked     = info.Locked;
            ServerDatabase.Context.Items.AddOrUpdate(item);
            return(item);
        }
コード例 #31
0
ファイル: EquipmentCtrl.cs プロジェクト: uvbs/conquerserver
        private bool InsertEquipment(uint UID, ConquerItem Item)
        {
            SQLiteCommand Command = GetConnection().CreateCommand();
            Command.CommandText = "INSERT INTO Equipments (EntityUID, ItemID, Plus, SocketOne, SocketTwo, Mode, Durability, " +
                                  "MaxDurability, Effect, Position) VALUES (@UID, @ID, @Plus, @SocketOne, @SocketTwo, " +
                                  "@Mode, @Durability, @MaxDurability, @Effect, @Position);";

            Command.Parameters.Add("@ID", DbType.Int32).Value = Item.ID;
            Command.Parameters.Add("@Plus", DbType.Int32).Value = Item.Plus;
            Command.Parameters.Add("@SocketOne", DbType.Int32).Value = Item.SocketOne;
            Command.Parameters.Add("@SocketTwo", DbType.Int32).Value = Item.SocketTwo;
            Command.Parameters.Add("@Mode", DbType.Int32).Value = Item.Mode;
            Command.Parameters.Add("@Durability", DbType.Int32).Value = Item.Durability;
            Command.Parameters.Add("@MaxDurability", DbType.Int32).Value = Item.MaxDurability;
            Command.Parameters.Add("@Effect", DbType.Int32).Value = Item.Effect;
            Command.Parameters.Add("@Position", DbType.Int32).Value = (int)Item.Position;
            Command.Parameters.Add("@UID", DbType.Int32).Value = UID;

            // One or more rows were updated
            return Command.ExecuteNonQuery() >= 1;
        }
コード例 #32
0
ファイル: EquipmentCtrl.cs プロジェクト: uvbs/conquerserver
        public void LoadEquipment(GameClient Client)
        {
            SQLiteCommand Command = GetConnection().CreateCommand();
            Command.CommandText = "SELECT * FROM Equipments WHERE EntityUID = @UID;";
            Command.Parameters.Add("@UID", DbType.Int32).Value = Client.Entity.UID;

            SQLiteDataReader Reader = Command.ExecuteReader();
            while (Reader.Read())
            {
                ConquerItem Item = new ConquerItem(Client);
                Item.ID = Convert.ToUInt32(Reader["ItemID"]);
                Item.Plus = Convert.ToByte(Reader["Plus"]);
                Item.SocketOne = Convert.ToByte(Reader["SocketOne"]);
                Item.SocketTwo = Convert.ToByte(Reader["SocketTwo"]);
                Item.Mode = Convert.ToUInt16(Reader["Mode"]);
                Item.Durability = Convert.ToUInt16(Reader["Durability"]);
                Item.MaxDurability = Convert.ToUInt16(Reader["MaxDurability"]);
                Item.Effect = Convert.ToUInt16(Reader["Effect"]);
                Item.Position = (ItemPosition)Convert.ToByte(Reader["Position"]);

                Client.AddEquipment(Item, Item.Position);
            }
            Reader.Close();
        }
コード例 #33
0
ファイル: ItemsCtrl.cs プロジェクト: uvbs/conquerserver
 public void Add(ConquerItem Item)
 {
 }
コード例 #34
0
        public CommandAction Process(GameClient Client, string[] Input)
        {
            string From = Input[0];
            string To = Input[1];
            string Message = Input[3];

            string[] Command = Message.Split(' ');

            CommandAction Action = CommandAction.None;
            if (Command[0].StartsWith("@"))
                Action = CommandAction.Processed;

            try
            {
                switch (Command[0])
                {
                    case "@quit":
                        {
                            Client.Disconnect();
                        } break;
                    case "@mm":
                        {
                            ushort MapID = ushort.Parse(Command[1]);
                            ushort X = ushort.Parse(Command[2]);
                            ushort Y = ushort.Parse(Command[3]);

                            Client.Teleport(MapID, X, Y);
                        } break;
                    case "@gold":
                        {

                            Client.Entity.Money = uint.Parse(Command[1]);
                        } break;
                    case "@item":
                        {
                            if (Command.Length > 2)
                            {
                                ConquerItem Item = new ConquerItem(Client, Database.GetItemDetail(Command[1], Command[2]));
                                Item.Position = ItemPosition.Inventory;
                                if (Command.Length > 3)
                                {
                                    Item.Plus = byte.Parse(Command[3]);
                                    if (Command.Length > 4)
                                    {
                                        Item.SocketOne = byte.Parse(Command[4]);
                                        if (Command.Length > 5)
                                        {
                                            Item.SocketTwo = byte.Parse(Command[5]);
                                        }
                                    }
                                }
                                Client.AddInventory(Item);
                            }
                        } break;
                    case "@prof":
                        {
                            LearnProfiency Profiency = LearnProfiency.Create();
                            Profiency.ID = uint.Parse(Command[1]);
                            Profiency.Level = uint.Parse(Command[2]);
                            Client.LearnProfiency(Profiency);
                        } break;
                    case "@spell":
                        {
                            LearnSpell Spell = LearnSpell.Create();
                            Spell.ID = ushort.Parse(Command[1]);
                            Spell.Level = ushort.Parse(Command[2]);
                            Client.LearnSpell(Spell);
                        } break;
                    case "@job":
                        {
                            Client.Entity.Class = byte.Parse(Command[1]);

                            Client.Entity.BeginStatusUpdates();
                            Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.Job, Client.Entity.Class));
                            Client.Entity.EndStatusUpdates();
                        } break;
                    case "@str":
                        {
                            byte Strength = byte.Parse(Command[1]);
                            if (Strength <= Client.Entity.StatusPoints.Free)
                            {
                                Client.Entity.StatusPoints.Strength += Strength;
                                Client.Entity.StatusPoints.Free -= Strength;

                                Client.Entity.BeginStatusUpdates();
                                Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.StatPoints, Client.Entity.StatusPoints.Free));
                                Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.Strength, Client.Entity.StatusPoints.Strength));
                                Client.Entity.EndStatusUpdates();
                            }
                        } break;
                    case "@vit":
                        {
                            byte Vitality = byte.Parse(Command[1]);
                            if (Vitality <= Client.Entity.StatusPoints.Free)
                            {
                                Client.Entity.StatusPoints.Vitality += Vitality;
                                Client.Entity.StatusPoints.Free -= Vitality;

                                Client.Entity.BeginStatusUpdates();
                                Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.StatPoints, Client.Entity.StatusPoints.Free));
                                Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.Vitality, Client.Entity.StatusPoints.Vitality));
                                Client.Entity.EndStatusUpdates();
                            }
                        } break;
                    case "@dex":
                        {
                            byte Dexterity = byte.Parse(Command[1]);
                            if (Dexterity <= Client.Entity.StatusPoints.Free)
                            {
                                Client.Entity.StatusPoints.Dexterity += Dexterity;
                                Client.Entity.StatusPoints.Free -= Dexterity;

                                Client.Entity.BeginStatusUpdates();
                                Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.StatPoints, Client.Entity.StatusPoints.Free));
                                Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.Agility, Client.Entity.StatusPoints.Dexterity));
                                Client.Entity.EndStatusUpdates();
                            }
                        } break;
                    case "@spi":
                        {
                            byte Spirit = byte.Parse(Command[1]);
                            if (Spirit <= Client.Entity.StatusPoints.Free)
                            {
                                Client.Entity.StatusPoints.Spirit += Spirit;
                                Client.Entity.StatusPoints.Free -= Spirit;

                                Client.Entity.BeginStatusUpdates();
                                Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.StatPoints, Client.Entity.StatusPoints.Free));
                                Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.Spirit, Client.Entity.StatusPoints.Spirit));
                                Client.Entity.EndStatusUpdates();
                            }
                        } break;
                    case "@free":
                        {
                            Client.Entity.StatusPoints.Free = 397;
                            Client.Entity.StatusPoints.Dexterity = 0;
                            Client.Entity.StatusPoints.Spirit = 0;
                            Client.Entity.StatusPoints.Strength = 0;
                            Client.Entity.StatusPoints.Vitality = 0;

                            Client.Entity.BeginStatusUpdates();
                            Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.StatPoints, Client.Entity.StatusPoints.Free));
                            Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.Spirit, Client.Entity.StatusPoints.Spirit));
                            Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.Agility, Client.Entity.StatusPoints.Dexterity));
                            Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.Vitality, Client.Entity.StatusPoints.Vitality));
                            Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.Strength, Client.Entity.StatusPoints.Strength));
                            Client.Entity.EndStatusUpdates();
                        } break;
                    case "@reload_npc":
                        {
                            return CommandAction.ClearNpcScripts;
                        }
                }
            }
            catch (Exception exception)
            {
                Client.Message(exception.Message, ChatType.Top, Color.White);
                Console.WriteLine(exception.ToString());
            }
            return Action;
        }
コード例 #35
0
ファイル: EquipmentCtrl.cs プロジェクト: uvbs/conquerserver
        private bool UpdateEquipment(uint UID, ConquerItem Item)
        {
            SQLiteCommand Command = GetConnection().CreateCommand();
            Command.CommandText = "UPDATE Equipments SET ItemID = @ID, Plus = @Plus, SocketOne = @SocketOne, SocketTwo = @SocketTwo, " +
                                  "Mode = @Mode, Durability = @Durability, MaxDurability = @Durability, Effect = @Effect, Position = @Position " +
                                  "WHERE EntityUID = @UID AND Position = @Position;";

            Command.Parameters.Add("@ID", DbType.Int32).Value = Item.ID;
            Command.Parameters.Add("@Plus", DbType.Int32).Value = Item.Plus;
            Command.Parameters.Add("@SocketOne", DbType.Int32).Value = Item.SocketOne;
            Command.Parameters.Add("@SocketTwo", DbType.Int32).Value = Item.SocketTwo;
            Command.Parameters.Add("@Mode", DbType.Int32).Value = Item.Mode;
            Command.Parameters.Add("@Durability", DbType.Int32).Value = Item.Durability;
            Command.Parameters.Add("@MaxDurability", DbType.Int32).Value = Item.MaxDurability;
            Command.Parameters.Add("@Effect", DbType.Int32).Value = Item.Effect;
            Command.Parameters.Add("@Position", DbType.Int32).Value = (int)Item.Position;
            Command.Parameters.Add("@UID", DbType.Int32).Value = UID;

            // One or more rows were updated
            return Command.ExecuteNonQuery() >= 1;
        }