mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7170] Implement special default skill levels for created DK character.
This commit is contained in:
parent
f88696d31d
commit
521c8bc31b
3 changed files with 59 additions and 35 deletions
|
|
@ -14389,24 +14389,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||||
SetUInt32Value(PLAYER_TRACK_CREATURES, 0 );
|
SetUInt32Value(PLAYER_TRACK_CREATURES, 0 );
|
||||||
SetUInt32Value(PLAYER_TRACK_RESOURCES, 0 );
|
SetUInt32Value(PLAYER_TRACK_RESOURCES, 0 );
|
||||||
|
|
||||||
// reset skill modifiers and set correct unlearn flags
|
_LoadSkills();
|
||||||
for (uint32 i = 0; i < PLAYER_MAX_SKILLS; i++)
|
|
||||||
{
|
|
||||||
SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(i),0);
|
|
||||||
|
|
||||||
// set correct unlearn bit
|
|
||||||
uint32 id = GetUInt32Value(PLAYER_SKILL_INDEX(i)) & 0x0000FFFF;
|
|
||||||
if(!id) continue;
|
|
||||||
|
|
||||||
SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(id);
|
|
||||||
if(!pSkill) continue;
|
|
||||||
|
|
||||||
// enable unlearn button for primary professions only
|
|
||||||
if (pSkill->categoryId == SKILL_CATEGORY_PROFESSION)
|
|
||||||
SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id,1));
|
|
||||||
else
|
|
||||||
SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id,0));
|
|
||||||
}
|
|
||||||
|
|
||||||
// make sure the unit is considered out of combat for proper loading
|
// make sure the unit is considered out of combat for proper loading
|
||||||
ClearInCombat();
|
ClearInCombat();
|
||||||
|
|
@ -14447,7 +14430,6 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||||
|
|
||||||
// after spell and quest load
|
// after spell and quest load
|
||||||
InitTalentForLevel();
|
InitTalentForLevel();
|
||||||
learnSkillRewardedSpells();
|
|
||||||
learnDefaultSpells();
|
learnDefaultSpells();
|
||||||
|
|
||||||
_LoadTutorials(holder->GetResult(PLAYER_LOGIN_QUERY_LOADTUTORIALS));
|
_LoadTutorials(holder->GetResult(PLAYER_LOGIN_QUERY_LOADTUTORIALS));
|
||||||
|
|
@ -18360,20 +18342,6 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::learnSkillRewardedSpells()
|
|
||||||
{
|
|
||||||
for (uint16 i=0; i < PLAYER_MAX_SKILLS; i++)
|
|
||||||
{
|
|
||||||
if(!GetUInt32Value(PLAYER_SKILL_INDEX(i)))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
uint32 pskill = SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_INDEX(i)));
|
|
||||||
uint32 vskill = SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i)));
|
|
||||||
|
|
||||||
learnSkillRewardedSpells(pskill, vskill);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Player::SendAurasForTarget(Unit *target)
|
void Player::SendAurasForTarget(Unit *target)
|
||||||
{
|
{
|
||||||
if(target->GetVisibleAuras()->empty()) // speedup things
|
if(target->GetVisibleAuras()->empty()) // speedup things
|
||||||
|
|
@ -19495,3 +19463,58 @@ void Player::learnSpellHighRank(uint32 spellid)
|
||||||
learnSpellHighRank(itr->second);
|
learnSpellHighRank(itr->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::_LoadSkills()
|
||||||
|
{
|
||||||
|
// Note: skill data itself loaded from `data` field. This is only cleanup part of load
|
||||||
|
|
||||||
|
// reset skill modifiers and set correct unlearn flags
|
||||||
|
for (uint32 i = 0; i < PLAYER_MAX_SKILLS; i++)
|
||||||
|
{
|
||||||
|
SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(i),0);
|
||||||
|
|
||||||
|
// set correct unlearn bit
|
||||||
|
uint32 id = GetUInt32Value(PLAYER_SKILL_INDEX(i)) & 0x0000FFFF;
|
||||||
|
if(!id) continue;
|
||||||
|
|
||||||
|
SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(id);
|
||||||
|
if(!pSkill) continue;
|
||||||
|
|
||||||
|
// enable unlearn button for primary professions only
|
||||||
|
if (pSkill->categoryId == SKILL_CATEGORY_PROFESSION)
|
||||||
|
SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id,1));
|
||||||
|
else
|
||||||
|
SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id,0));
|
||||||
|
|
||||||
|
uint32 vskill = SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i)));
|
||||||
|
|
||||||
|
learnSkillRewardedSpells(id, vskill);
|
||||||
|
}
|
||||||
|
|
||||||
|
// special settings
|
||||||
|
if(getClass()==CLASS_DEATH_KNIGHT)
|
||||||
|
{
|
||||||
|
uint32 base_level = std::min(getLevel(),sWorld.getConfig (CONFIG_START_HEROIC_PLAYER_LEVEL));
|
||||||
|
if(base_level < 1)
|
||||||
|
base_level = 1;
|
||||||
|
uint32 base_skill = (base_level-1)*5; // 270 at starting level 55
|
||||||
|
if(base_skill < 1)
|
||||||
|
base_skill = 1; // skill mast be known and then > 0 in any case
|
||||||
|
|
||||||
|
if(GetPureSkillValue (SKILL_FIRST_AID) < base_skill)
|
||||||
|
SetSkill(SKILL_FIRST_AID,base_skill, base_skill);
|
||||||
|
if(GetPureSkillValue (SKILL_AXES) < base_skill)
|
||||||
|
SetSkill(SKILL_AXES, base_skill,base_skill);
|
||||||
|
if(GetPureSkillValue (SKILL_DEFENSE) < base_skill)
|
||||||
|
SetSkill(SKILL_DEFENSE, base_skill,base_skill);
|
||||||
|
if(GetPureSkillValue (SKILL_POLEARMS) < base_skill)
|
||||||
|
SetSkill(SKILL_POLEARMS, base_skill,base_skill);
|
||||||
|
if(GetPureSkillValue (SKILL_SWORDS) < base_skill)
|
||||||
|
SetSkill(SKILL_SWORDS, base_skill,base_skill);
|
||||||
|
if(GetPureSkillValue (SKILL_2H_AXES) < base_skill)
|
||||||
|
SetSkill(SKILL_2H_AXES, base_skill,base_skill);
|
||||||
|
if(GetPureSkillValue (SKILL_2H_SWORDS) < base_skill)
|
||||||
|
SetSkill(SKILL_2H_SWORDS, base_skill,base_skill);
|
||||||
|
if(GetPureSkillValue (SKILL_UNARMED) < base_skill)
|
||||||
|
SetSkill(SKILL_UNARMED, base_skill,base_skill);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1343,6 +1343,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
|
|
||||||
bool LoadFromDB(uint32 guid, SqlQueryHolder *holder);
|
bool LoadFromDB(uint32 guid, SqlQueryHolder *holder);
|
||||||
|
|
||||||
bool MinimalLoadFromDB(QueryResult *result, uint32 guid);
|
bool MinimalLoadFromDB(QueryResult *result, uint32 guid);
|
||||||
static bool LoadValuesArrayFromDB(Tokens& data,uint64 guid);
|
static bool LoadValuesArrayFromDB(Tokens& data,uint64 guid);
|
||||||
static uint32 GetUInt32ValueFromArray(Tokens const& data, uint16 index);
|
static uint32 GetUInt32ValueFromArray(Tokens const& data, uint16 index);
|
||||||
|
|
@ -1773,7 +1774,6 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
int16 GetSkillTempBonusValue(uint32 skill) const;
|
int16 GetSkillTempBonusValue(uint32 skill) const;
|
||||||
bool HasSkill(uint32 skill) const;
|
bool HasSkill(uint32 skill) const;
|
||||||
void learnSkillRewardedSpells(uint32 id, uint32 value);
|
void learnSkillRewardedSpells(uint32 id, uint32 value);
|
||||||
void learnSkillRewardedSpells();
|
|
||||||
|
|
||||||
void SetDontMove(bool dontMove);
|
void SetDontMove(bool dontMove);
|
||||||
bool GetDontMove() const { return m_dontMove; }
|
bool GetDontMove() const { return m_dontMove; }
|
||||||
|
|
@ -2245,6 +2245,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
void _LoadDailyQuestStatus(QueryResult *result);
|
void _LoadDailyQuestStatus(QueryResult *result);
|
||||||
void _LoadGroup(QueryResult *result);
|
void _LoadGroup(QueryResult *result);
|
||||||
void _LoadReputation(QueryResult *result);
|
void _LoadReputation(QueryResult *result);
|
||||||
|
void _LoadSkills();
|
||||||
void _LoadSpells(QueryResult *result);
|
void _LoadSpells(QueryResult *result);
|
||||||
void _LoadTutorials(QueryResult *result);
|
void _LoadTutorials(QueryResult *result);
|
||||||
void _LoadFriendList(QueryResult *result);
|
void _LoadFriendList(QueryResult *result);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7169"
|
#define REVISION_NR "7170"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue