Core/Spells: implement SpellAuraInterruptFlags2::ChangeSpec
This commit is contained in:
1 parent
4c870d1e88
commit
6dedecfeac
3 files changed
+12
-2
No files matched your search
@@ -3533,6 +3533,9 @@ bool Player::ResetTalents(bool no_cost)
|
||||
SetPrimaryTalentTree(GetActiveSpec(), 0);
|
||||
SetFreeTalentPoints(talentPointsForLevel);
|
||||
|
||||
// We consider resetting talents as changing a specialization as well as we now can pick an entirely new primary talent tree which equals changing specs
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2::ChangeSpec);
|
||||
|
||||
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
_SaveTalents(trans);
|
||||
_SaveSpells(trans);
|
||||
@@ -28220,6 +28223,13 @@ void Player::SendRaidGroupOnlyMessage(RaidGroupReason reason, int32 delay) const
|
||||
SendDirectMessage(raidGroupOnly.Write());
|
||||
}
|
||||
|
||||
void Player::SetActiveSpec(uint8 spec)
|
||||
{
|
||||
_talentMgr->ActiveSpec = spec;
|
||||
UpdateArmorSpecialization();
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2::ChangeSpec);
|
||||
}
|
||||
|
||||
void Player::SetRestFlag(RestFlag restFlag, uint32 triggerId /*= 0*/)
|
||||
{
|
||||
uint32 oldRestMask = _restFlagMask;
|
||||
|
||||
@@ -1609,7 +1609,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
uint32 GetPrimaryTalentTree(uint8 spec) const { return _talentMgr->SpecInfo[spec].TalentTree; }
|
||||
void SetPrimaryTalentTree(uint8 spec, uint32 tree) { _talentMgr->SpecInfo[spec].TalentTree = tree; UpdateArmorSpecialization(); }
|
||||
uint8 GetActiveSpec() const { return _talentMgr->ActiveSpec; }
|
||||
void SetActiveSpec(uint8 spec){ _talentMgr->ActiveSpec = spec; UpdateArmorSpecialization(); }
|
||||
void SetActiveSpec(uint8 spec);
|
||||
uint8 GetSpecsCount() const { return _talentMgr->SpecsCount; }
|
||||
void SetSpecsCount(uint8 count) { _talentMgr->SpecsCount = count; }
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ enum class SpellAuraInterruptFlags2 : uint32
|
||||
Ground = 0x00000008,
|
||||
Transform = 0x00000010, // NYI
|
||||
Jump = 0x00000020,
|
||||
ChangeSpec = 0x00000040, // NYI
|
||||
ChangeSpec = 0x00000040,
|
||||
AbandonVehicle = 0x00000080, // NYI
|
||||
StartOfEncounter = 0x00000100, // NYI
|
||||
EndOfEncounter = 0x00000200, // NYI
|
||||
|
||||
Reference in new issue
Block a user