Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Using FluxRP Emu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="NotoriousJameson" data-source="post: 405001" data-attributes="member: 65480"><p>[CODE] internal CatalogItem(DataRow row, string name)</p><p> {</p><p> Id = Convert.ToUInt32(row["id"]);</p><p> Name = name;</p><p> ItemIdString = row["item_ids"].ToString();</p><p> Items = new Dictionary<Item, uint>();</p><p> var itemIds = ItemIdString.Split(';');</p><p> var amounts = row["amounts"].ToString().Split(';');</p><p> for (var i = 0; i < itemIds.Length; i++)</p><p> {</p><p> uint id;</p><p> uint amount;</p><p></p><p> if (!uint.TryParse(itemIds[i], out id) || GetBaseItem(id) == null) continue;</p><p> uint.TryParse(amounts[i], out amount);</p><p></p><p> Items.Add(GetBaseItem(id), amount);</p><p> }</p><p></p><p> BaseId = Items.Keys.First().ItemId;</p><p> FirstAmount = Items.Values.First();</p><p> PageId = (int) row["page_id"];</p><p> uint.TryParse(row["cost_credits"].ToString(), out CreditsCost);</p><p> uint.TryParse(row["cost_belcredits"].ToString(), out BelCreditsCost);</p><p> uint.TryParse(row["cost_loyalty"].ToString(), out LoyaltyCost);</p><p> uint.TryParse(row["cost_duckets"].ToString(), out DucketsCost);</p><p></p><p> LimitedSelled = (int) row["limited_sells"];</p><p> LimitedStack = (int) row["limited_stack"];</p><p> IsLimited = (LimitedStack > 0);</p><p> Badge = (string) row["badge"];</p><p> HaveOffer = ((string) row["offer_active"] == "1");</p><p> ClubOnly = ((string) row["club_only"] == "1");</p><p> ExtraData = (string) row["extradata"];</p><p> SongId = (uint) row["song_id"];</p><p> }</p><p></p><p> /// <summary></p><p> /// Gets the base item.</p><p> /// </summary></p><p> /// <param name="itemIds">The item ids.</param></p><p> /// <returns>Item.</returns></p><p> internal Item GetBaseItem(uint itemIds)</p><p> {</p><p> var item = Plus.GetGame().GetItemManager().GetItem(itemIds);</p><p> if (item == null)</p><p> Out.WriteLine(string.Format("UNKNOWN ItemIds: {0}", itemIds), "", ConsoleColor.DarkRed);</p><p> return item;</p><p> }</p><p></p><p> /// <summary></p><p> /// Gets the first base item.</p><p> /// </summary></p><p> /// <returns>Item.</returns></p><p> internal Item GetFirstBaseItem()</p><p> {</p><p> return GetBaseItem(BaseId);</p><p> }</p><p> }</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="NotoriousJameson, post: 405001, member: 65480"] [CODE] internal CatalogItem(DataRow row, string name) { Id = Convert.ToUInt32(row["id"]); Name = name; ItemIdString = row["item_ids"].ToString(); Items = new Dictionary<Item, uint>(); var itemIds = ItemIdString.Split(';'); var amounts = row["amounts"].ToString().Split(';'); for (var i = 0; i < itemIds.Length; i++) { uint id; uint amount; if (!uint.TryParse(itemIds[i], out id) || GetBaseItem(id) == null) continue; uint.TryParse(amounts[i], out amount); Items.Add(GetBaseItem(id), amount); } BaseId = Items.Keys.First().ItemId; FirstAmount = Items.Values.First(); PageId = (int) row["page_id"]; uint.TryParse(row["cost_credits"].ToString(), out CreditsCost); uint.TryParse(row["cost_belcredits"].ToString(), out BelCreditsCost); uint.TryParse(row["cost_loyalty"].ToString(), out LoyaltyCost); uint.TryParse(row["cost_duckets"].ToString(), out DucketsCost); LimitedSelled = (int) row["limited_sells"]; LimitedStack = (int) row["limited_stack"]; IsLimited = (LimitedStack > 0); Badge = (string) row["badge"]; HaveOffer = ((string) row["offer_active"] == "1"); ClubOnly = ((string) row["club_only"] == "1"); ExtraData = (string) row["extradata"]; SongId = (uint) row["song_id"]; } /// <summary> /// Gets the base item. /// </summary> /// <param name="itemIds">The item ids.</param> /// <returns>Item.</returns> internal Item GetBaseItem(uint itemIds) { var item = Plus.GetGame().GetItemManager().GetItem(itemIds); if (item == null) Out.WriteLine(string.Format("UNKNOWN ItemIds: {0}", itemIds), "", ConsoleColor.DarkRed); return item; } /// <summary> /// Gets the first base item. /// </summary> /// <returns>Item.</returns> internal Item GetFirstBaseItem() { return GetBaseItem(BaseId); } } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Using FluxRP Emu
Top