[Tutorial] Super Zombie XP Drop

Joined
Jun 30, 2013
Messages
421
Reaction score
157
Hello Community)) I want to tell you how to do so would be for the murder of super zombies give you more experience than the usual zombie))) (Only InvasionMMO Source)
Example:
Super Zombie Kill = 20 XP
Zombie Kill = 5 XP
So, let's begin:​
Open WarZ_Server.sln
Search: (UserRewards.h)
enum EPlayerRewardID

Look at it:

enum EPlayerRewardID
{
RWD_ZombieKill = 1, //Standard Zombie


RWD_MAX_REWARD_ID = 512,

};


Add this:
enum EPlayerRewardID
{
RWD_ZombieKill = 1, //Standard Zombie RWD
RWD_SZombieKill = 2, // Super Zombie RWD


RWD_MAX_REWARD_ID = 512,
};


Search: (sobj_Zombie.cpp)

if(SZombieHealth <= 0.0f)
Find something like this:
if(HeroItemID == Super_Zombie)
{
if(SZombieHealth <= 0.0f)
{
DoDeath();


if(fromObj->Class->Name == "obj_ServerPlayer")
{
obj_ServerPlayer* plr = (obj_ServerPlayer*)fromObj;
}
return true;
}
Add an extra line like this:
if(HeroItemID == Super_Zombie)
{
if(SZombieHealth <= 0.0f)
{
DoDeath();


if(fromObj->Class->Name == "obj_ServerPlayer")
{
obj_ServerPlayer* plr = (obj_ServerPlayer*)fromObj;
gServerLogic.AddPlayerReward(plr, RWD_SZombieKill);
}
return true;
}

Open WarZ.sln
Search: (UserRewards.cpp)
void CGameRewards::InitDefaultRewards()

Create one like this:
void CGameRewards::InitDefaultRewards()
{
// HERE is COPY-PASTED CODE FROM ExportDefaultRewards()
// USED FOR SERVER


SetReward(1, "ZombieKill", 2, 2, 5, 5);
SetReward(2, "SZombieKill", 19, 19, 30, 30);
}
Compile Client and Server..........
 
Back