!CREDITS fil22t!
i just put it in the right section.
WZ_Char_SRV_SetStatus
obj_ServerPlayer.cppCode:USE [warz] GO /****** Object: StoredProcedure [dbo].[WZ_Char_SRV_SetStatus] Script Date: 10/19/2013 10:46:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ---------------------------- -- Procedure structure for [WZ_Char_SRV_SetStatus] -- ---------------------------- ALTER PROCEDURE [dbo].[WZ_Char_SRV_SetStatus] @in_CustomerID int, @in_CharID int, @in_Alive int, @in_GamePos varchar(256), @in_GameFlags int, @in_Health float, @in_Hunger float, @in_Thirst float, @in_Toxic float, @in_TimePlayed int, @in_XP int, @in_Reputation int, @in_GameDollars int, @in_Stat00 int, @in_Stat01 int, @in_Stat02 int, @in_Stat03 int, @in_Stat04 int, @in_Stat05 int AS BEGIN SET NOCOUNT ON; -- -- this function should be called only by server, so we skip all validations -- -- record last game update update UsersData set GameDollars=@in_GameDollars, lastgamedate=GETDATE() where CustomerID=@in_CustomerID declare @IsLegend int = 0 select @IsLegend=AccountType from UsersData where CustomerID=@in_CustomerID -- update basic character data update UsersChars set GamePos=@in_GamePos, GameFlags=@in_GameFlags, Alive=@in_Alive, Health=@in_Health, Food=@in_Hunger, Water=@in_Thirst, Toxic=@in_Toxic, TimePlayed=@in_TimePlayed, LastUpdateDate=GETDATE(), XP=@in_XP, Reputation=@in_Reputation, Stat00=@in_Stat00, Stat01=@in_Stat01, Stat02=@in_Stat02, Stat03=@in_Stat03, Stat04=@in_Stat04, Stat05=@in_Stat05 where CharID=@in_CharID if(@in_Alive = 0) begin update UsersChars set DeathUtcTime=GETUTCDATE() where CharID=@in_CharID if(@IsLegend = 2) 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 end select 0 as ResultCode END
Code:void obj_ServerPlayer::DoDeath() { gServerLogic.LogInfo(peerId_, "Death", ""); CLOG_INDENT; deathTime = r3dGetTime(); if(profile_.ProfileData.AccountType == 2) { // 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(profile_.ProfileData.AccountType == 2) { 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; }



Reply With Quote![[TUT] VIP dont drop items at death - fil22t](http://ragezone.com/hyper728.png)


