private MessageList GetCurrentUserReadingMessage(UserItem item) { MessageList mList = new MessageList(); MessageOperator mo = new MessageOperator(); mList = mo.GetNoReadMessage4ToUserId(item.Id); return mList; }
protected void BindData() { UserItem userObj = new UserItem(); PagerNavication.RecordsCount = DataBase.HEntityCommon.HEntity(userObj).EntityCount(); UserItem[] al = UserItem.List("", "", PagerNavication.PageIndex, PagerNavication.PageSize); rptItems.DataSource = al; rptItems.DataBind(); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); Item = null; ShowItem = null; DisposeCountLabel(); }
protected void btnSave_ServerClick(object sender, EventArgs e) { string strUserName = txt_UserName.Value.Trim(); string strNickName = txt_NickName.Value.Trim(); string strPassword = txt_Password.Value.Trim(); string strPasswordSecond = txt_PasswordSecond.Value.Trim(); if ("" == strUserName || "" == strNickName || "" == strPassword || "" == strPasswordSecond) return; if(UserItem.ExistUser(strUserName)) { PageUtil.PageAlert(this.Page, "该用户名已存在!"); return; } if (!strPassword.Equals(strPasswordSecond)) { PageUtil.PageAlert(this.Page, "密码和确认密码不一致!"); return; } if (lb_RoleSelect.Items.Count == 0) { PageUtil.PageAlert(this.Page, "请选择角色!"); return; } UserItem addItem = new UserItem(); addItem.UserName = strUserName; addItem.NickName = strNickName; addItem.Password = Util.MD5Encrypt(strPassword); addItem.Gender = rb_GenderMale.Checked ? "男" : "女"; string strTel = txt_Tel.Value.Trim(); if ("" != strTel) addItem.Tel = txt_Tel.Value.Trim(); string strEmail = txt_Email.Value.Trim(); if ("" != strEmail) addItem.Email = txt_Email.Value.Trim(); int nNewId = UserItem.Save(addItem); if (nNewId <= 0) return; UserRoleItem[] alUserRoles = UserRoleItem.GetUserRoles(nNewId); Hashtable htExistRoles = new Hashtable(); if (null != alUserRoles) { foreach (UserRoleItem item in alUserRoles) htExistRoles[item.RoleItemId + ""] = 1; } foreach (ListItem item in lb_RoleSelect.Items) { if (htExistRoles.ContainsKey(item.Value)) continue; UserRoleItem addUserRole = new UserRoleItem(); addUserRole.RoleItemId = int.Parse(item.Value); addUserRole.UserItemId = nNewId; UserRoleItem.Save(addUserRole); } PageUtil.PageAlert(this.Page, "保存成功!"); }
public ItemObject(MapObject dropper, UserItem item, Point manualpoint) { ExpireTime = Envir.Time + Settings.ItemTimeOut * Settings.Minute; Item = item; if (Item.IsAdded) NameColour = Color.Cyan; CurrentMap = dropper.CurrentMap; CurrentLocation = manualpoint; }
private async void AddNewItemButtonClick(object sender, RoutedEventArgs e) { var price = 0; int.TryParse(this.PriceTextBox.Text, out price); var item = new UserItem { Name = this.NameTextBox.Text, Price = price }; await this.InsertUserAsync(item); }
//TOADD //ItemSplit //ItemMerge public void ItemCombined(string source, UserItem fromItem, UserItem toItem, int slotFrom, int slotTo, MirGridType grid) { string task = string.Empty; if (fromItem != null && toItem != null) { task = string.Format("Item Combined - {0} with {1} from {2} to {3} in {4} ({5})", fromItem.Info.Name, toItem.Info.Name, slotFrom, slotTo, grid, toItem.UniqueID); } Action action = new Action { Source = source, Task = task }; RecordAction(action); }
public void ItemMoved(string source, UserItem item, MirGridType from, MirGridType to, int slotFrom, int slotTo) { string task = string.Empty; if (item != null) { task = string.Format("Item Moved - {0} from {1}:{2} to {3}:{4} ({5})", item.Info.Name, from, slotFrom, to, slotTo, item.UniqueID); } Action action = new Action { Source = source, Task = task }; RecordAction(action); }
public AuctionInfo(BinaryReader reader) { AuctionID = reader.ReadUInt64(); Item = new UserItem(reader); ConsignmentDate = DateTime.FromBinary(reader.ReadInt64()); Price = reader.ReadUInt32(); CharacterIndex = reader.ReadInt32(); Expired = reader.ReadBoolean(); Sold = reader.ReadBoolean(); }
private void SetData(ConsoleNode console, SearchMode mode) { try { lvMembers.Items.Clear(); if (mode == SearchMode.User) { lbMembers.Text = "&Users:"; this.Text = "Users"; UserStorageView[] users = console.Manager.Admon_GetUserList(console.Credentials); foreach (UserStorageView user in users) { UserItem ui = new UserItem(user.Username); ui.ImageIndex = 3; ui.User = user; lvMembers.Items.Add(ui); } } else if (mode == SearchMode.Group) { lbMembers.Text = "&Groups:"; this.Text = "Groups"; GroupStorageView[] groups = console.Manager.Admon_GetGroups(console.Credentials); foreach (GroupStorageView group in groups) { GroupItem gi = new GroupItem(group.GroupName); gi.ImageIndex = 2; gi.GroupView = group; lvMembers.Items.Add(gi); } } else if (mode == SearchMode.Permission) { lbMembers.Text = "&Permissions:"; this.Text = "Permissions"; PermissionStorageView[] permissions = console.Manager.Admon_GetPermissions(console.Credentials); foreach (PermissionStorageView permission in permissions) { PermissionItem prm = new PermissionItem(permission.PermissionName); prm.ImageIndex = 12; prm.Permission = new PermissionStorageView(permission.PermissionId, permission.PermissionName); lvMembers.Items.Add(prm); } } } catch (Exception ex) { MessageBox.Show("Error filling search list:" + ex.Message, "Search Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public ItemObject(MapObject dropper, UserItem item, bool DeathDrop = false) { if (DeathDrop)//player dropped it when he died: allow for time to run back and pickup his drops ExpireTime = Envir.Time + Settings.PlayerDiedItemTimeOut * Settings.Minute; else ExpireTime = Envir.Time + Settings.ItemTimeOut * Settings.Minute; Item = item; if (Item.IsAdded) NameColour = Color.Cyan; CurrentMap = dropper.CurrentMap; CurrentLocation = dropper.CurrentLocation; }
protected void btnUpdate_Click(object sender, EventArgs e) { UserItem u = new UserItem(); u = (UserItem)HttpContext.Current.Session["User"]; u.UserID = u.UserID; u.Email = txtEmail.Text; u.FirstName = txtFirstName.Text; u.LastName = txtLastName.Text; u.Address = txtAddress.Text; u.ZipCode = txtZipCode.Text; u.City = txtCity.Text; if (txtPhone.Text.Length > 1) { u.Phone = Convert.ToInt64(txtPhone.Text); } else u.Phone = 0; if (txtMobilePhone.Text.Length > 1) { u.MobilePhone = Convert.ToInt64(txtMobilePhone.Text); } else u.MobilePhone = 0; u.PassWord = txtPassword.Text; if (UserItem.CheckPassword(u.UserID, u.PassWord)) { if (UserItem.UpdateUser(u)) { litFeedback.Text = "<div style='border: 1px solid #ccc;background-color: Green;color:White;'>Dina ändringar är sparade.</div>"; } else { litFeedback.Text = "<div style='border: 1px solid #ccc;background-color: Red;color:White;'>Dina ändringar är inte sparade.</div>"; } } else { lblPassword.Text = "Fel lösenord."; } }
protected void Page_Load(object sender, EventArgs e) { if (this.Request["msgId"] != "0" && this.Request["msgId"]!=null) { this.MakeMsgShow(Convert.ToInt32(this.Request["msgId"])); } this.hidHostName.Value = ((UserItem)this.Session["User"]).NickName; this.hidHostId.Value = ((UserItem)this.Session["User"]).Id.ToString(); if(this.Request["hostId"]!=null && this.Request["otherId"]!=null) { this.hidOtherId.Value = this.Request["otherId"].ToString(); UserItem other = new UserItem(); other = (new UsersOperator()).LoadUser(Convert.ToInt32(this.Request["otherId"])); this.hidOtherName.Value = other.NickName; this.txtChatPrivateList.InnerText += ""; this.txtChatPrivateList.InnerHtml += ""; } }
protected void btnRegister_Click(object sender, ImageClickEventArgs e) { UserItem item = new UserItem(); item.LoginPwd = this.txtPwd.Text; item.NickName = this.txtNickName.Text; item.Sex=this.rdbMan.Checked ? "男" : "女"; item.Name = this.txtName.Text; item.StarId = Convert.ToInt32(this.ddlConstellation.SelectedItem.Value); item.BloodTypeId = Convert.ToInt32(this.ddlBloodType.SelectedItem.Value); item.FaceId = Convert.ToInt32(this.hidFaceId.Value); UsersOperator uo = new UsersOperator(); if (uo.InsertUser(item) == 1) { this.divLoginInfo.InnerText = "你的MyQQ ID为" + uo.LastUserId.ToString(); } else { this.divLoginInfo.InnerText = "服务器错误"; } }
public MailInfo(BinaryReader reader, int version, int customversion) { MailID = reader.ReadUInt64(); Sender = reader.ReadString(); RecipientIndex = reader.ReadInt32(); Message = reader.ReadString(); Gold = reader.ReadUInt32(); int count = reader.ReadInt32(); for (int i = 0; i < count; i++) { UserItem item = new UserItem(reader, version, customversion); if (SMain.Envir.BindItem(item)) Items.Add(item); } DateSent = DateTime.FromBinary(reader.ReadInt64()); DateOpened = DateTime.FromBinary(reader.ReadInt64()); Locked = reader.ReadBoolean(); Collected = reader.ReadBoolean(); CanReply = reader.ReadBoolean(); }
protected override void OnMouseEnter() { base.OnMouseEnter(); if (ShowItem == null) ShowItem = new UserItem(Item) { MaxDura = Item.Durability, CurrentDura = Item.Durability }; GameScene.Scene.CreateItemLabel(ShowItem); }
//protected override bool CanRegen { get { return false; } } protected override bool DropItem(UserItem item) { throw new NotSupportedException(); }
public void ProcessItem(UserItem[] inventory) { for (int i = 0; i < Info.ItemTasks.Count; i++) { long count = inventory.Where(item => item != null). Where(item => item.Info == Info.ItemTasks[i].Item). Aggregate<UserItem, long>(0, (current, item) => current + item.Count); ItemTaskCount[i] = count; } }
public Authorization(UserItem user) { User = user; }
public int UpgradeAwake(UserItem item, AwakeType type, out bool[] isHit) { //return -1 condition error, -1 = dont upgrade, 0 = failed, 1 = Succeed, isHit = null; if (CheckAwakening(item, type) != true) return -1; Random rand = new Random(DateTime.Now.Millisecond); if (rand.Next(0, 100) <= AwakeSuccessRate) { isHit = Awakening(item); return 1; } else { int idx; isHit = makeHit(1, out idx); return 0; } }
public UserItem Clone() { UserItem item = new UserItem(Info) { UniqueID = UniqueID, CurrentDura = CurrentDura, MaxDura = MaxDura, Count = Count, AC = AC, MAC = MAC, DC = DC, MC = MC, SC = SC, Accuracy = Accuracy, Agility = Agility, HP = HP, MP = MP, AttackSpeed = AttackSpeed, Luck = Luck, DuraChanged = DuraChanged, SoulBoundId = SoulBoundId, Identified = Identified, Cursed = Cursed, Strong = Strong, MagicResist = MagicResist, PoisonResist = PoisonResist, HealthRecovery = HealthRecovery, ManaRecovery = ManaRecovery, PoisonRecovery = PoisonRecovery, CriticalRate = CriticalRate, CriticalDamage = CriticalDamage, Freezing = Freezing, PoisonAttack = PoisonAttack, Slots = Slots, Awake = Awake, RefinedValue = RefinedValue, RefineAdded = RefineAdded, ExpireInfo = ExpireInfo }; return item; }
protected virtual bool DropItem(UserItem item) { if (CurrentMap.Info.NoDropMonster) return false; ItemObject ob = new ItemObject(this, item) { Owner = EXPOwner, OwnerTime = Envir.Time + Settings.Minute, }; return ob.Drop(Settings.DropRange); }
public void Handle(GameClient Session, ClientMessage Event) { try { Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (@class != null && @class.CheckRights(Session, true)) { RoomItem class2 = @class.method_28(Event.PopWiredUInt()); UserItem class3 = Session.GetHabbo().GetInventoryComponent().GetItemById(class2.uint_0); if (class2 != null) { if (class2.GetBaseItem().Name.StartsWith("CF_") || class2.GetBaseItem().Name.StartsWith("CFC_") || class2.GetBaseItem().Name.StartsWith("PixEx_") || class2.GetBaseItem().Name.StartsWith("PntEx_")) { if (class3 != null) { @class.method_29(null, class3.uint_0, true, true); } else { DataRow dataRow = null; using (DatabaseClient class4 = HabboIM.GetDatabase().GetClient()) { dataRow = class4.ReadDataRow("SELECT ID FROM items WHERE ID = '" + class2.uint_0 + "' LIMIT 1"); } if (dataRow != null) { string[] array = class2.GetBaseItem().Name.Split(new char[] { '_' }); int num = int.Parse(array[1]); if (num > 0) { if (class2.GetBaseItem().Name.StartsWith("CF_") || class2.GetBaseItem().Name.StartsWith("CFC_")) { Session.GetHabbo().Credits += num; Session.GetHabbo().UpdateCredits(true); } else { if (class2.GetBaseItem().Name.StartsWith("PixEx_")) { Session.GetHabbo().ActivityPoints += num; Session.GetHabbo().UpdateActivityPoints(true); } else { if (class2.GetBaseItem().Name.StartsWith("PntEx_")) { Session.GetHabbo().VipPoints += num; Session.GetHabbo().UpdateVipPoints(false, true); } } } } } @class.method_29(null, class2.uint_0, true, true); ServerMessage Message5_ = new ServerMessage(219u); Session.SendMessage(Message5_); } } } } } catch { } }
public Leave(UserItem item) { InitializeComponent(); mitem = item; }
public ClientAuction(BinaryReader reader) { AuctionID = reader.ReadUInt64(); Item = new UserItem(reader); Seller = reader.ReadString(); Price = reader.ReadUInt32(); ConsignmentDate = DateTime.FromBinary(reader.ReadInt64()); }
internal void LoadInventory() { floorItems.Clear(); wallItems.Clear(); DataTable Data; using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.setQuery("CALL getuseritems(@userid)"); dbClient.addParameter("userid", (int)UserId); Data = dbClient.getTable(); //dbClient.setQuery("SELECT item_id, song_id FROM user_items_songs WHERE user_id = " + UserId); //dSongs = dbClient.getTable(); } uint id; uint baseitem; int dataType; string extradata; int extra; foreach (DataRow Row in Data.Rows) { id = Convert.ToUInt32(Row[0]); baseitem = Convert.ToUInt32(Row[1]); IRoomItemData data; if (DBNull.Value.Equals(Row[2])) { data = new StringData(""); extra = 0; } else { dataType = Convert.ToInt32(Row[2]); extradata = (string)Row[3]; extra = Convert.ToInt32(Row[4]); switch (dataType) { case 0: data = new StringData(extradata); break; case 1: data = new MapStuffData(); break; case 2: data = new StringArrayStuffData(); break; case 3: data = new StringIntData(); break; default: data = new StringData(extradata); break; } try { data.Parse(extradata); } catch { Logging.LogException(string.Format("Error in furni data! Item ID: \"{0}\" and data: \"{1}\"", id, extradata.Replace(Convert.ToChar(1).ToString(), "[1]"))); } } UserItem item = new UserItem(id, baseitem, data, extra); if (item.GetBaseItem().InteractionType == InteractionType.musicdisc) { discs.Add(id, item); } if (item.isWallItem) { wallItems.Add(id, item); } else { floorItems.Add(id, item); } } discs.Clear(); //uint songItemID; //uint songID; //foreach (DataRow dRow in dSongs.Rows) //{ // songItemID = (uint)dRow[0]; // songID = (uint)dRow[1]; // SongItem song = new SongItem(songItemID, songID); // songs.Add(songItemID, song); //} this.InventoryPets.Clear(); DataTable Data2; using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor()) { //dbClient.addParameter("userid", UserId); dbClient.setQuery("SELECT id, user_id, room_id, name, type, race, color, expirience, energy, nutrition, respect, createstamp, x, y, z, have_saddle FROM user_pets WHERE user_id = " + UserId + " AND room_id = 0"); Data2 = dbClient.getTable(); } if (Data2 != null) { foreach (DataRow Row in Data2.Rows) { Pet newPet = Catalog.GeneratePetFromRow(Row); InventoryPets.Add(newPet.PetId, newPet); } } }
internal UserItem AddNewItem(UInt32 Id, UInt32 BaseItem, IRoomItemData data, int extra, bool insert, bool fromRoom, UInt32 songID = 0) { isUpdated = false; if (insert) { if (fromRoom) { using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.runFastQuery("REPLACE INTO items_users VALUES (" + Id + "," + UserId + ")"); //dbClient.setQuery("REPLACE INTO user_items (id, user_id,base_item,extra_data) VALUES ('" + Id + "','" + UserId + "','" + BaseItem + "',@extra_data)"); //dbClient.addParameter("extra_data", ExtraData); //dbClient.runQuery(); } Item baseItem = FirewindEnvironment.GetGame().GetItemManager().GetItem(BaseItem); if (baseItem != null && baseItem.InteractionType == InteractionType.musicdisc) { using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.runFastQuery("DELETE FROM items_rooms_songs WHERE item_id = " + Id); //dbClient.runFastQuery("REPLACE INTO user_items_songs (item_id,user_id,song_id) VALUES (" + Id + "," + UserId + "," + songID + ")"); } } } else { using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.setQuery("INSERT INTO items (base_id) VALUES (" + BaseItem + ")"); Id = (uint)dbClient.insertQuery(); //if (!string.IsNullOrEmpty(ExtraData)) { dbClient.setQuery("INSERT INTO items_extradata VALUES (" + Id + ",@datatype,@data,@extra)"); dbClient.addParameter("datatype", data.GetTypeID()); dbClient.addParameter("data", data); dbClient.addParameter("extra", extra); dbClient.runQuery(); } dbClient.runFastQuery("INSERT INTO items_users VALUES (" + Id + "," + UserId + ")"); //dbClient.setQuery("INSERT INTO user_items (user_id,base_item,extra_data) VALUES ('" + UserId + "','" + BaseItem + "',@extra_data)"); //dbClient.addParameter("extra_data", ExtraData); //Id = (uint)dbClient.insertQuery(); } } } UserItem ItemToAdd = new UserItem(Id, BaseItem, data, extra); if (UserHoldsItem(Id)) { RemoveItem(Id, false); } if (ItemToAdd.GetBaseItem().InteractionType == InteractionType.musicdisc) { discs.Add(ItemToAdd.Id, ItemToAdd); } if (ItemToAdd.isWallItem) { wallItems.Add(ItemToAdd.Id, ItemToAdd); } else { floorItems.Add(ItemToAdd.Id, ItemToAdd); } if (mRemovedItems.Contains(Id)) { mRemovedItems.Remove(Id); } if (!mAddedItems.ContainsKey(Id)) { mAddedItems.Add(Id, ItemToAdd); } return(ItemToAdd); //Logging.WriteLine("Item added: " + BaseItem); }
protected override void OnMouseLeave() { base.OnMouseLeave(); GameScene.Scene.DisposeItemLabel(); GameScene.HoverItem = null; ShowItem = null; }
public void CreateItemLabel(UserItem item, bool Inspect = false) { if (item == null) { DisposeItemLabel(); HoverItem = null; return; } if (item == HoverItem && ItemLabel != null && !ItemLabel.IsDisposed) return; ushort level = Inspect ? InspectDialog.Level : MapObject.User.Level; MirClass job = Inspect ? InspectDialog.Class : MapObject.User.Class; HoverItem = item; ItemInfo realItem = Functions.GetRealItem(item.Info, level, job, ItemInfoList); ItemLabel = new MirControl { BackColour = Color.FromArgb(255, 50, 50, 50), Border = true, BorderColour = Color.Gray, DrawControlTexture = true, NotControl = true, Parent = this, Opacity = 0.7F, // Visible = false }; //Name Info Label MirControl[] outlines = new MirControl[9]; outlines[0] = NameInfoLabel(item, Inspect); //Attribute Info1 Label - Attack Info outlines[1] = AttackInfoLabel(item, Inspect); //Attribute Info2 Label - Defense Info outlines[2] = DefenseInfoLabel(item, Inspect); //Attribute Info3 Label - Weight Info outlines[3] = WeightInfoLabel(item, Inspect); //Awake Info Label outlines[4] = AwakeInfoLabel(item, Inspect); //need Info Label outlines[5] = NeedInfoLabel(item, Inspect); //Bind Info Label outlines[6] = BindInfoLabel(item, Inspect); //Overlap Info Label outlines[7] = OverlapInfoLabel(item, Inspect); //Story Label outlines[8] = StoryInfoLabel(item, Inspect); foreach (var outline in outlines) { if (outline != null) { outline.Size = new Size(ItemLabel.Size.Width, outline.Size.Height); } } //ItemLabel.Visible = true; }
private void SwitchType() { UserItem MountItem = GameScene.User.Equipment[(int)EquipmentSlot.Mount]; UserItem[] MountSlots = null; if (MountItem != null) { MountSlots = MountItem.Slots; } if (MountSlots == null) { return; } int x = 0, y = 0; switch (MountSlots.Length) { case 4: Index = 160; StartIndex = 1170; MountName.Size = new Size(30, 20); MountImage.Location = new Point(110, 230); MountName.Size = new Size(215, 15); MountButton.Index = 164; MountButton.HoverIndex = 165; MountButton.PressedIndex = 166; MountButton.Location = new Point(210, 70); CloseButton.Location = new Point(245, 3); HelpButton.Location = new Point(221, 3); ExperienceBar.Index = 175; LoyaltyBar.Index = 173; Grid[(int)MountSlot.Mask].Visible = false; x = 1; y = 1; break; case 5: Index = 167; StartIndex = 1330; MountName.Location = new Point(55, 20); MountImage.Location = new Point(2, 40); MountName.Size = new Size(215, 15); MountButton.Index = 155; MountButton.HoverIndex = 156; MountButton.PressedIndex = 157; MountButton.Location = new Point(262, 70); CloseButton.Location = new Point(295, 3); HelpButton.Location = new Point(271, 3); ExperienceBar.Index = 175; LoyaltyBar.Index = 173; Grid[(int)MountSlot.Mask].Visible = true; x = 0; y = 0; break; } Grid[(int)MountSlot.Reins].Location = new Point(36 + x, 323 + y); Grid[(int)MountSlot.Bells].Location = new Point(90 + x, 323 + y); Grid[(int)MountSlot.Saddle].Location = new Point(144 + x, 323 + y); Grid[(int)MountSlot.Ribbon].Location = new Point(198 + x, 323 + y); Grid[(int)MountSlot.Mask].Location = new Point(252 + x, 323 + y); }
protected override void Dispose(bool disposing) { if (disposing) { Scene = null; User = null; MoveTime = 0; AttackTime = 0; NextRunTime = 0; CanMove = false; CanRun = false; MapControl = null; MainDialog = null; ChatDialog = null; ChatControl = null; InventoryDialog = null; CharacterDialog = null; StorageDialog = null; BeltDialog = null; MiniMapDialog = null; InspectDialog = null; OptionDialog = null; MenuDialog = null; NPCDialog = null; QuestDetailDialog = null; QuestListDialog = null; QuestLogDialog = null; QuestTrackingDialog = null; GameShopDialog = null; MentorDialog = null; RelationshipDialog = null; CharacterDuraPanel = null; DuraStatusPanel = null; HoverItem = null; SelectedCell = null; PickedUpGold = false; UseItemTime = 0; PickUpTime = 0; InspectTime = 0; DisposeItemLabel(); AMode = 0; PMode = 0; Lights = 0; NPCTime = 0; NPCID = 0; DefaultNPCID = 0; for (int i = 0; i < OutputLines.Length; i++) if (OutputLines[i] != null && OutputLines[i].IsDisposed) OutputLines[i].Dispose(); OutputMessages.Clear(); OutputMessages = null; } base.Dispose(disposing); }
public UserItem(BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue) { UniqueID = reader.ReadUInt64(); ItemIndex = reader.ReadInt32(); CurrentDura = reader.ReadUInt16(); MaxDura = reader.ReadUInt16(); Count = reader.ReadUInt32(); AC = reader.ReadByte(); MAC = reader.ReadByte(); DC = reader.ReadByte(); MC = reader.ReadByte(); SC = reader.ReadByte(); Accuracy = reader.ReadByte(); Agility = reader.ReadByte(); HP = reader.ReadByte(); MP = reader.ReadByte(); AttackSpeed = reader.ReadSByte(); Luck = reader.ReadSByte(); if (version <= 19) return; SoulBoundId = reader.ReadInt32(); byte Bools = reader.ReadByte(); Identified = (Bools & 0x01) == 0x01; Cursed = (Bools & 0x02) == 0x02; Strong = reader.ReadByte(); MagicResist = reader.ReadByte(); PoisonResist = reader.ReadByte(); HealthRecovery = reader.ReadByte(); ManaRecovery = reader.ReadByte(); PoisonRecovery = reader.ReadByte(); CriticalRate = reader.ReadByte(); CriticalDamage = reader.ReadByte(); Freezing = reader.ReadByte(); PoisonAttack = reader.ReadByte(); if (version <= 31) return; int count = reader.ReadInt32(); for (int i = 0; i < count; i++) { if (reader.ReadBoolean()) continue; UserItem item = new UserItem(reader, version, Customversion); Slots[i] = item; } if (version <= 38) return; GemCount = reader.ReadUInt32(); if (version <= 40) return; Awake = new Awake(reader); if (version <= 56) return; RefinedValue = (RefinedValue)reader.ReadByte(); RefineAdded = reader.ReadByte(); if (version < 60) return; WeddingRing = reader.ReadInt32(); if (version < 65) return; if (reader.ReadBoolean()) { ExpireInfo = new ExpireInfo(reader, version, Customversion); } }
public override void Process() { if (MapControl == null || User == null) return; if (CMain.Time >= MoveTime) { MoveTime += 100; //Move Speed CanMove = true; MapControl.AnimationCount++; MapControl.TextureValid = false; } else CanMove = false; MirItemCell cell = MouseControl as MirItemCell; if (cell != null && HoverItem != cell.Item) { DisposeItemLabel(); HoverItem = null; CreateItemLabel(cell.Item); } if (ItemLabel != null && !ItemLabel.IsDisposed) { ItemLabel.BringToFront(); int x = CMain.MPoint.X + 15, y = CMain.MPoint.Y; if (x + ItemLabel.Size.Width > Settings.ScreenWidth) x = Settings.ScreenWidth - ItemLabel.Size.Width; if (y + ItemLabel.Size.Height > Settings.ScreenHeight) y = Settings.ScreenHeight - ItemLabel.Size.Height; ItemLabel.Location = new Point(x, y); } if (MailLabel != null && !MailLabel.IsDisposed) { MailLabel.BringToFront(); int x = CMain.MPoint.X + 15, y = CMain.MPoint.Y; if (x + MailLabel.Size.Width > Settings.ScreenWidth) x = Settings.ScreenWidth - MailLabel.Size.Width; if (y + MailLabel.Size.Height > Settings.ScreenHeight) y = Settings.ScreenHeight - MailLabel.Size.Height; MailLabel.Location = new Point(x, y); } if (MemoLabel != null && !MemoLabel.IsDisposed) { MemoLabel.BringToFront(); int x = CMain.MPoint.X + 15, y = CMain.MPoint.Y; if (x + MemoLabel.Size.Width > Settings.ScreenWidth) x = Settings.ScreenWidth - MemoLabel.Size.Width; if (y + MemoLabel.Size.Height > Settings.ScreenHeight) y = Settings.ScreenHeight - MemoLabel.Size.Height; MemoLabel.Location = new Point(x, y); } if (GuildBuffLabel != null && !GuildBuffLabel.IsDisposed) { GuildBuffLabel.BringToFront(); int x = CMain.MPoint.X + 15, y = CMain.MPoint.Y; if (x + GuildBuffLabel.Size.Width > Settings.ScreenWidth) x = Settings.ScreenWidth - GuildBuffLabel.Size.Width; if (y + GuildBuffLabel.Size.Height > Settings.ScreenHeight) y = Settings.ScreenHeight - GuildBuffLabel.Size.Height; GuildBuffLabel.Location = new Point(x, y); } if (!User.Dead) ShowReviveMessage = false; if (ShowReviveMessage && CMain.Time > User.DeadTime && User.CurrentAction == MirAction.Dead) { ShowReviveMessage = false; MirMessageBox messageBox = new MirMessageBox("You have died, Do you want to revive in town?", MirMessageBoxButtons.YesNo); messageBox.YesButton.Click += (o, e) => { if (User.Dead) Network.Enqueue(new C.TownRevive()); }; messageBox.AfterDraw += (o, e) => { if (!User.Dead) messageBox.Dispose(); }; messageBox.Show(); } UpdateBuffs(); MapControl.Process(); MainDialog.Process(); InventoryDialog.Process(); GameShopDialog.Process(); MiniMapDialog.Process(); SkillBarDialog.Process(); DialogProcess(); ProcessOuput(); }
public bool CheckAwakening(UserItem item, AwakeType type) { if (item.Info.CanAwakening != true) return false; if (item.Info.Grade == ItemGrade.None) return false; if (IsMaxLevel()) return false; if (this.type == AwakeType.None) { if (item.Info.Type == ItemType.Weapon) { if (type == AwakeType.DC || type == AwakeType.MC || type == AwakeType.SC) { this.type = type; return true; } else return false; } else if (item.Info.Type == ItemType.Helmet) { if (type == AwakeType.AC || type == AwakeType.MAC) { this.type = type; return true; } else return false; } else if (item.Info.Type == ItemType.Armour) { if (type == AwakeType.HPMP) { this.type = type; return true; } else return false; } else return false; } else { if (this.type == type) return true; else return false; } }
protected override bool DropItem(UserItem item) { throw new NotSupportedException(); }
private bool[] Awakening(UserItem item) { int minValue = AwakeChanceMin; int maxValue = (AwakeChanceMax[(int)item.Info.Grade - 1] < AwakeChanceMin) ? AwakeChanceMin : AwakeChanceMax[(int)item.Info.Grade - 1]; int result; bool[] returnValue = makeHit(maxValue, out result); switch (item.Info.Type) { case ItemType.Weapon: result *= (int)Awake_WeaponRate; break; case ItemType.Armour: result *= (int)Awake_ArmorRate; break; case ItemType.Helmet: result *= (int)Awake_HelmetRate; break; default: result = 0; break; } listAwake.Add((byte)result); return returnValue; }
public void GetMaxGain(UserItem item) { if (CurrentBagWeight + item.Weight <= MaxBagWeight && FreeSpace(Inventory) > 0) { return; } uint min = 0; uint max = item.Count; if (CurrentBagWeight >= MaxBagWeight) { } if (item.Info.Type == ItemType.Amulet) { for (int i = 0; i < Inventory.Length; i++) { UserItem bagItem = Inventory[i]; if (bagItem == null || bagItem.Info != item.Info) { continue; } if (bagItem.Count + item.Count <= bagItem.Info.StackSize) { item.Count = max; return; } item.Count = bagItem.Info.StackSize - bagItem.Count; min += item.Count; if (min >= max) { item.Count = max; return; } } if (min == 0) { GameScene.Scene.ChatDialog.ReceiveChat(FreeSpace(Inventory) == 0 ? "You do not have enough space." : "You do not have enough weight.", ChatType.System); item.Count = 0; return; } item.Count = min; return; } if (CurrentBagWeight + item.Weight > MaxBagWeight) { item.Count = (uint)(Math.Max((MaxBagWeight - CurrentBagWeight), uint.MinValue) / item.Info.Weight); max = item.Count; if (item.Count == 0) { GameScene.Scene.ChatDialog.ReceiveChat("You do not have enough weight.", ChatType.System); return; } } if (item.Info.StackSize > 1) { for (int i = 0; i < Inventory.Length; i++) { UserItem bagItem = Inventory[i]; if (bagItem == null) { return; } if (bagItem.Info != item.Info) { continue; } if (bagItem.Count + item.Count <= bagItem.Info.StackSize) { item.Count = max; return; } item.Count = bagItem.Info.StackSize - bagItem.Count; min += item.Count; if (min >= max) { item.Count = max; return; } } if (min == 0) { GameScene.Scene.ChatDialog.ReceiveChat("You do not have enough space.", ChatType.System); item.Count = 0; } } else { GameScene.Scene.ChatDialog.ReceiveChat("You do not have enough space.", ChatType.System); item.Count = 0; } }
public GuildStorageItem(BinaryReader reader) { Item = new UserItem(reader); UserId = reader.ReadInt64(); }
public Boolean IsBlocked(int X, int Y, bool lastTile) { return(UserItem.IsBlocked(X, Y, lastTile)); }