[HELP] Changing items in database

Results 1 to 3 of 3
  1. #1
    Account Upgraded | Title Enabled! dNi3L is offline
    MemberRank
    Nov 2014 Join Date
    IllinoisLocation
    237Posts

    [HELP] Changing items in database

    Can someone tell me if I am wrong in my thought process,
    or am I on the right track?
    Let say for instance I wanted to change the items a
    new character spawned in with.
    Example: Medium pack,baseball bat,water,pasta and bandages..

    In the db would I change this..

    if(@in_Alive = 0) begin
    update UsersChars set DeathUtcTime=GETUTCDATE() where CharID=@in_CharID
    -- update of backpacks
    update UsersChars set BackpackID=20176, BackpackSize=12 where CharID=@in_CharID
    -- delete stuff from backpack
    --delete from UsersInventory where CustomerID=@in_CustomerID and CharID=@in_CharID
    delete from UsersInventory where CharID=@in_CharID
    end
    select 0 as ResultCode
    END
    GO

    and...

    -- give basic items for first few survivors
    declare @CharsCreated int = 0
    update UsersData set CharsCreated=(CharsCreated+1) where CustomerID=@in_CustomerID
    select @CharsCreated=CharsCreated from UsersData where CustomerID=@in_CustomerID
    --if @CharsCreated <= 5) begin
    -- add some default items - BE ULTRA CAREFUL with BackpackSlot number
    insert into UsersInventory (CustomerID, CharID, BackpackSlot, ItemID, LeasedUntil, Quantity)
    values (@in_CustomerID, @CharID, 1, 101306, '2020-1-1', 1) -- Flashlight
    insert into UsersInventory (CustomerID, CharID, BackpackSlot, ItemID, LeasedUntil, Quantity)
    values (@in_CustomerID, @CharID, 2, 101261, '2020-1-1', 1) -- Bandages
    insert into UsersInventory (CustomerID, CharID, BackpackSlot, ItemID, LeasedUntil, Quantity)
    values (@in_CustomerID, @CharID, 3, 101296, '2020-1-1', 1) -- Can of Soda
    insert into UsersInventory (CustomerID, CharID, BackpackSlot, ItemID, LeasedUntil, Quantity)
    values (@in_CustomerID, @CharID, 4, 101289, '2020-1-1', 1) -- Granola Bar
    --end


    to this..

    if(@in_Alive = 0) begin
    update UsersChars set DeathUtcTime=GETUTCDATE() where CharID=@in_CharID
    -- update of backpacks
    update UsersChars set BackpackID=20175, BackpackSize=12 where CharID=@in_CharID
    -- delete stuff from backpack
    --delete from UsersInventory where CustomerID=@in_CustomerID and CharID=@in_CharID
    delete from UsersInventory where CharID=@in_CharID
    end
    select 0 as ResultCode
    END
    GO

    and...

    -- give basic items for first few survivors
    declare @CharsCreated int = 0
    update UsersData set CharsCreated=(CharsCreated+1) where CustomerID=@in_CustomerID
    select @CharsCreated=CharsCreated from UsersData where CustomerID=@in_CustomerID
    --if @CharsCreated <= 5) begin
    -- add some default items - BE ULTRA CAREFUL with BackpackSlot number
    insert into UsersInventory (CustomerID, CharID, BackpackSlot, ItemID, LeasedUntil, Quantity)
    values (@in_CustomerID, @CharID, 1, 101278, '2020-1-1', 1) -- Baseball Bat
    insert into UsersInventory (CustomerID, CharID, BackpackSlot, ItemID, LeasedUntil, Quantity)
    values (@in_CustomerID, @CharID, 2, 101261, '2020-1-1', 1) -- Bandages
    insert into UsersInventory (CustomerID, CharID, BackpackSlot, ItemID, LeasedUntil, Quantity)
    values (@in_CustomerID, @CharID, 3, 101298, '2020-1-1', 1) -- Water 1L
    insert into UsersInventory (CustomerID, CharID, BackpackSlot, ItemID, LeasedUntil, Quantity)
    values (@in_CustomerID, @CharID, 4, 101290, '2020-1-1', 1) -- Can of Pasta
    --end

    any help would be appreciated..


  2. #2
    m70b1jr#9501 m70b1jr is offline
    MemberRank
    May 2013 Join Date
    North CarolinaLocation
    862Posts

    Re: [HELP] Changing items in database

    I think it only works on characters created on a new account.

  3. #3
    Account Upgraded | Title Enabled! dNi3L is offline
    MemberRank
    Nov 2014 Join Date
    IllinoisLocation
    237Posts

    Re: [HELP] Changing items in database

    I'm sorry that's what I had meant to say..so that new characters would spawn in with something a little different than what was originally given..I also noticed another few lines under which characters are unlocked which would need changed as well..All one can do is try,that's how we learn..Thanks m70b1jr



Advertisement