[HELP] Market items quantity buy

Results 1 to 10 of 10
  1. #1
    Enthusiast LukeFire is offline
    MemberRank
    Jul 2015 Join Date
    43Posts

    cool [HELP] Market items quantity buy

    Hello RageZone,
    Is anyone so kind to share a code so that you can decide the quantity of items you want to buy in the market, like NewZ's marketplace?
    Basically what i want is a system that when you go to buy and item in the market it asks you the quantity of the item you would like to buy.

    Thanks!


  2. #2
    ☆Dying Dawn☆ Bombillo is offline
    MemberRank
    Jan 2012 Join Date
    ValhallaLocation
    977Posts

    Re: [HELP] Market items quantity buy

    no one with that function will give it for free... too stingy

  3. #3
    Account Upgraded | Title Enabled! GetRektBambi is offline
    MemberRank
    Oct 2015 Join Date
    268Posts

    Re: [HELP] Market items quantity buy

    Quote Originally Posted by Bombillo View Post
    no one with that function will give it for free... too stingy
    You have so little faith in the community, yet they have done so much for you already.

    ----

    I will take a look when I get time luke, it can't be that hard. Copy and paste most likely.

  4. #4
    Valued Member erickstyle is offline
    MemberRank
    Sep 2008 Join Date
    Santo André, BLocation
    104Posts

    Re: [HELP] Market items quantity buy

    I was messing with it could do work but only charged one item regardless of the amount

    Code:
    bool FrontendWarZ::UpdateInventoryWithBoughtItem()
    {
    	int numItem = gUserProfile.ProfileData.NumItems;
    
    	// check if we bought consumable
    	int quantityToAdd = storecat_GetItemBuyStackSize(mStore_BuyItemID);
    	int totalQuantity = 1;
    
    	// see if we already have this item in inventory
    	bool found = false;
    	uint32_t inventoryID = 0;
    	int	var1 = -1;
    	int	var2 = 0;
    	int	var3 = wiInventoryItem::MAX_DURABILITY;
    
    	for(int i=0; i<numItem; ++i)
    	{
    		if(gUserProfile.ProfileData.Inventory[i].InventoryID == m_inventoryID)
    		{
    			inventoryID = uint32_t(gUserProfile.ProfileData.Inventory[i].InventoryID);
    			var1 = gUserProfile.ProfileData.Inventory[i].Var1;
    			var2 = gUserProfile.ProfileData.Inventory[i].Var2;
    			var3 = gUserProfile.ProfileData.Inventory[i].Var3;
    
    			gUserProfile.ProfileData.Inventory[i].quantity += quantityToAdd;
    			totalQuantity = gUserProfile.ProfileData.Inventory[i].quantity;
    
    			found = true;
    			break; 
    		}
    	}
    
    	if(!found)
    	{
    		wiInventoryItem* itm = gUserProfile.getFreeInventorySlot();
    		if(!itm)
    		{
    			Scaleform::GFx::Value var[2];
    			var[0].SetString(gLangMngr.getString("InGameUI_ErrorMsg_NoInventorySpace"));
    			var[1].SetBoolean(true);
    			gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
    			return true;
    		}
    
    		itm->InventoryID = m_inventoryID;
    		itm->itemID     = mStore_BuyItemID;
    		itm->quantity   = quantityToAdd;
    		itm->Var1   = var1;
    		itm->Var2   = var2;
    		itm->Var3   = var3;
    		
    		inventoryID = uint32_t(itm->InventoryID);
    
    		totalQuantity = quantityToAdd;
    	}
    
    	Scaleform::GFx::Value var[7];
    	var[0].SetUInt(inventoryID);
    	var[1].SetUInt(mStore_BuyItemID);
    	var[2].SetNumber(totalQuantity);
    	var[3].SetNumber(var1);
    	var[4].SetNumber(var2);
    	var[5].SetBoolean(false);
    	var[6].SetString(getAdditionalDescForItem(mStore_BuyItemID, var1, var2, var3));
    	gfxMovie.Invoke("_root.api.addInventoryItem", var, 7);
    
    	return found;
    }
    Here I managed to come by quantity. but I undid the problem to charge one

  5. #5
    Member Trickey1337 is offline
    MemberRank
    Aug 2014 Join Date
    86Posts

    Re: [HELP] Market items quantity buy

    LSZ first emulator to ever get it working btw.

  6. #6
    ☆Dying Dawn☆ Bombillo is offline
    MemberRank
    Jan 2012 Join Date
    ValhallaLocation
    977Posts

    Re: [HELP] Market items quantity buy

    Quote Originally Posted by GetRektBambi View Post
    You have so little faith in the community, yet they have done so much for you already.

    ----

    I will take a look when I get time luke, it can't be that hard. Copy and paste most likely.
    there are people who know a lot of knowledge here and could provide a better future for this community, but very few people give help in this community and this forum section already has around 1k of members and only like 10 member give the help if i'm not wrong the others only want money or they are just leechers I meet some people in this forum like them but i'm thankful for the people who want to do the better for this game and I really love this game and could be more than it is if everyone give the full help like the others mmorpg in this forum since i'm here

  7. #7
    Proficient Member demonlord21 is offline
    MemberRank
    Apr 2012 Join Date
    127.0.0.1Location
    153Posts

    Re: [HELP] Market items quantity buy

    Quote Originally Posted by erickstyle View Post
    I was messing with it could do work but only charged one item regardless of the amount

    Code:
    bool FrontendWarZ::UpdateInventoryWithBoughtItem()
    {
    	int numItem = gUserProfile.ProfileData.NumItems;
    
    	// check if we bought consumable
    	int quantityToAdd = storecat_GetItemBuyStackSize(mStore_BuyItemID);
    	int totalQuantity = 1;
    
    	// see if we already have this item in inventory
    	bool found = false;
    	uint32_t inventoryID = 0;
    	int	var1 = -1;
    	int	var2 = 0;
    	int	var3 = wiInventoryItem::MAX_DURABILITY;
    
    	for(int i=0; i<numItem; ++i)
    	{
    		if(gUserProfile.ProfileData.Inventory[i].InventoryID == m_inventoryID)
    		{
    			inventoryID = uint32_t(gUserProfile.ProfileData.Inventory[i].InventoryID);
    			var1 = gUserProfile.ProfileData.Inventory[i].Var1;
    			var2 = gUserProfile.ProfileData.Inventory[i].Var2;
    			var3 = gUserProfile.ProfileData.Inventory[i].Var3;
    
    			gUserProfile.ProfileData.Inventory[i].quantity += quantityToAdd;
    			totalQuantity = gUserProfile.ProfileData.Inventory[i].quantity;
    
    			found = true;
    			break; 
    		}
    	}
    
    	if(!found)
    	{
    		wiInventoryItem* itm = gUserProfile.getFreeInventorySlot();
    		if(!itm)
    		{
    			Scaleform::GFx::Value var[2];
    			var[0].SetString(gLangMngr.getString("InGameUI_ErrorMsg_NoInventorySpace"));
    			var[1].SetBoolean(true);
    			gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
    			return true;
    		}
    
    		itm->InventoryID = m_inventoryID;
    		itm->itemID     = mStore_BuyItemID;
    		itm->quantity   = quantityToAdd;
    		itm->Var1   = var1;
    		itm->Var2   = var2;
    		itm->Var3   = var3;
    		
    		inventoryID = uint32_t(itm->InventoryID);
    
    		totalQuantity = quantityToAdd;
    	}
    
    	Scaleform::GFx::Value var[7];
    	var[0].SetUInt(inventoryID);
    	var[1].SetUInt(mStore_BuyItemID);
    	var[2].SetNumber(totalQuantity);
    	var[3].SetNumber(var1);
    	var[4].SetNumber(var2);
    	var[5].SetBoolean(false);
    	var[6].SetString(getAdditionalDescForItem(mStore_BuyItemID, var1, var2, var3));
    	gfxMovie.Invoke("_root.api.addInventoryItem", var, 7);
    
    	return found;
    }
    Here I managed to come by quantity. but I undid the problem to charge one
    wouldnt it work if you altered the item buy stuff in the api then where it would do something
    like parsing the quantity then mulliplying cost by quanitity.
    i looked at trying to do this myself but working with code isnt my forte but if i recall there is something in api the i believe would also need to be edited or maybe in sql itself

  8. #8
    Valued Member erickstyle is offline
    MemberRank
    Sep 2008 Join Date
    Santo André, BLocation
    104Posts

    Re: [HELP] Market items quantity buy

    Quote Originally Posted by demonlord21 View Post
    wouldnt it work if you altered the item buy stuff in the api then where it would do something
    like parsing the quantity then mulliplying cost by quanitity.
    i looked at trying to do this myself but working with code isnt my forte but if i recall there is something in api the i believe would also need to be edited or maybe in sql itself
    yeah i change a bit but no work

  9. #9
    Proficient Member UNEXPECT is offline
    MemberRank
    Jun 2014 Join Date
    C:/inetpubLocation
    175Posts

    Re: [HELP] Market items quantity buy

    To change only the source wont resolve your problem :)

  10. #10
    Account Upgraded | Title Enabled! GetRektBambi is offline
    MemberRank
    Oct 2015 Join Date
    268Posts

    Re: [HELP] Market items quantity buy

    Quote Originally Posted by UNEXPECT View Post
    To change only the source wont resolve your problem :)
    Your post is not helpful to these guys in anyway.

    Obviously its function + api + source, I dont think flash needs touching as it has the necessary .. and I have added luke on skype to complete this task, I will then release on here for everyone to enjoy.

    - - - Updated - - -

    Work done so far as discussed, just finishing up the source and will update the thread linked when its done.

    Hope this helped!

    https://forum.ragezone.com/f790/buy-...0/#post8548007



Advertisement