PlusEMU Diamond Timer

Supermario

Member
Jan 5, 2016
99
0
Hi,

I am using PlusEMU and I'm wondering if anyone could show me how to put a loop timer on for diamonds (like the credits & duckets timer function). When you're on the hotel for a certain amount of time (15 minutes for example), I want it to reward 1 diamond for the amount of time I set it at.. Does this function already exist by any chance?

Thanks,
Matthew
 

Rebel

Spilling the tea, can't you read?🍵
Dec 24, 2015
186
161
show me the curre

This would only work for those offline :p

give me 5 minutes and Ill code it for you.
 
ok here goes.
goto PlusStaticGameSettings.cs and add
Code:
public const int UserDiamondsUpdateAmount = 1;
then goto habbo.cs & find public void CheckCreditsTimer() then change it to this.
Code:
 public void CheckCreditsTimer()
        {
            try
            {
                this._creditsTickUpdate--;

                if (this._creditsTickUpdate <= 0)
                {
                    int CreditUpdate = PlusStaticGameSettings.UserCreditsUpdateAmount;
                    int DucketUpdate = PlusStaticGameSettings.UserPixelsUpdateAmount;
                    int DiamondUpdate = PlusStaticGameSettings.UserDiamondsUpdateAmount;
               
                    SubscriptionData SubData = null;
                    if (PlusEnvironment.GetGame().GetSubscriptionManager().TryGetSubscriptionData(this._vipRank, out SubData))
                    {
                        CreditUpdate += SubData.Credits;
                        DucketUpdate += SubData.Duckets;
                        DiamondUpdate += SubData.Diamonds;
                    }

                    this._credits += CreditUpdate;
                    this._duckets += DucketUpdate;
                    this._diamonds += DiamondUpdate;

                    this._client.SendMessage(new CreditBalanceComposer(this._credits));
                    this._client.SendMessage(new HabboActivityPointNotificationComposer(this._duckets, DucketUpdate));
                    this._client.SendMessage(new HabboActivityPointNotificationComposer(this.Diamonds, DiamondUpdate, 5));
                    this.CreditsUpdateTick = PlusStaticGameSettings.UserCreditsUpdateTimer;
                }
            }
            catch { }
        }
Then goto SubscriptionData.cs and change it all to this.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Plus.HabboHotel.Subscriptions
{
    public class SubscriptionData
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Badge { get; set; }
        public int Credits { get; set; }
        public int Duckets { get; set; }
        public int Respects { get; set; }
        public int Diamonds { get; set; }

        public SubscriptionData(int Id, string Name, string Badge, int Credits, int Duckets, int Respects, int Diamonds)
        {
            this.Id = Id;
            this.Name = Name;
            this.Badge = Badge;
            this.Credits = Credits;
            this.Duckets = Duckets;
            this.Respects = Respects;
            this.Diamonds = Diamonds;
        }
    }
}
Then goto SubscriptionManager.cs and replace it all with this.
Code:
using log4net;
using Plus.Database.Interfaces;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Plus.HabboHotel.Subscriptions
{
    public class SubscriptionManager
    {
        private static ILog log = LogManager.GetLogger("Plus.HabboHotel.Subscriptions.SubscriptionManager");

        private readonly Dictionary<int, SubscriptionData> _subscriptions = new Dictionary<int, SubscriptionData>();

        public SubscriptionManager()
        {
        }

        public void Init()
        {
            if (this._subscriptions.Count > 0)
                this._subscriptions.Clear();

            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("SELECT * FROM `subscriptions`;");
                DataTable GetSubscriptions = dbClient.getTable();

                if (GetSubscriptions != null)
                {
                    foreach (DataRow Row in GetSubscriptions.Rows)
                    {
                        if (!this._subscriptions.ContainsKey(Convert.ToInt32(Row["id"])))
                            this._subscriptions.Add(Convert.ToInt32(Row["id"]), new SubscriptionData(Convert.ToInt32(Row["id"]), Convert.ToString(Row["name"]), Convert.ToString(Row["badge_code"]), Convert.ToInt32(Row["credits"]), Convert.ToInt32(Row["duckets"]), Convert.ToInt32(Row["respects"]), Convert.ToInt32(Row["diamonds"])));
                    }
                }
            }

            log.Info("Loaded " + this._subscriptions.Count + " subscriptions.");
        }

        public bool TryGetSubscriptionData(int Id, out SubscriptionData Data)
        {
            return this._subscriptions.TryGetValue(Id, out Data);
        }
    }
}
@Muff
 

Users who are viewing this thread

Top