Core/Talents: Fixes learning pvp talents
This commit is contained in:
@@ -329,13 +329,13 @@ namespace Game.Entities
|
|||||||
for (byte i = 0; i < PlayerConst.MaxSpecializations; ++i)
|
for (byte i = 0; i < PlayerConst.MaxSpecializations; ++i)
|
||||||
{
|
{
|
||||||
Talents[i] = new Dictionary<uint, PlayerSpellState>();
|
Talents[i] = new Dictionary<uint, PlayerSpellState>();
|
||||||
PvpTalents[i] = new Array<uint>(PlayerConst.MaxPvpTalentSlots, 0);
|
PvpTalents[i] = new uint[PlayerConst.MaxPvpTalentSlots];
|
||||||
Glyphs[i] = new List<uint>();
|
Glyphs[i] = new List<uint>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<uint, PlayerSpellState>[] Talents = new Dictionary<uint, PlayerSpellState>[PlayerConst.MaxSpecializations];
|
public Dictionary<uint, PlayerSpellState>[] Talents = new Dictionary<uint, PlayerSpellState>[PlayerConst.MaxSpecializations];
|
||||||
public Array<uint>[] PvpTalents = new Array<uint>[PlayerConst.MaxSpecializations];
|
public uint[][] PvpTalents = new uint[PlayerConst.MaxSpecializations][];
|
||||||
public List<uint>[] Glyphs = new List<uint>[PlayerConst.MaxSpecializations];
|
public List<uint>[] Glyphs = new List<uint>[PlayerConst.MaxSpecializations];
|
||||||
public uint ResetTalentsCost;
|
public uint ResetTalentsCost;
|
||||||
public long ResetTalentsTime;
|
public long ResetTalentsTime;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ using Game.PvP;
|
|||||||
using Game.Spells;
|
using Game.Spells;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Game.Entities
|
namespace Game.Entities
|
||||||
{
|
{
|
||||||
@@ -416,9 +417,13 @@ namespace Game.Entities
|
|||||||
if (talent.OverridesSpellID != 0)
|
if (talent.OverridesSpellID != 0)
|
||||||
RemoveOverrideSpell(talent.OverridesSpellID, talent.SpellID);
|
RemoveOverrideSpell(talent.OverridesSpellID, talent.SpellID);
|
||||||
|
|
||||||
//todo check this
|
|
||||||
// if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted
|
// if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted
|
||||||
GetPvpTalentMap(GetActiveTalentGroup()).Remove(talent.Id);
|
var talents = GetPvpTalentMap(GetActiveTalentGroup());
|
||||||
|
for (var i = 0; i < PlayerConst.MaxPvpTalentSlots; ++i)
|
||||||
|
{
|
||||||
|
if (talents[i] == talent.Id)
|
||||||
|
talents[i] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TogglePvpTalents(bool enable)
|
public void TogglePvpTalents(bool enable)
|
||||||
@@ -520,7 +525,7 @@ namespace Game.Entities
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Array<uint> GetPvpTalentMap(byte spec) { return _specializationInfo.PvpTalents[spec]; }
|
public uint[] GetPvpTalentMap(byte spec) { return _specializationInfo.PvpTalents[spec]; }
|
||||||
|
|
||||||
//BGs
|
//BGs
|
||||||
public Battleground GetBattleground()
|
public Battleground GetBattleground()
|
||||||
|
|||||||
@@ -603,13 +603,16 @@ namespace Game.Entities
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
groupInfoPkt.PvPTalentIDs.Add((ushort)pvpTalents[slot]);
|
PvPTalent pvpTalent = new PvPTalent();
|
||||||
|
pvpTalent.PvPTalentID = (ushort)pvpTalents[slot];
|
||||||
|
pvpTalent.Slot = slot;
|
||||||
|
groupInfoPkt.PvPTalents.Add(pvpTalent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == GetActiveTalentGroup())
|
if (i == GetActiveTalentGroup())
|
||||||
packet.Info.ActiveGroup = (byte)packet.Info.TalentGroups.Count;
|
packet.Info.ActiveGroup = (byte)packet.Info.TalentGroups.Count;
|
||||||
|
|
||||||
if (!groupInfoPkt.TalentIDs.Empty() || !groupInfoPkt.PvPTalentIDs.Empty() || i == GetActiveTalentGroup())
|
if (!groupInfoPkt.TalentIDs.Empty() || !groupInfoPkt.PvPTalents.Empty() || i == GetActiveTalentGroup())
|
||||||
packet.Info.TalentGroups.Add(groupInfoPkt);
|
packet.Info.TalentGroups.Add(groupInfoPkt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,13 +35,13 @@ namespace Game.Networking.Packets
|
|||||||
{
|
{
|
||||||
_worldPacket.WriteUInt32(talentGroupInfo.SpecID);
|
_worldPacket.WriteUInt32(talentGroupInfo.SpecID);
|
||||||
_worldPacket.WriteInt32(talentGroupInfo.TalentIDs.Count);
|
_worldPacket.WriteInt32(talentGroupInfo.TalentIDs.Count);
|
||||||
_worldPacket.WriteInt32(talentGroupInfo.PvPTalentIDs.Count);
|
_worldPacket.WriteInt32(talentGroupInfo.PvPTalents.Count);
|
||||||
|
|
||||||
foreach (var talentID in talentGroupInfo.TalentIDs)
|
foreach (var talentID in talentGroupInfo.TalentIDs)
|
||||||
_worldPacket.WriteUInt16(talentID);
|
_worldPacket.WriteUInt16(talentID);
|
||||||
|
|
||||||
foreach (ushort talentID in talentGroupInfo.PvPTalentIDs)
|
foreach (PvPTalent talent in talentGroupInfo.PvPTalents)
|
||||||
_worldPacket.WriteUInt16(talentID);
|
talent.Write(_worldPacket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ namespace Game.Networking.Packets
|
|||||||
{
|
{
|
||||||
public uint SpecID;
|
public uint SpecID;
|
||||||
public List<ushort> TalentIDs = new List<ushort>();
|
public List<ushort> TalentIDs = new List<ushort>();
|
||||||
public List<ushort> PvPTalentIDs = new List<ushort>();
|
public List<PvPTalent> PvPTalents = new List<PvPTalent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TalentInfoUpdate
|
public class TalentInfoUpdate
|
||||||
|
|||||||
Reference in New Issue
Block a user