[Tutorial] Easy FIX Buy Mysterious BOX + Buy Item quantity

Results 1 to 8 of 8
  1. #1
    Valued Member obamabf2 is online now
    MemberRank
    Jan 2014 Join Date
    Parnamirim (RioLocation
    123Posts

    [Tutorial] Easy FIX Buy Mysterious BOX + Buy Item quantity

    Original Tutorial Mysterious BOX - Credits in post
    http://forum.ragezone.com/f790/relea...=similar+crate

    Origianal Tutorial Buy itens quantity - Credits in post
    http://forum.ragezone.com/f790/relea...place-1087620/


    Sorry my bad english, i use google translate

    By adding the function to purchase items in quantity the mysterious boxes stopped working. This easy FIX is to correct that and allow to buy in quantity and have the mysterious boxes.

    In warz.sln
    Search for:
    Code:
    int apiCode = gUserProfile.ApiLootBoxBuy(This->mStore_BuyItemID, buyIdx);


    Add section in red
    Code:
    int apiCode = gUserProfile.ApiLootBoxBuy(This->mStore_BuyItemID, buyIdx, This->mStore_BuyQuantity);


    Now search for:
    Code:
    void FrontendWarZ::eventBuyItem(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
    {    mStore_BuyItemID    = args[0].GetUInt(); // legsID    
    mStore_BuyPrice        = args[1].GetInt();    
    mStore_BuyPriceGD    = args[2].GetInt();
    //mStore_BuyPriceSC    = args[3].GetInt();


    add section in red
    Code:
    void FrontendWarZ::eventBuyItem(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
    {    mStore_BuyItemID    = args[0].GetUInt(); // legsID    
    mStore_BuyPrice        = args[1].GetInt();    
    mStore_BuyPriceGD    = args[2].GetInt();
    //mStore_BuyPriceSC    = args[3].GetInt();     
    mStore_BuyQuantity = args[3].GetInt(); // Fix By Jailson mendes
    mStore_BuyPrice *= mStore_BuyQuantity; // Fix By Jailson mendes
    mStore_BuyPriceGD *= mStore_BuyQuantity; // Fix By Jailson mendes

    Is now in data base...

    Opem navicat and replace or create new function
    Code:
    CREATE PROCEDURE [dbo].[FN_AddItemToUserCase]        @in_CustomerID int,
            @in_ItemID int,
            @in_ExpDays int,
                    @in_Qty int
    AS
    BEGIN
     SET NOCOUNT ON;
     
            select 0 as ResultCode
            select @in_ItemID as ItemID
     
     
            declare @inventoryID bigint = 0
            declare @LeasedUntil datetime
            declare @CurDate datetime = GETDATE()
           
            -- check if this is stackable item, if so - get buying stack size.
            -- stackable item defined where NumClips>0, Quantity is ClipSize
            declare @BuyStackSize int = 1
            select @BuyStackSize=ClipSize from Items_Weapons where ItemID=@in_ItemID and NumClips>0
           
            -- see if we already have that item in inventory without modification vars
            select @inventoryID=InventoryID, @LeasedUntil=LeasedUntil from UsersInventory
                    where (CustomerID=@in_CustomerID and CharID=0 and ItemID=@in_ItemID and Var1<0 and Var2<0 and Var3=10000000)
            if   @inventoryID = 0)
            begin
                    INSERT INTO UsersInventory (
                            CustomerID,
                            CharID,
                            ItemID,
                            LeasedUntil,
                            Quantity
                    )
                    VALUES (
                            @in_CustomerID,
                            0,
                            @in_ItemID,
                            DATEADD(day, @in_ExpDays, @CurDate),
                            @BuyStackSize
                    )
                    return
            end
           
            if   @LeasedUntil < @CurDate)
                    set @LeasedUntil = DATEADD(day, @in_ExpDays, @CurDate)
            else
                    set @LeasedUntil = DATEADD(day, @in_ExpDays, @LeasedUntil)
                   
            if   @LeasedUntil > '2020-1-1')
                    set @LeasedUntil = '2020-1-1'
     
            -- all items is stackable by default
            UPDATE UsersInventory SET
                    LeasedUntil= @LeasedUntil,
                    Quantity=(Quantity+@BuyStackSize)
            WHERE InventoryID = @inventoryID
     
            return
    END
    Download API FIXED! Buy Box misteryous
    api_MysteryBox

    Note: A remark made by buying the box, buy a box at a time if more than one unit will tell only one.


    Credits fix it's me and others credits in originals posts.
    Byebye !!!


  2. #2
    Proficient Member GMkidink is offline
    MemberRank
    Apr 2012 Join Date
    152Posts

    Re: [Tutorial] Easy FIX Buy Mysterious BOX + Buy Item quantity

    Thanks
    Last edited by GMkidink; 26-06-16 at 11:45 AM.

  3. #3
    Enthusiast zetoris is offline
    MemberRank
    Jul 2015 Join Date
    ThailandLocation
    29Posts

    Re: [Tutorial] Easy FIX Buy Mysterious BOX + Buy Item quantity

    have error
    error C2660: 'CUserProfile::ApiLootBoxBuy' : function does not take 3 arguments
    Need Add More
    UserProfile.cpp
    Find
    int CUserProfile::ApiLootBoxBuy(int itemId, int buyIdx)
    Replace With
    int CUserProfile::ApiLootBoxBuy(int itemId, int buyIdx, int qty)


    UserProfile.h
    Find
    in ApiLootBoxBuy
    Find
    int ApiLootBoxBuy(int itemId, int buyIdx);
    Replace With
    int ApiLootBoxBuy(int itemId, int buyIdx, int qty);

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

    Re: [Tutorial] Easy FIX Buy Mysterious BOX + Buy Item quantity

    complete tutorial
    in
    int CUserProfile::ApiLootBoxBuy(int itemId, int buyIdx, int qty)
    after this
    req.AddParam("BuyIdx", buyIdx);
    add this
    req.AddParam("Qty", qty);

  5. #5
    Valued Member obamabf2 is online now
    MemberRank
    Jan 2014 Join Date
    Parnamirim (RioLocation
    123Posts

    Re: [Tutorial] Easy FIX Buy Mysterious BOX + Buy Item quantity

    Quote Originally Posted by zetoris View Post
    have error


    Need Add More
    UserProfile.cpp
    Find

    Replace With


    UserProfile.h
    Find
    in ApiLootBoxBuy
    Find

    Replace With

    thanks for all

  6. #6
    Account Upgraded | Title Enabled! askmyleg is offline
    MemberRank
    Dec 2014 Join Date
    Mery keyLocation
    855Posts

    Re: [Tutorial] Easy FIX Buy Mysterious BOX + Buy Item quantity

    how to add boxes?

    Add a box of the function?
    Last edited by askmyleg; 06-07-16 at 06:54 PM.

  7. #7
    Valued Member obamabf2 is online now
    MemberRank
    Jan 2014 Join Date
    Parnamirim (RioLocation
    123Posts

    Re: [Tutorial] Easy FIX Buy Mysterious BOX + Buy Item quantity

    Quote Originally Posted by askmyleg View Post
    how to add boxes?

    Add a box of the function?

    Look this in original post mystery box

  8. #8
    Apprentice xAgentXx is offline
    MemberRank
    Jan 2014 Join Date
    24Posts

    Re: [Tutorial] Easy FIX Buy Mysterious BOX + Buy Item quantity

    How do I make that quantity window does not come out at the cases?



Advertisement