Esempio n. 1
0
 // Token: 0x06002AAD RID: 10925 RVA: 0x00108C59 File Offset: 0x00107059
 protected void trackStat(EPlayerStat stat)
 {
     if (this.equipment.isSelected && this.equipment.isEquipped)
     {
         this.channel.owner.incrementStatTrackerValue(this.equipment.itemID, stat);
     }
 }
        private void OnPlayerStatIncremented(Player nativePlayer, EPlayerStat stat)
        {
            var player = GetUnturnedPlayer(nativePlayer) !;
            var @event = new UnturnedPlayerStatIncrementedEvent(player, stat);

            Emit(@event);
        }
Esempio n. 3
0
        private void rpe_OnUpdateStat(UnturnedPlayer player, EPlayerStat stat)
        {
            if (player == null)
            {
                return;
            }
            Uconomy u = Uconomy.Instance;

            if (Uconomy_Essentials.Instance.Configuration.Instance.PayZombie && stat == EPlayerStat.KILLS_ZOMBIES_NORMAL)
            {
                decimal balzk = u.Database.IncreaseBalance(player.CSteamID.ToString(), (decimal)Uconomy_Essentials.Instance.Configuration.Instance.PayZombieAmt);
                Uconomy_Essentials.HandleEvent(player, (decimal)Uconomy_Essentials.Instance.Configuration.Instance.PayZombieAmt, "paid");
                if (!Uconomy_Essentials.Instance.Configuration.Instance.SendPayZombieMsg)
                {
                    return;                                                                       // No message is to be sent, so job is done.
                }
                UnturnedChat.Say(player.CSteamID, Uconomy_Essentials.Instance.Translate("zombie_kill_paid_msg", new object[] { Uconomy_Essentials.Instance.Configuration.Instance.PayZombieAmt.ToString(), u.Configuration.Instance.MoneyName, balzk.ToString(), u.Configuration.Instance.MoneyName }));
            }
            else if (Uconomy_Essentials.Instance.Configuration.Instance.PayMegaZombie && stat == EPlayerStat.KILLS_ZOMBIES_MEGA)
            {
                decimal balzk = u.Database.IncreaseBalance(player.CSteamID.ToString(), (decimal)Uconomy_Essentials.Instance.Configuration.Instance.PayMegaZombieAmt);
                Uconomy_Essentials.HandleEvent(player, (decimal)Uconomy_Essentials.Instance.Configuration.Instance.PayMegaZombieAmt, "paid");
                if (!Uconomy_Essentials.Instance.Configuration.Instance.SendPayMegaZombieMsg)
                {
                    return;                                                                           // No message is to be sent, so job is done.
                }
                UnturnedChat.Say(player.CSteamID, Uconomy_Essentials.Instance.Translate("mega_zombie_kill_paid_msg", new object[] { Uconomy_Essentials.Instance.Configuration.Instance.PayMegaZombieAmt.ToString(), u.Configuration.Instance.MoneyName, balzk.ToString(), u.Configuration.Instance.MoneyName }));
            }
        }
Esempio n. 4
0
 public void sendStat(EPlayerStat stat)
 {
     this.channel.send("tellStat", ESteamCall.OWNER, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
     {
         (byte)stat
     });
 }
Esempio n. 5
0
 public static void IncStat(EPlayerStat stat, float amount)
 {
     amount = Mathf.Round(amount);
     for (int i = 0; i < amount; i++)
     {
         Player.player.sendStat(stat);
     }
     Debug.Log("Successfully increased stat: " + stat.ToString() + " " + amount + " times.");
 }
        // Token: 0x06003065 RID: 12389 RVA: 0x0013E758 File Offset: 0x0013CB58
        public void incrementStatTrackerValue(ushort itemID, EPlayerStat stat)
        {
            int num;

            if (!this.getItemSkinItemDefID(itemID, out num))
            {
                return;
            }
            string tags;
            string dynamic_props;

            if (!this.getTagsAndDynamicPropsForItem(num, out tags, out dynamic_props))
            {
                return;
            }
            DynamicEconDetails dynamicEconDetails = new DynamicEconDetails(tags, dynamic_props);
            EStatTrackerType   estatTrackerType;
            int num2;

            if (!dynamicEconDetails.getStatTrackerValue(out estatTrackerType, out num2))
            {
                return;
            }
            if (estatTrackerType != EStatTrackerType.TOTAL)
            {
                if (estatTrackerType != EStatTrackerType.PLAYER)
                {
                    return;
                }
                if (stat != EPlayerStat.KILLS_PLAYERS)
                {
                    return;
                }
            }
            else if (stat != EPlayerStat.KILLS_ANIMALS && stat != EPlayerStat.KILLS_PLAYERS && stat != EPlayerStat.KILLS_ZOMBIES_MEGA && stat != EPlayerStat.KILLS_ZOMBIES_NORMAL)
            {
                return;
            }
            if (!this.modifiedItems.Contains(itemID))
            {
                this.modifiedItems.Add(itemID);
            }
            num2++;
            for (int i = 0; i < this.skinItems.Length; i++)
            {
                if (this.skinItems[i] == num)
                {
                    if (i < this.skinDynamicProps.Length)
                    {
                        this.skinDynamicProps[i] = dynamicEconDetails.getPredictedDynamicPropsJsonForStatTracker(estatTrackerType, num2);
                    }
                    break;
                }
            }
        }
 public void OnPlayerUpdateStat(UnturnedPlayer player, EPlayerStat stat)
 {
     if (player == null)
     {
         return;
     }
     if (stat == EPlayerStat.KILLS_ZOMBIES_NORMAL)
     {
         ChangeExperience(player, Config.ZombieXP);
     }
     else if (stat == EPlayerStat.KILLS_ZOMBIES_MEGA)
     {
         ChangeExperience(player, Config.MegaXP);
     }
 }
Esempio n. 8
0
        private void onUpdateStat(UnturnedPlayer player, EPlayerStat stat)
        {
            if (stat == EPlayerStat.ARENA_WINS)
            {
                UpdatePoints(player, Instance.Configuration.Instance.firstpoint);

                UnturnedChat.Say("Tourney>>\n" + player + " Won 1st place and got \n" + Instance.Configuration.Instance.firstpoint + " Point(s)\nTourney>>", Color.cyan);
            }
            if (stat == EPlayerStat.KILLS_PLAYERS)
            {
                if (Instance.Configuration.Instance.GiveKillPoint)
                {
                    UpdatePoints(player, Instance.Configuration.Instance.killpoint);
                }
            }
        }
        internal static void InternalOnPlayerStatIncremented(SDG.Unturned.Player player, EPlayerStat gameStat)
        {
            UnturnedPlayerEvents instance = player.GetComponent <UnturnedPlayerEvents>();
            UnturnedPlayer       rp       = UnturnedPlayer.FromPlayer(player);

            OnPlayerUpdateStat.TryInvoke(rp, gameStat);
            instance.OnUpdateStat.TryInvoke(rp, gameStat);
        }
 public UnturnedPlayerUpdateStatEvent(IPlayer player, EPlayerStat stat, EventExecutionTargetContext executionTarget = EventExecutionTargetContext.Sync, bool global = true) : base(player, executionTarget, global)
 {
     Stat = stat;
 }
 public UnturnedPlayerUpdateStatEvent(IPlayer player, EPlayerStat stat, bool global = true) : base(player, global)
 {
     Stat = stat;
 }
 public UnturnedPlayerUpdateStatEvent(IPlayer player, EPlayerStat stat) : base(player)
 {
     Stat = stat;
 }
 public UnturnedPlayerStatIncrementedEvent(UnturnedPlayer player, EPlayerStat stat) : base(player)
 {
     Stat = stat;
 }