-
[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
-
Re: [Tutorial] Stronghold Map don't drop items at death
DooM All Source no work !!
-
Re: [Tutorial] Stronghold Map don't drop items at death
-
Re: [Tutorial] Stronghold Map don't drop items at death
-
Re: [Tutorial] Stronghold Map don't drop items at death
in the case of added manually stand maps
why not only add the id of the stronghold tab?
Code:
if(ginfo_.channel == 5)
}
but I can not play the part of the database :)
if someone can share this
Nice, thank you
-
Re: [Tutorial] Stronghold Map don't drop items at death
how to don't use lockbox in map ?
-
Re: [Tutorial] Stronghold Map don't drop items at death
the server is crashando when he dies, and disconnects when I take everything back to normal code
-
Re: [Tutorial] Stronghold Map don't drop items at death
thank you, everything is working only in one specific map the loot is not falling and others is normal and falling.
else has a problem, is crashando the game when disconnects, dies and disconnects or is kikado server for a dev, well, everything related to "disconnect" is crashing the game.
the "r3dlog.txt" has nothing to related which either error or problem.
already in the log only shows "delete player MYNAME" and nothing else.
logss the map
Code:
000602.153| PKT_C2S_DisconnectReq for MyNick
000612.469| LogInfo: peer00, r:DisconnectPeer finished disconnect, CID:1016763 [MYNAME], ip:201.3.213.89
000612.469| DeletePlayer: MyNick, playerIdx: 0
it only happens with accounts "developers"
-
Re: [Tutorial] Stronghold Map don't drop items at death
how to not use trade system and not use lockerbox ?
-
Re: [Tutorial] Stronghold Map don't drop items at death
I'm make no drop 4 map and make in WZ_Char_SRV_SetStatus is not work how to make no drop 4 map?
Quote:
if (@in_MapID != 23)
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
else
if (@in_MapID != 29)
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
else
if (@in_MapID != 30)
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
else
if (@in_MapID != 31)
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
-
Re: [Tutorial] Stronghold Map don't drop items at death
Quote:
Originally Posted by
Returnerzx
I'm make no drop 4 map and make in WZ_Char_SRV_SetStatus is not work how to make no drop 4 map?
try using the logical operator OR
-
Re: [Tutorial] Stronghold Map don't drop items at death
This ?
Quote:
if (@in_MapID != 31 OR @in_MapID != 30 OR @in_MapID != 29 OR @in_MapID != 23) 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
-
Re: [Tutorial] Stronghold Map don't drop items at death
Quote:
Originally Posted by
Returnerzx
This ?
yep :cool:
-
Re: [Tutorial] Stronghold Map don't drop items at death
- - - Updated - - -
OK Yuri-BR :)
I'm remake try using the logical operator OR to AND this work for me :)
Thankyou Yuri-BR :)
-
Re: [Tutorial] Stronghold Map don't drop items at death
Quote:
Originally Posted by
Returnerzx
- - - Updated - - -
OK Yuri-BR :)
I'm remake try using the logical operator OR to AND this work for me :)
Thankyou Yuri-BR :)
ow yes, this right
-
Re: [Tutorial] Stronghold Map don't drop items at death
how to don't allow to use trade system and not use lockerbox ?