mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-03 19:13:49 +00:00
feat(Core/Config): Added pet experience rate (#3703)
This commit is contained in:
@@ -23,8 +23,6 @@
|
|||||||
#include "InstanceScript.h"
|
#include "InstanceScript.h"
|
||||||
#include "ArenaSpectator.h"
|
#include "ArenaSpectator.h"
|
||||||
|
|
||||||
#define PET_XP_FACTOR 0.05f
|
|
||||||
|
|
||||||
Pet::Pet(Player* owner, PetType type) : Guardian(nullptr, owner ? owner->GetGUID() : 0, true),
|
Pet::Pet(Player* owner, PetType type) : Guardian(nullptr, owner ? owner->GetGUID() : 0, true),
|
||||||
m_usedTalentCount(0), m_removed(false), m_owner(owner),
|
m_usedTalentCount(0), m_removed(false), m_owner(owner),
|
||||||
m_happinessTimer(PET_LOSE_HAPPINES_INTERVAL), m_petType(type), m_duration(0),
|
m_happinessTimer(PET_LOSE_HAPPINES_INTERVAL), m_petType(type), m_duration(0),
|
||||||
@@ -585,6 +583,8 @@ void Pet::GivePetXP(uint32 xp)
|
|||||||
if (getPetType() != HUNTER_PET)
|
if (getPetType() != HUNTER_PET)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
xp *= sWorld->getRate(RATE_XP_PET);
|
||||||
|
|
||||||
if (xp < 1)
|
if (xp < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -625,7 +625,7 @@ void Pet::GivePetLevel(uint8 level)
|
|||||||
if (getPetType() == HUNTER_PET)
|
if (getPetType() == HUNTER_PET)
|
||||||
{
|
{
|
||||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(level)*PET_XP_FACTOR));
|
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(level)*sWorld->getRate(RATE_XP_PET_NEXT_LEVEL)));
|
||||||
}
|
}
|
||||||
|
|
||||||
InitStatsForLevel(level);
|
InitStatsForLevel(level);
|
||||||
@@ -694,7 +694,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phas
|
|||||||
setPowerType(POWER_FOCUS);
|
setPowerType(POWER_FOCUS);
|
||||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
|
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
|
||||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(getLevel() + 1)*PET_XP_FACTOR));
|
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(getLevel() + 1)* sWorld->getRate(RATE_XP_PET_NEXT_LEVEL)));
|
||||||
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||||
|
|
||||||
if (cinfo->type == CREATURE_TYPE_BEAST)
|
if (cinfo->type == CREATURE_TYPE_BEAST)
|
||||||
@@ -834,7 +834,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
|||||||
{
|
{
|
||||||
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
|
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
|
||||||
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
|
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
|
||||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(petlevel)*PET_XP_FACTOR));
|
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(petlevel)* sWorld->getRate(RATE_XP_PET_NEXT_LEVEL)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SUMMON_PET:
|
case SUMMON_PET:
|
||||||
|
|||||||
@@ -502,6 +502,8 @@ void World::LoadConfigSettings(bool reload)
|
|||||||
rate_values[RATE_XP_BG_KILL] = sConfigMgr->GetFloatDefault("Rate.XP.BattlegroundKill", 1.0f);
|
rate_values[RATE_XP_BG_KILL] = sConfigMgr->GetFloatDefault("Rate.XP.BattlegroundKill", 1.0f);
|
||||||
rate_values[RATE_XP_QUEST] = sConfigMgr->GetFloatDefault("Rate.XP.Quest", 1.0f);
|
rate_values[RATE_XP_QUEST] = sConfigMgr->GetFloatDefault("Rate.XP.Quest", 1.0f);
|
||||||
rate_values[RATE_XP_EXPLORE] = sConfigMgr->GetFloatDefault("Rate.XP.Explore", 1.0f);
|
rate_values[RATE_XP_EXPLORE] = sConfigMgr->GetFloatDefault("Rate.XP.Explore", 1.0f);
|
||||||
|
rate_values[RATE_XP_PET] = sConfigMgr->GetFloatDefault("Rate.XP.Pet", 1.0f);
|
||||||
|
rate_values[RATE_XP_PET_NEXT_LEVEL] = sConfigMgr->GetFloatDefault("Rate.Pet.LevelXP", 0.05f);
|
||||||
rate_values[RATE_REPAIRCOST] = sConfigMgr->GetFloatDefault("Rate.RepairCost", 1.0f);
|
rate_values[RATE_REPAIRCOST] = sConfigMgr->GetFloatDefault("Rate.RepairCost", 1.0f);
|
||||||
|
|
||||||
rate_values[RATE_SELLVALUE_ITEM_POOR] = sConfigMgr->GetFloatDefault("Rate.SellValue.Item.Poor", 1.0f);
|
rate_values[RATE_SELLVALUE_ITEM_POOR] = sConfigMgr->GetFloatDefault("Rate.SellValue.Item.Poor", 1.0f);
|
||||||
|
|||||||
@@ -420,6 +420,8 @@ enum Rates
|
|||||||
RATE_XP_BG_KILL,
|
RATE_XP_BG_KILL,
|
||||||
RATE_XP_QUEST,
|
RATE_XP_QUEST,
|
||||||
RATE_XP_EXPLORE,
|
RATE_XP_EXPLORE,
|
||||||
|
RATE_XP_PET,
|
||||||
|
RATE_XP_PET_NEXT_LEVEL,
|
||||||
RATE_REPAIRCOST,
|
RATE_REPAIRCOST,
|
||||||
RATE_REPUTATION_GAIN,
|
RATE_REPUTATION_GAIN,
|
||||||
RATE_REPUTATION_LOWLEVEL_KILL,
|
RATE_REPUTATION_LOWLEVEL_KILL,
|
||||||
|
|||||||
@@ -2392,14 +2392,17 @@ Rate.Drop.Item.ReferencedAmount = 1
|
|||||||
# Rate.XP.Kill
|
# Rate.XP.Kill
|
||||||
# Rate.XP.Quest
|
# Rate.XP.Quest
|
||||||
# Rate.XP.Explore
|
# Rate.XP.Explore
|
||||||
|
# Rate.XP.Pet
|
||||||
# Description: Experience rates (outside battleground)
|
# Description: Experience rates (outside battleground)
|
||||||
# Default: 1 - (Rate.XP.Kill)
|
# Default: 1 - (Rate.XP.Kill)
|
||||||
# 1 - (Rate.XP.Quest)
|
# 1 - (Rate.XP.Quest)
|
||||||
# 1 - (Rate.XP.Explore)
|
# 1 - (Rate.XP.Explore)
|
||||||
|
# 1 - (Rate.XP.Pet)
|
||||||
|
|
||||||
Rate.XP.Kill = 1
|
Rate.XP.Kill = 1
|
||||||
Rate.XP.Quest = 1
|
Rate.XP.Quest = 1
|
||||||
Rate.XP.Explore = 1
|
Rate.XP.Explore = 1
|
||||||
|
Rate.XP.Pet = 1
|
||||||
|
|
||||||
#
|
#
|
||||||
# Rate.XP.BattlegroundKill
|
# Rate.XP.BattlegroundKill
|
||||||
@@ -2516,6 +2519,14 @@ Rate.MoveSpeed = 1
|
|||||||
|
|
||||||
Rate.InstanceResetTime = 1
|
Rate.InstanceResetTime = 1
|
||||||
|
|
||||||
|
#
|
||||||
|
# Rate.Pet.LevelXP
|
||||||
|
# Description: Modifies the amount of experience required to level up a pet.
|
||||||
|
# The lower the rate the less experience is required.
|
||||||
|
# Default: 0.05
|
||||||
|
#
|
||||||
|
Rate.Pet.LevelXP = 0.05
|
||||||
|
|
||||||
#
|
#
|
||||||
# SkillGain.Crafting
|
# SkillGain.Crafting
|
||||||
# SkillGain.Defense
|
# SkillGain.Defense
|
||||||
|
|||||||
Reference in New Issue
Block a user