[Tutorial] Add Premium Reward

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Apprentice Taynam is offline
    MemberRank
    Apr 2011 Join Date
    BrazilLocation
    24Posts

    [Tutorial] Add Premium Reward

    WarZ_Server.sln

    Seach on UserReward.h
    Code:
    enum EPlayerRewardID
    {
    	RWD_ZombieKill		= 1,	//Standard
    		
    	RWD_MAX_REWARD_ID	= 512,
    };
    Replace to this
    Code:
    enum EPlayerRewardID
    {
    	RWD_ZombieKill		= 1,	//Standard
    	RWD_ZombieKillP		= 2,
    		
    	RWD_MAX_REWARD_ID	= 512,
    };
    Search on UserReward.cpp:
    Code:
    void CGameRewards::InitDefaultRewards()
    {
    	// HERE is COPY-PASTED CODE FROM ExportDefaultRewards()
    	// USED FOR SERVER
    	SetReward(1, "ZombieKill", 5, 5, 10, 10);
    }
    Replace to this
    Code:
    void CGameRewards::InitDefaultRewards()
    {
    	// HERE is COPY-PASTED CODE FROM ExportDefaultRewards()
    	// USED FOR SERVER
    
    	SetReward(1, "ZombieKill", 10, 10, 10, 10);
    	SetReward(2, "ZombieKillP", 15, 15, 15, 15);
    }
    Search on sobj_Zombie.cpp
    Code:
            gServerLogic.AddPlayerReward(plr, RWD_ZombieKill);
    Replace to this
    Code:
    if(plr->profile_.ProfileData.isPunisher)
    {
    	gServerLogic.AddPlayerReward(plr, RWD_ZombieKillP);
    }
    else
    {
    	gServerLogic.AddPlayerReward(plr, RWD_ZombieKill);
    }


  2. #2
    Member promedans is offline
    MemberRank
    Apr 2014 Join Date
    60Posts

    Re: [Tutorial] Add Premium Reward

    good job mate :)

  3. #3
    Valued Member DarkAngelBR is offline
    MemberRank
    Mar 2013 Join Date
    My HouseLocation
    140Posts

    Re: [Tutorial] Add Premium Reward

    haha, i made that some minutes before you post xD, thanks anyway

  4. #4
    Apprentice Taynam is offline
    MemberRank
    Apr 2011 Join Date
    BrazilLocation
    24Posts

    Re: [Tutorial] Add Premium Reward

    Quote Originally Posted by DarkAngelBR View Post
    haha, i made that some minutes before you post xD, thanks anyway
    lol, xD
    Last edited by Taynam; 22-05-14 at 03:23 AM.

  5. #5
    French Guy :D skyone is offline
    MemberRank
    Nov 2013 Join Date
    254Posts

    Re: [Tutorial] Add Premium Reward

    Thanks for sharing :p

    2 error for me ^^

    http://puu.sh/8W30G.png

  6. #6
    Apprentice Taynam is offline
    MemberRank
    Apr 2011 Join Date
    BrazilLocation
    24Posts

    Re: [Tutorial] Add Premium Reward

    Quote Originally Posted by skyone View Post
    Thanks for sharing :p

    2 error for me ^^

    http://puu.sh/8W30G.png
    You use AllRight Source?
    If you use, change the following lines


    Change
    Code:
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKillP);
    to
    Code:
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKillP, 0);
    and
    Code:
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKill);
    to
    Code:
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKill, 0);

  7. #7
    Valued Member pablos1234 is offline
    MemberRank
    Jan 2014 Join Date
    London, UnitedLocation
    124Posts

    Re: [Tutorial] Add Premium Reward

    gServerLogic.AddPlayerReward(plr, RWD_ZombieKill);

    i cant find this anywhere i have dnc new source...

  8. #8
    Account Upgraded | Title Enabled! KidJB is offline
    MemberRank
    Oct 2009 Join Date
    Topeka, KansasLocation
    291Posts

    Re: [Tutorial] Add Premium Reward

    For DNC Source its directly after this

    Code:
    		if(fromObj->Class->Name == "obj_ServerPlayer")
    		{
    			obj_ServerPlayer* plr = (obj_ServerPlayer*)fromObj;
    And should look like this.


    Code:
    		if(fromObj->Class->Name == "obj_ServerPlayer")
    		{
    			obj_ServerPlayer* plr = (obj_ServerPlayer*)fromObj;
    if(plr->profile_.ProfileData.isPunisher)
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKillP, 0);
    }
    else
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKill, 0);
    }

  9. #9
    Account Upgraded | Title Enabled! AlexRedd is offline
    MemberRank
    Jan 2014 Join Date
    310Posts

    Re: [Tutorial] Add Premium Reward

    Not work in New Community Edition (Last Version) by DNC. Verify please
    maybe need to change isPunisher - isPremium?
    Code:
    if(fromObj->Class->Name == "obj_ServerPlayer")
    		{
    			obj_ServerPlayer* plr = (obj_ServerPlayer*)fromObj;
    if(plr->profile_.ProfileData.isPremium)
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKillP, 0);
    }
    else
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKill, 0);
    }
    Last edited by AlexRedd; 28-05-14 at 05:42 PM.

  10. #10
    Apprentice Taynam is offline
    MemberRank
    Apr 2011 Join Date
    BrazilLocation
    24Posts

    Re: [Tutorial] Add Premium Reward

    Quote Originally Posted by AlexRedd View Post
    Not work in New Community Edition (Last Version) by DNC. Verify please
    maybe need to change isPunisher - isPremium?
    Code:
    if(fromObj->Class->Name == "obj_ServerPlayer")
    		{
    			obj_ServerPlayer* plr = (obj_ServerPlayer*)fromObj;
    if(plr->profile_.ProfileData.isPremium)
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKillP, 0);
    }
    else
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKill, 0);
    }
    Yeap, new DNC Source does not work with isPunisher, it works with isPremium

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

    Re: [Tutorial] Add Premium Reward

    thank you


    if(fromObj->Class->Name == "obj_ServerPlayer")
    {
    obj_ServerPlayer* plr = (obj_ServerPlayer*)fromObj;
    if (plr->profile_.ProfileData.isPremium) // premium reward
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKillP, 0);
    }
    else
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKill, 0);
    }


    if (plr->loadout_->Mission1 == 2)

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

    Re: [Tutorial] Add Premium Reward

    for DNC

    ProfileData.isPremium

  13. #13
    Valued Member erickstyle is offline
    MemberRank
    Sep 2008 Join Date
    Santo André, BLocation
    104Posts

    Re: [Tutorial] Add Premium Reward

    @javaz97 how to add "gServerLogic.AddPlayerReward(plr, RWD_SZombieKill);" in your code?




    Code:
    if(fromObj->Class->Name == "obj_ServerPlayer")
    {
    obj_ServerPlayer* plr = (obj_ServerPlayer*)fromObj;
    if (plr->profile_.ProfileData.isPremium) // premium reward
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKillP, 0);
    }
    else
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKill, 0);
    }

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

    Re: [Tutorial] Add Premium Reward

    for dnc only

    WZ\src\server\WO_GameServer\Sources\ObjectsCode\Zombies\sobj_Zombie.cpp

    gServerLogic.AddPlayerReward(plr, RWD_ZombieKillP, 0);

  15. #15
    Valued Member erickstyle is offline
    MemberRank
    Sep 2008 Join Date
    Santo André, BLocation
    104Posts

    Re: [Tutorial] Add Premium Reward

    @javaz97

    but I wanted to keep the other two rewards and add more this


    if(fromObj->Class->Name == "obj_ServerPlayer")
    {
    obj_ServerPlayer* plr = (obj_ServerPlayer*)fromObj;
    if (plr->profile_.ProfileData.isPremium) // premium reward
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKillP, 0);
    }
    else
    {
    gServerLogic.AddPlayerReward(plr, RWD_ZombieKill, 0);
    }
    else
    {
    gServerLogic.AddPlayerReward(plr, RWD_SZombieKill, 0);
    }

    this way?


    sorry for google translator
    Last edited by erickstyle; 18-06-14 at 01:11 AM.



Page 1 of 2 12 LastLast

Advertisement