Stronghold Map don't drop items at death
In WarZ_Server.sln
obj_ServerPlayer.cpp
Search for:
Change for:Code:void obj_ServerPlayer::DoDeath()
in SQLCode: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; }
Stored Procedure -> WZ_Char_SRV_SetStatus
Search for:
Change to: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
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:
Change to: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); }
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); }



Reply With Quote![[Tutorial] Stronghold Map don't drop items at death](http://ragezone.com/hyper728.png)


