[TUT] VIP dont drop items at death - fil22t

Page 1 of 3 123 LastLast
Results 1 to 15 of 31
  1. #1
    Skilled mapper Hypoflex is offline
    MemberRank
    May 2012 Join Date
    NetherlandsLocation
    256Posts

    [TUT] VIP dont drop items at death - fil22t

    !CREDITS fil22t!
    i just put it in the right section.

    WZ_Char_SRV_SetStatus
    Code:
    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
    obj_ServerPlayer.cpp
    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;
    }


  2. #2
    Enthusiast kasami2620 is offline
    MemberRank
    Aug 2013 Join Date
    27Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    Only Vip don't drop items at death yes or not ?

  3. #3
    Proficient Member Lewis Caddick is offline
    MemberRank
    May 2013 Join Date
    Casa Del LewisLocation
    160Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    Quote Originally Posted by kasami2620 View Post
    Only Vip don't drop items at death yes or not ?

  4. #4
    Apprentice kitos is offline
    MemberRank
    Jun 2011 Join Date
    11Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    Help, all players die and not lose the items

  5. #5
    Enthusiast Alien165 is offline
    MemberRank
    Sep 2013 Join Date
    33Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    backpack id is 20179 no ?

  6. #6
    Account Upgraded | Title Enabled! KlausVander is offline
    MemberRank
    May 2013 Join Date
    BrasilLocation
    240Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    Work in dnc source?
    Who is vip? Legend guys or the premium guys at the new's sources?

  7. #7
    Apprentice Para X Modsite is offline
    MemberRank
    Sep 2013 Join Date
    15Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    He setup my server and use this source

    it work!!!!!

    "Only Vip don't drop items at death yes or not ?"

    Yes!!!!

  8. #8
    Account Upgraded | Title Enabled! KlausVander is offline
    MemberRank
    May 2013 Join Date
    BrasilLocation
    240Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    This VIP, is Legend accounts ????

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

    Re: [TUT] VIP dont drop items at death - fil22t

    how to add VIP and include expire day?

    * VIP 3 or 7 day

  10. #10
    Enthusiast fil22t is offline
    MemberRank
    Jun 2011 Join Date
    43Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    This VIP, is Legend accounts ????
    Yes :D

  11. #11
    Account Upgraded | Title Enabled! KlausVander is offline
    MemberRank
    May 2013 Join Date
    BrasilLocation
    240Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    Quote Originally Posted by fil22t View Post
    Yes :D
    Because i saw codes like this "if(@IsLegend = 2) begin" , and in education LEGEND is 0 not 2...
    I'm confused.

  12. #12
    Enthusiast fil22t is offline
    MemberRank
    Jun 2011 Join Date
    43Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    Because from CODE
    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
    Set New Item but Legend Account don't set new item

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

    Re: [TUT] VIP dont drop items at death - fil22t

    ## Edit New Account to Survivor Package (2)

    WZ_ACCOUNT_CREATE

    Code:
    -- create all needed user tables
    	INSERT INTO UsersData (
    		CustomerID,
    		AccountType,
    		dateregistered,
    		IsPunisher
    	) VALUES (
    	 @CustomerID,
    		'2', -- Survivor Package
    		GETDATE(),
    		'0'
    	)

  14. #14
    Novice Teuzhaun is offline
    MemberRank
    Jun 2009 Join Date
    3Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    Oh thanks, nice function!! :DD

  15. #15
    Apprentice sintaxbr is offline
    MemberRank
    Nov 2004 Join Date
    BRASILLocation
    22Posts

    Re: [TUT] VIP dont drop items at death - fil22t

    1 - move equiped item to backpack slot
    2 - drop item
    3 - die
    4- logout

    dupe perfect!!



Page 1 of 3 123 LastLast

Advertisement