[Tutorial] Stronghold Map don't drop items at death

Page 1 of 2 12 LastLast
Results 1 to 15 of 30
  1. #1
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,040Posts

    thumbs up [Tutorial] Stronghold Map don't drop items at death

    Stronghold Map don't drop items at death


    In WarZ_Server.sln

    obj_ServerPlayer.cpp

    Search for:

    Code:
    void obj_ServerPlayer::DoDeath()
    Change for:

    Code:
    void obj_ServerPlayer::DoDeath()
    {
        gServerLogic.LogInfo(peerId_, "Death", ""); CLOG_INDENT;
    
        deathTime     = r3dGetTime();
    
        if (gServerLogic.ginfo_.mapId != GBGameInfo::MAPID_WZ_Cliffside)
        {
            // drop all items
            for(int i=0; i<loadout_->BackpackSize; i++)
            {
                const wiInventoryItem& wi = loadout_->Items[i];
                if(wi.itemID > 0) {
                    BackpackDropItem(i);
                }
            }
    
    
            // drop not-default backpack as well
            if(loadout_->BackpackID != 20176)
            {
                // create network object
                obj_DroppedItem* obj = (obj_DroppedItem*)srv_CreateGameObject("obj_DroppedItem", "obj_DroppedItem", GetRandomPosForItemDrop());
                obj->SetNetworkID(gServerLogic.GetFreeNetId());
                obj->NetworkLocal = true;
                // vars
                obj->m_Item.itemID   = loadout_->BackpackID;
                obj->m_Item.quantity = 1;
            }
        }
    
        // set that character is dead
        loadout_->Alive   = 0;
        loadout_->GamePos = GetPosition();
        loadout_->Health  = 0;
        // clear attachments
        if (gServerLogic.ginfo_.mapId != GBGameInfo::MAPID_WZ_Cliffside)
        {
             loadout_->Attachment[0].Reset();
             loadout_->Attachment[1].Reset();
        }
        //NOTE: server WZ_Char_SRV_SetStatus will clear player backpack, so make that CJobUpdateChar::Exec() won't update it
        savedLoadout_ = *loadout_;
    
        gServerLogic.ApiPlayerUpdateChar(this);
    
        SetLatePacketsBarrier("death");
    
        return;
    }
    in SQL

    Stored Procedure -> WZ_Char_SRV_SetStatus

    Search for:

    Code:
    if(@in_Alive = 0) begin
        update UsersChars set DeathUtcTime=GETUTCDATE() where CharID=@in_CharID
        -- set default backpack on death
        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
        exec DBG_StoreApiCall 'Death', 0, @in_CustomerID, @in_CharID
    end
    Change to:

    Code:
    declare @in_MapID int
    select @in_MapID = GameMapId from UsersChars where CharID = @in_CharID
    
    if(@in_Alive = 0) begin
        update UsersChars set DeathUtcTime=GETUTCDATE() where CharID=@in_CharID
        if(@in_MapID != 3) begin
            -- set default backpack on death
            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
        end
        exec DBG_StoreApiCall 'Death', 0, @in_CustomerID, @in_CharID
    end

    Here are the ID of map

    Code:
    enum EMapId
    {
      MAPID_Editor_Particles = 0,
      MAPID_ServerTest, // 1
      MAPID_WZ_Colorado, // 2
      MAPID_WZ_Cliffside, // 3 ...
      MAPID_WZ_California,
      MAPID_WZ_Caliwood,
      // NOTE: do *NOT* add maps inside current IDs, add ONLY at the end
      // otherwise current map statistics in DB will be broken
      MAPID_MAX_ID,
    };

    if you want to hide the drop button in determined map, you should change this code:

    in WarZ.sln

    HUDPause.cpp

    Search for:

    Code:
    if( !plr->IsSwimming() )
    {
        var[0].SetString("$FR_PAUSE_INVENTORY_DROP_ITEM");
        var[1].SetInt(HPA_DROP_ITEM);
        gfxMovie.Invoke("_root.api.Main.Inventory.addContextMenuOption", var, 2);
    }
    Change to:

    Code:
    if( !plr->IsSwimming() && gClientLogic().m_gameInfo.mapId != GBGameInfo::MAPID_WZ_Cliffside )
    {
        var[0].SetString("$FR_PAUSE_INVENTORY_DROP_ITEM");
        var[1].SetInt(HPA_DROP_ITEM);
        gfxMovie.Invoke("_root.api.Main.Inventory.addContextMenuOption", var, 2);
    }
    Last edited by Yuri-BR; 28-01-16 at 08:03 PM. Reason: fix


  2. #2
    Harro Syxn is offline
    MemberRank
    Mar 2013 Join Date
    767Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    Nice share Yuri.

  3. #3
    Apprentice ElitePivete is offline
    MemberRank
    Jun 2013 Join Date
    FortalezaLocation
    6Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    Nice work,
    but it has a problem.
    the player can still play items on the ground, and therefore more easy to dupe.
    Some additional code to deny the player to have an item in a given map?

  4. #4
    Alpha Member javaz97 is offline
    MemberRank
    May 2006 Join Date
    HellLocation
    1,537Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    how to open Stronghold Map?

    - - - Updated - - -

    and thank yuri

  5. #5
    f793 eXtremousZ is offline
    MemberRank
    May 2013 Join Date
    Planet ShearLocation
    857Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    Quote Originally Posted by javaz97 View Post
    how to open Stronghold Map?

    - - - Updated - - -

    and thank yuri
    Like adding all other maps.

  6. #6
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,040Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    Quote Originally Posted by ElitePivete View Post
    Nice work,
    but it has a problem.
    the player can still play items on the ground, and therefore more easy to dupe.
    Some additional code to deny the player to have an item in a given map?
    function of item drop, you can lock the item drop on map

    if (loadout_->GameMapId != GBGameInfo::MAPID_WZ_Cliffside_PVP){
    }

  7. #7
    Apprentice Carlos Rangel is offline
    MemberRank
    Apr 2014 Join Date
    10Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    Is there a way to Undo this?

  8. #8
    Titan Guard Dev iTzTonyR703 is offline
    MemberRank
    Apr 2013 Join Date
    US, STL.Location
    296Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    Quote Originally Posted by Carlos Rangel View Post
    Is there a way to Undo this?
    Control Z, if you haven't closed it yet.

  9. #9
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,040Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    Quote Originally Posted by Carlos Rangel View Post
    Is there a way to Undo this?
    removes everything that this red :D

  10. #10
    Enthusiast alperen81 is offline
    MemberRank
    Jul 2012 Join Date
    NaplesLocation
    34Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    Not working on Community Edition

    I tested but only working Dev Accounts :/

  11. #11
    Member robson154 is offline
    MemberRank
    Sep 2013 Join Date
    75Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    work in Doom MMo v3?

  12. #12
    Apprentice HSDxD is offline
    MemberRank
    Dec 2014 Join Date
    U.S.ALocation
    20Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    Work with newest ISS source?

  13. #13
    Member Suycune is offline
    MemberRank
    Apr 2015 Join Date
    New York, New YLocation
    72Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    I have a problem, when you die you don't drop items but when go to top the items has gone any idea how to solve it?

  14. #14
    Account Upgraded | Title Enabled! Returnerzx is offline
    MemberRank
    Apr 2011 Join Date
    236Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    Not work in newest ISS source.

    How to make at work in newest ISS source ?

  15. #15
    Apprentice takaida is offline
    MemberRank
    Jun 2006 Join Date
    17Posts

    Re: [Tutorial] Stronghold Map don't drop items at death

    Not Work in WarZTH2 Src



Page 1 of 2 12 LastLast

Advertisement