public override void OnEnable() { if(_initialized) return; ItemList = UpdateItemList(); CustomLog.Normal("Version {0} Loaded.", Version); _initialized = true; }
private static void MerchantBuy(int containerId, int quantity) { if(quantity > 20) { quantity = 20; } var getItemInfo = Lua.GetReturnValues(string.Format("return GetItemInfo({0});", containerId)); var itemName = getItemInfo[0]; if(string.IsNullOrEmpty(itemName)) { CustomLog.Normal("Can't find vendor item."); return; } Lua.DoString(string.Format("for i=1, GetMerchantNumItems() do local l=GetMerchantItemLink(i) if l then if l:find('{0}') then BuyMerchantItem(i, {1})end end end", itemName, quantity)); ShopTimer.Restart(); }