Results 1 to 15 of 15
  1. #1
    Riigged's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Location
    no
    Posts
    3,846
    Reputation
    401
    Thanks
    10,254
    My Mood
    Devilish

    How to stop discounts/shop limit

    Want the items in your nexus to never have a discount? No disappearing after 5 have been bought and users having to wait for another to spawn?
    Replace your merchants.cs (Wserver>Realm>Entities>Merchant>Merchants.cs) with this.


    Code:
    #region
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Xml.Linq;
    using log4net;
    using wServer.networking.svrPackets;
    using wServer.realm.entities.player;
    
    #endregion
    
    namespace wServer.realm.entities.merchant
    {
        public class Merchants : SellableObject
        {
            private const int BUY_NO_GOLD = 3;
            private const int BUY_NO_FAME = 6;
            private const int BUY_NO_FORTUNETOKENS = 9;
            private const int MERCHANT_SIZE = 100;
            private static readonly ILog log = LogManager.GetLogger(typeof(Merchants));
    
            private readonly Dictionary<int, Tuple<int, CurrencyType>> prices = MerchantLists.prices;
    
            private bool closing;
            private bool newMerchant;
            private int tickcount;
    
            public static Random Random { get; private set; }
    
            public Merchants(RealmManager manager, ushort objType, World owner = null)
                : base(manager, objType)
            {
                MType = -1;
                Size = MERCHANT_SIZE;
                if (owner != null)
                    Owner = owner;
    
                if (Random == null) Random = new Random();
                if (AddedTypes == null) AddedTypes = new List<KeyValuePair<string, int>>();
                if(owner != null) ResolveMType();
            }
    
            private static List<KeyValuePair<string, int>> AddedTypes { get; set; }
    
            public bool Custom { get; set; }
    
            public int MType { get; set; }
            public int MRemaining { get; set; }
            public int MTime { get; set; }
            public int Discount { get; set; }
    
            protected override void ExportStats(IDictionary<StatsType, object> stats)
            {
                stats[StatsType.MerchantMerchandiseType] = MType;
                stats[StatsType.MerchantRemainingCount] = MRemaining;
                stats[StatsType.MerchantRemainingMinute] = newMerchant ? Int32.MaxValue : MTime;
                stats[StatsType.MerchantDiscount] = Discount;
                stats[StatsType.SellablePrice] = Price;
                stats[StatsType.SellableRankRequirement] = RankReq;
                stats[StatsType.SellablePriceCurrency] = Currency;
    
                base.ExportStats(stats);
            }
    
            public override void Init(World owner)
            {
                base.Init(owner);
                ResolveMType();
                UpdateCount++;
                if (MType == -1) Owner.LeaveWorld(this);
            }
    
            protected override bool TryDeduct(Player player)
            {
                var acc = player.Client.Account;
                if (player.Stars < RankReq) return false;
    
                if (Currency == CurrencyType.Fame)
                    if (acc.Stats.Fame < Price) return false;
    
                if (Currency == CurrencyType.Gold)
                    if (acc.Credits < Price) return false;
    
                if (Currency == CurrencyType.FortuneTokens)
                    if (acc.FortuneTokens < Price) return false;
                return true;
            }
    
            public override void Buy(Player player)
            {
                Manager.Database.DoActionAsync(db =>
                {
                    if (ObjectType == 0x01ca) //Merchant
                    {
                        if (TryDeduct(player))
                        {
                            for (var i = 0; i < player.Inventory.Length; i++)
                            {
                                try
                                {
                                    XElement ist;
                                    Manager.GameData.ObjectTypeToElement.TryGetValue((ushort)MType, out ist);
                                    if (player.Inventory[i] == null &&
                                        (player.SlotTypes[i] == 10 ||
                                         player.SlotTypes[i] == Convert.ToInt16(ist.Element("SlotType").Value)))
                                    // Exploit fix - No more mnovas as weapons!
                                    {
                                        player.Inventory[i] = Manager.GameData.Items[(ushort)MType];
    
                                        if (Currency == CurrencyType.Fame)
                                            player.CurrentFame =
                                                player.Client.Account.Stats.Fame =
                                                    db.UpdateFame(player.Client.Account, -Price);
                                        if (Currency == CurrencyType.Gold)
                                            player.Credits =
                                                player.Client.Account.Credits =
                                                    db.UpdateCredit(player.Client.Account, -Price);
                                        if (Currency == CurrencyType.FortuneTokens)
                                            player.Tokens =
                                                player.Client.Account.FortuneTokens =
                                                    db.UpdateFortuneToken(player.Client.Account, -Price);
    
                                        player.Client.SendPacket(new BuyResultPacket
                                        {
                                            Result = 0,
                                            Message = "{\"key\":\"server.buy_success\"}"
                                        });
                                        MRemaining--;
                                        player.UpdateCount++;
                                        player.SaveToCharacter();
                                        UpdateCount++;
                                        return;
                                    }
                                }
                                catch (Exception e)
                                {
                                    log.Error(e);
                                }
                            }
                            player.Client.SendPacket(new BuyResultPacket
                            {
                                Result = 0,
                                Message = "{\"key\":\"server.inventory_full\"}"
                            });
                        }
                        else
                        {
                            if (player.Stars < RankReq)
                            {
                                player.Client.SendPacket(new BuyResultPacket
                                {
                                    Result = 0,
                                    Message = "Not enough stars!"
                                });
                                return;
                            }
                            switch (Currency)
                            {
                                case CurrencyType.Gold:
                                    player.Client.SendPacket(new BuyResultPacket
                                    {
                                        Result = BUY_NO_GOLD,
                                        Message = "{\"key\":\"server.not_enough_gold\"}"
                                    });
                                    break;
                                case CurrencyType.Fame:
                                    player.Client.SendPacket(new BuyResultPacket
                                    {
                                        Result = BUY_NO_FAME,
                                        Message = "{\"key\":\"server.not_enough_fame\"}"
                                    });
                                    break;
                                case CurrencyType.FortuneTokens:
                                    player.Client.SendPacket(new BuyResultPacket
                                    {
                                        Result = BUY_NO_FORTUNETOKENS,
                                        Message = "{\"key\":\"server.not_enough_fortunetokens\"}"
                                    });
                                    break;
                            }
                        }
                    }
                });
            }
    
            public override void Tick(RealmTime time)
            {
                try
                {
                    if (Size == 0 && MType != -1)
                    {
                        Size = MERCHANT_SIZE;
                        UpdateCount++;
                    }
    
                    if (!closing)
                    {
                        tickcount++;
                        if (tickcount % (Manager?.TPS * 60) == 0) //once per minute after spawning
                        {
                            MTime--;
                            UpdateCount++;
                        }
                    }
    
                    if (MRemaining == 0 &&  MType != -1)
                    {
                        if (AddedTypes.Contains(new KeyValuePair<string, int>(Owner.Name, MType)))
                            AddedTypes.Remove(new KeyValuePair<string, int>(Owner.Name, MType));
                        Recreate(this);
                        UpdateCount++;
                    }
    
                    if (MTime == -1 && Owner != null)
                    {
                        if (AddedTypes.Contains(new KeyValuePair<string, int>(Owner.Name, MType)))
                            AddedTypes.Remove(new KeyValuePair<string, int>(Owner.Name, MType));
                        Recreate(this);
                        UpdateCount++;
                    }
    
                    if (MTime == 1 && !closing)
                    {
                        closing = true;
                        Owner?.Timers.Add(new WorldTimer(30 * 1000, (w1, t1) =>
                        {
                            MTime--;
                            UpdateCount++;
                            w1.Timers.Add(new WorldTimer(30 * 1000, (w2, t2) =>
                            {
                                MTime--;
                                UpdateCount++;
                            }));
                        }));
                    }
    
                    if (MType == -1) Owner?.LeaveWorld(this);
    
                    base.Tick(time);
                }
                catch (Exception ex)
                {
                    log.Error(ex);
                }
            }
    
            public void Recreate(Merchants x)
            {
                try
                {
                    var mrc = new Merchants(Manager, x.ObjectType, x.Owner);
                    mrc.Move(x.X, x.Y);
                    var w = Owner;
                    Owner.LeaveWorld(this);
                    w.Timers.Add(new WorldTimer(Random.Next(9999, 9999) * 1000, (world, time) => w.EnterWorld(mrc)));
                }
                catch (Exception e)
                {
                    log.Error(e);
                }
            }
    
            public void ResolveMType()
            {
                MType = -1;
                var list = new int[0];
                if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_1)
                    list = MerchantLists.store1List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_2)
                    list = MerchantLists.store2List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_3)
                    list = MerchantLists.store3List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_4)
                    list = MerchantLists.store4List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_5)
                    list = MerchantLists.store5List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_6)
                    list = MerchantLists.store6List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_7)
                    list = MerchantLists.store7List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_8)
                    list = MerchantLists.store8List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_9)
                    list = MerchantLists.store9List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_10)
                    list = MerchantLists.store10List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_11)
                    list = MerchantLists.store11List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_12)
                    list = MerchantLists.AccessoryDyeList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_13)
                    list = MerchantLists.ClothingClothList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_14)
                    list = MerchantLists.AccessoryClothList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_15)
                    list = MerchantLists.ClothingDyeList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_16)
                    list = MerchantLists.store5List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_17)
                    list = MerchantLists.store7List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_18)
                    list = MerchantLists.store6List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_19)
                    list = MerchantLists.store2List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_20)
                    list = MerchantLists.store20List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_21)
                    list = MerchantLists.AccessoryClothList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_22)
                    list = MerchantLists.AccessoryDyeList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_23)
                    list = MerchantLists.ClothingClothList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_24)
                    list = MerchantLists.ClothingDyeList;
    
                if (AddedTypes == null) AddedTypes = new List<KeyValuePair<string, int>>();
                list.Shuffle();
                foreach (var t1 in list.Where(t1 => !AddedTypes.Contains(new KeyValuePair<string, int>(Owner.Name, t1))))
                {
                    AddedTypes.Add(new KeyValuePair<string, int>(Owner.Name, t1));
                    MType = t1;
                    MTime = Random.Next(9999, 9999);
                    MRemaining = Random.Next(9999, 9999);
                    newMerchant = true;
                    Owner.Timers.Add(new WorldTimer(30000, (w, t) =>
                    {
                        newMerchant = false;
                        UpdateCount++;
                    }));
    
                    var s = Random.Next(0, 9999);
    
                    if(s < 2)
                        Discount = 0;
                    else if(s < 5)
                        Discount = 0;
                    else if (s < 10)
                        Discount = 0;
                    else if(s < 15)
                        Discount = 0;
                    else Discount = 0;
    
                    Tuple<int, CurrencyType> price;
                    if (prices.TryGetValue(MType, out price))
                    {
                        if (Discount != 0)
                            Price = (int)(price.Item1 - (price.Item1 * ((double)Discount / 100))) < 1 ?
                                price.Item1 : (int)(price.Item1 - (price.Item1 * ((double)Discount / 100)));
                        else
                            Price = price.Item1;
                        Currency = price.Item2;
                    }
    
                    break;
                }
                UpdateCount++;
            }
        }
    }

  2. The Following User Says Thank You to Riigged For This Useful Post:

    Zxoro (07-25-2017)

  3. #2
    xhackrotmg's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Location
    YouTube
    Posts
    11
    Reputation
    10
    Thanks
    0
    I see its working on the testing server. 10/10 m8!

  4. #3
    Transferred's Avatar
    Join Date
    Jun 2015
    Gender
    male
    Posts
    766
    Reputation
    31
    Thanks
    447
    My Mood
    Buzzed
    what source is it for
    fabians?

  5. #4
    Threadstarter
    &quot;1v1 rust qs only kid&quot;
    Former Staff
    Premium Member
    Riigged's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Location
    no
    Posts
    3,846
    Reputation
    401
    Thanks
    10,254
    My Mood
    Devilish
    Quote Originally Posted by Transferred View Post
    what source is it for
    fabians?
    yeah
    didnt think id have to say that bc im pretty sure fabiano is only source out there (publicly released) with the timer on merchants and etc.

     








  6. #5
    Transferred's Avatar
    Join Date
    Jun 2015
    Gender
    male
    Posts
    766
    Reputation
    31
    Thanks
    447
    My Mood
    Buzzed
    Quote Originally Posted by Riigged View Post

    yeah
    didnt think id have to say that bc im pretty sure fabiano is only source out there (publicly released) with the timer on merchants and etc.
    orly :3 < oops spoiled something

  7. #6
            (╭ರ_•)          
    Premium Member
    ~V~'s Avatar
    Join Date
    May 2014
    Gender
    male
    Location
    Posts
    628
    Reputation
    29
    Thanks
    1,478
    We had this before Fab released his source :P



  8. #7
    Threadstarter
    &quot;1v1 rust qs only kid&quot;
    Former Staff
    Premium Member
    Riigged's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Location
    no
    Posts
    3,846
    Reputation
    401
    Thanks
    10,254
    My Mood
    Devilish
    Quote Originally Posted by VoOoLoX View Post
    We had this before Fab released his source :P


    yeah, perfect example why i said publicly released sources cuz ik some people including you have been working on outside sources :P

     








  9. #8
    Slendergo's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    382
    Reputation
    17
    Thanks
    250
    My Mood
    Inspired
    Quote Originally Posted by Riigged View Post

    yeah
    didnt think id have to say that bc im pretty sure fabiano is only source out there (publicly released) with the timer on merchants and etc.
    not realy my server had it way b4 release 2 then i passed around to some club sources
    Last edited by Slendergo; 07-29-2015 at 03:43 AM.

  10. #9
    Slendergo's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    382
    Reputation
    17
    Thanks
    250
    My Mood
    Inspired
    Quote Originally Posted by Riigged View Post
    Want the items in your nexus to never have a discount? No disappearing after 5 have been bought and users having to wait for another to spawn?
    Replace your merchants.cs (Wserver>Realm>Entities>Merchant>Merchants.cs) with this.


    Code:
    #region
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Xml.Linq;
    using log4net;
    using wServer.networking.svrPackets;
    using wServer.realm.entities.player;
    
    #endregion
    
    namespace wServer.realm.entities.merchant
    {
        public class Merchants : SellableObject
        {
            private const int BUY_NO_GOLD = 3;
            private const int BUY_NO_FAME = 6;
            private const int BUY_NO_FORTUNETOKENS = 9;
            private const int MERCHANT_SIZE = 100;
            private static readonly ILog log = LogManager.GetLogger(typeof(Merchants));
    
            private readonly Dictionary<int, Tuple<int, CurrencyType>> prices = MerchantLists.prices;
    
            private bool closing;
            private bool newMerchant;
            private int tickcount;
    
            public static Random Random { get; private set; }
    
            public Merchants(RealmManager manager, ushort objType, World owner = null)
                : base(manager, objType)
            {
                MType = -1;
                Size = MERCHANT_SIZE;
                if (owner != null)
                    Owner = owner;
    
                if (Random == null) Random = new Random();
                if (AddedTypes == null) AddedTypes = new List<KeyValuePair<string, int>>();
                if(owner != null) ResolveMType();
            }
    
            private static List<KeyValuePair<string, int>> AddedTypes { get; set; }
    
            public bool Custom { get; set; }
    
            public int MType { get; set; }
            public int MRemaining { get; set; }
            public int MTime { get; set; }
            public int Discount { get; set; }
    
            protected override void ExportStats(IDictionary<StatsType, object> stats)
            {
                stats[StatsType.MerchantMerchandiseType] = MType;
                stats[StatsType.MerchantRemainingCount] = MRemaining;
                stats[StatsType.MerchantRemainingMinute] = newMerchant ? Int32.MaxValue : MTime;
                stats[StatsType.MerchantDiscount] = Discount;
                stats[StatsType.SellablePrice] = Price;
                stats[StatsType.SellableRankRequirement] = RankReq;
                stats[StatsType.SellablePriceCurrency] = Currency;
    
                base.ExportStats(stats);
            }
    
            public override void Init(World owner)
            {
                base.Init(owner);
                ResolveMType();
                UpdateCount++;
                if (MType == -1) Owner.LeaveWorld(this);
            }
    
            protected override bool TryDeduct(Player player)
            {
                var acc = player.Client.Account;
                if (player.Stars < RankReq) return false;
    
                if (Currency == CurrencyType.Fame)
                    if (acc.Stats.Fame < Price) return false;
    
                if (Currency == CurrencyType.Gold)
                    if (acc.Credits < Price) return false;
    
                if (Currency == CurrencyType.FortuneTokens)
                    if (acc.FortuneTokens < Price) return false;
                return true;
            }
    
            public override void Buy(Player player)
            {
                Manager.Database.DoActionAsync(db =>
                {
                    if (ObjectType == 0x01ca) //Merchant
                    {
                        if (TryDeduct(player))
                        {
                            for (var i = 0; i < player.Inventory.Length; i++)
                            {
                                try
                                {
                                    XElement ist;
                                    Manager.GameData.ObjectTypeToElement.TryGetValue((ushort)MType, out ist);
                                    if (player.Inventory[i] == null &&
                                        (player.SlotTypes[i] == 10 ||
                                         player.SlotTypes[i] == Convert.ToInt16(ist.Element("SlotType").Value)))
                                    // Exploit fix - No more mnovas as weapons!
                                    {
                                        player.Inventory[i] = Manager.GameData.Items[(ushort)MType];
    
                                        if (Currency == CurrencyType.Fame)
                                            player.CurrentFame =
                                                player.Client.Account.Stats.Fame =
                                                    db.UpdateFame(player.Client.Account, -Price);
                                        if (Currency == CurrencyType.Gold)
                                            player.Credits =
                                                player.Client.Account.Credits =
                                                    db.UpdateCredit(player.Client.Account, -Price);
                                        if (Currency == CurrencyType.FortuneTokens)
                                            player.Tokens =
                                                player.Client.Account.FortuneTokens =
                                                    db.UpdateFortuneToken(player.Client.Account, -Price);
    
                                        player.Client.SendPacket(new BuyResultPacket
                                        {
                                            Result = 0,
                                            Message = "{\"key\":\"server.buy_success\"}"
                                        });
                                        MRemaining--;
                                        player.UpdateCount++;
                                        player.SaveToCharacter();
                                        UpdateCount++;
                                        return;
                                    }
                                }
                                catch (Exception e)
                                {
                                    log.Error(e);
                                }
                            }
                            player.Client.SendPacket(new BuyResultPacket
                            {
                                Result = 0,
                                Message = "{\"key\":\"server.inventory_full\"}"
                            });
                        }
                        else
                        {
                            if (player.Stars < RankReq)
                            {
                                player.Client.SendPacket(new BuyResultPacket
                                {
                                    Result = 0,
                                    Message = "Not enough stars!"
                                });
                                return;
                            }
                            switch (Currency)
                            {
                                case CurrencyType.Gold:
                                    player.Client.SendPacket(new BuyResultPacket
                                    {
                                        Result = BUY_NO_GOLD,
                                        Message = "{\"key\":\"server.not_enough_gold\"}"
                                    });
                                    break;
                                case CurrencyType.Fame:
                                    player.Client.SendPacket(new BuyResultPacket
                                    {
                                        Result = BUY_NO_FAME,
                                        Message = "{\"key\":\"server.not_enough_fame\"}"
                                    });
                                    break;
                                case CurrencyType.FortuneTokens:
                                    player.Client.SendPacket(new BuyResultPacket
                                    {
                                        Result = BUY_NO_FORTUNETOKENS,
                                        Message = "{\"key\":\"server.not_enough_fortunetokens\"}"
                                    });
                                    break;
                            }
                        }
                    }
                });
            }
    
            public override void Tick(RealmTime time)
            {
                try
                {
                    if (Size == 0 && MType != -1)
                    {
                        Size = MERCHANT_SIZE;
                        UpdateCount++;
                    }
    
                    if (!closing)
                    {
                        tickcount++;
                        if (tickcount % (Manager?.TPS * 60) == 0) //once per minute after spawning
                        {
                            MTime--;
                            UpdateCount++;
                        }
                    }
    
                    if (MRemaining == 0 &&  MType != -1)
                    {
                        if (AddedTypes.Contains(new KeyValuePair<string, int>(Owner.Name, MType)))
                            AddedTypes.Remove(new KeyValuePair<string, int>(Owner.Name, MType));
                        Recreate(this);
                        UpdateCount++;
                    }
    
                    if (MTime == -1 && Owner != null)
                    {
                        if (AddedTypes.Contains(new KeyValuePair<string, int>(Owner.Name, MType)))
                            AddedTypes.Remove(new KeyValuePair<string, int>(Owner.Name, MType));
                        Recreate(this);
                        UpdateCount++;
                    }
    
                    if (MTime == 1 && !closing)
                    {
                        closing = true;
                        Owner?.Timers.Add(new WorldTimer(30 * 1000, (w1, t1) =>
                        {
                            MTime--;
                            UpdateCount++;
                            w1.Timers.Add(new WorldTimer(30 * 1000, (w2, t2) =>
                            {
                                MTime--;
                                UpdateCount++;
                            }));
                        }));
                    }
    
                    if (MType == -1) Owner?.LeaveWorld(this);
    
                    base.Tick(time);
                }
                catch (Exception ex)
                {
                    log.Error(ex);
                }
            }
    
            public void Recreate(Merchants x)
            {
                try
                {
                    var mrc = new Merchants(Manager, x.ObjectType, x.Owner);
                    mrc.Move(x.X, x.Y);
                    var w = Owner;
                    Owner.LeaveWorld(this);
                    w.Timers.Add(new WorldTimer(Random.Next(9999, 9999) * 1000, (world, time) => w.EnterWorld(mrc)));
                }
                catch (Exception e)
                {
                    log.Error(e);
                }
            }
    
            public void ResolveMType()
            {
                MType = -1;
                var list = new int[0];
                if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_1)
                    list = MerchantLists.store1List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_2)
                    list = MerchantLists.store2List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_3)
                    list = MerchantLists.store3List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_4)
                    list = MerchantLists.store4List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_5)
                    list = MerchantLists.store5List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_6)
                    list = MerchantLists.store6List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_7)
                    list = MerchantLists.store7List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_8)
                    list = MerchantLists.store8List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_9)
                    list = MerchantLists.store9List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_10)
                    list = MerchantLists.store10List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_11)
                    list = MerchantLists.store11List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_12)
                    list = MerchantLists.AccessoryDyeList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_13)
                    list = MerchantLists.ClothingClothList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_14)
                    list = MerchantLists.AccessoryClothList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_15)
                    list = MerchantLists.ClothingDyeList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_16)
                    list = MerchantLists.store5List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_17)
                    list = MerchantLists.store7List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_18)
                    list = MerchantLists.store6List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_19)
                    list = MerchantLists.store2List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_20)
                    list = MerchantLists.store20List;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_21)
                    list = MerchantLists.AccessoryClothList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_22)
                    list = MerchantLists.AccessoryDyeList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_23)
                    list = MerchantLists.ClothingClothList;
                else if (Owner.Map[(int) X, (int) Y].Region == TileRegion.Store_24)
                    list = MerchantLists.ClothingDyeList;
    
                if (AddedTypes == null) AddedTypes = new List<KeyValuePair<string, int>>();
                list.Shuffle();
                foreach (var t1 in list.Where(t1 => !AddedTypes.Contains(new KeyValuePair<string, int>(Owner.Name, t1))))
                {
                    AddedTypes.Add(new KeyValuePair<string, int>(Owner.Name, t1));
                    MType = t1;
                    MTime = Random.Next(9999, 9999);
                    MRemaining = Random.Next(9999, 9999);
                    newMerchant = true;
                    Owner.Timers.Add(new WorldTimer(30000, (w, t) =>
                    {
                        newMerchant = false;
                        UpdateCount++;
                    }));
    
                    var s = Random.Next(0, 9999);
    
                    if(s < 2)
                        Discount = 0;
                    else if(s < 5)
                        Discount = 0;
                    else if (s < 10)
                        Discount = 0;
                    else if(s < 15)
                        Discount = 0;
                    else Discount = 0;
    
                    Tuple<int, CurrencyType> price;
                    if (prices.TryGetValue(MType, out price))
                    {
                        if (Discount != 0)
                            Price = (int)(price.Item1 - (price.Item1 * ((double)Discount / 100))) < 1 ?
                                price.Item1 : (int)(price.Item1 - (price.Item1 * ((double)Discount / 100)));
                        else
                            Price = price.Item1;
                        Currency = price.Item2;
                    }
    
                    break;
                }
                UpdateCount++;
            }
        }
    }
    also btw i dont see any change apart from (9999, 9999) * 1000, which takes 9999000 to spawn again xd
    Last edited by Slendergo; 07-29-2015 at 11:53 AM.

  11. #10
    Threadstarter
    &quot;1v1 rust qs only kid&quot;
    Former Staff
    Premium Member
    Riigged's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Location
    no
    Posts
    3,846
    Reputation
    401
    Thanks
    10,254
    My Mood
    Devilish
    Quote Originally Posted by Slendergo View Post
    also btw i dont see any change apart from (9999, 9999) * 1000, which takes 9999000 to spawn again xd
    xD i made it 9999 bc noone here will have a server that will have 9999 of the same items purchased before wserver ends up restarting/closing

     








  12. #11
    Slendergo's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    382
    Reputation
    17
    Thanks
    250
    My Mood
    Inspired
    Quote Originally Posted by Riigged View Post


    xD i made it 9999 bc noone here will have a server that will have 9999 of the same items purchased before wserver ends up restarting/closing
    That Part U Chagned Doesnt Change The Amount Or The Time It Just Changes The Time Before Another Merchant Is Placed Xd If U Want To Change The Discount / Time / Count Of The Item Is, Discount, MTime, MRemaining
    Last edited by Slendergo; 07-29-2015 at 01:33 PM.

  13. #12
    Threadstarter
    &quot;1v1 rust qs only kid&quot;
    Former Staff
    Premium Member
    Riigged's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Location
    no
    Posts
    3,846
    Reputation
    401
    Thanks
    10,254
    My Mood
    Devilish
    Quote Originally Posted by Slendergo View Post
    that part u chagned doesnt change the amount or the time it just changes the time before another merchant is placed xd if u want to change the discount / time / count of the item is, Discount, MTime, MRemaining
    what i did works too, whenever i start my server, the 'new' bubble shows, goes away, then i tested it and bought like 40 ambrosias and kept redropping and buying lol

     








  14. #13
    Slendergo's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    382
    Reputation
    17
    Thanks
    250
    My Mood
    Inspired
    Quote Originally Posted by Riigged View Post


    what i did works too, whenever i start my server, the 'new' bubble shows, goes away, then i tested it and bought like 40 ambrosias and kept redropping and buying lol
    just disable them xD
    Last edited by Slendergo; 07-29-2015 at 01:33 PM.

  15. #14
    ossimc82's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Posts
    496
    Reputation
    42
    Thanks
    887
    My Mood
    In Love
    Quote Originally Posted by VoOoLoX View Post
    We had this before Fab released his source :P


    My server had it before all other servers (when the source was not public) :P

  16. #15
    Slendergo's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    382
    Reputation
    17
    Thanks
    250
    My Mood
    Inspired
    Quote Originally Posted by ossimc82 View Post
    My server had it before all other servers (when the source was not public) :P
    so true

Similar Threads

  1. how to stop lag
    By bloddyapache in forum Combat Arms Hacks & Cheats
    Replies: 10
    Last Post: 07-06-2009, 10:29 AM
  2. how to stop game lag
    By huntzone78 in forum Combat Arms Hacks & Cheats
    Replies: 7
    Last Post: 05-26-2009, 10:33 AM
  3. [Release] How To Stop Adobe From Banning Your Serial
    By iTZ BOOGEY in forum Art & Graphic Design
    Replies: 11
    Last Post: 04-19-2009, 02:51 PM
  4. how to stop the desconection of the game?
    By cavicious in forum Combat Arms Hacks & Cheats
    Replies: 7
    Last Post: 12-29-2008, 11:43 AM
  5. Complete guide on how to stop dcing
    By AznDud333 in forum Combat Arms Hacks & Cheats
    Replies: 14
    Last Post: 12-21-2008, 03:36 PM