[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);
}
Re: [Tutorial] Stronghold Map don't drop items at death
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?
Re: [Tutorial] Stronghold Map don't drop items at death
how to open Stronghold Map?
- - - Updated - - -
and thank yuri
Re: [Tutorial] Stronghold Map don't drop items at death
Quote:
Originally Posted by
javaz97
how to open Stronghold Map?
- - - Updated - - -
and thank yuri
Like adding all other maps.
Re: [Tutorial] Stronghold Map don't drop items at death
Quote:
Originally Posted by
ElitePivete
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
Quote:
if (loadout_->GameMapId != GBGameInfo::MAPID_WZ_Cliffside_PVP){
}
Re: [Tutorial] Stronghold Map don't drop items at death
Is there a way to Undo this?
Re: [Tutorial] Stronghold Map don't drop items at death
Quote:
Originally Posted by
Carlos Rangel
Is there a way to Undo this?
Control Z, if you haven't closed it yet.
Re: [Tutorial] Stronghold Map don't drop items at death
Quote:
Originally Posted by
Carlos Rangel
Is there a way to Undo this?
removes everything that this red :D
Re: [Tutorial] Stronghold Map don't drop items at death
Not working on Community Edition
I tested but only working Dev Accounts :/
Re: [Tutorial] Stronghold Map don't drop items at death
Re: [Tutorial] Stronghold Map don't drop items at death
Work with newest ISS source?
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?
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 ?
Re: [Tutorial] Stronghold Map don't drop items at death