Core/Achievements: Implement many new ModifierTree types

Port From (https://github.com/TrinityCore/TrinityCore/commit/aa8ad4d2fd6144fca3b69261a90a663df682e571)
This commit is contained in:
hondacrx
2019-11-18 13:53:45 -05:00
parent bd8303f42c
commit 12c007a8a1
12 changed files with 1365 additions and 100 deletions
@@ -566,7 +566,11 @@ namespace Game.Achievements
public bool ModifierTreeSatisfied(uint modifierTreeId)
{
return AdditionalRequirementsSatisfied(Global.CriteriaMgr.GetModifierTree(modifierTreeId), 0, 0, null, _owner);
ModifierTreeNode modifierTree = Global.CriteriaMgr.GetModifierTree(modifierTreeId);
if (modifierTree != null)
return ModifierTreeSatisfied(modifierTree, 0, 0, null, _owner);
return false;
}
public override void SendCriteriaUpdate(Criteria criteria, CriteriaProgress progress, uint timeElapsed, bool timedCompleted)
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1674,7 +1674,7 @@ namespace Game
return result;
}
static uint GetPlayerConditionLfgValue(Player player, PlayerConditionLfgStatus status)
public static uint GetPlayerConditionLfgValue(Player player, PlayerConditionLfgStatus status)
{
Group group = player.GetGroup();
if (group = null)
+10 -1
View File
@@ -28,7 +28,7 @@ namespace Game.Entities
{
public class AzeriteItem : Item
{
AzeriteItemData m_azeriteItemData;
public AzeriteItemData m_azeriteItemData;
public AzeriteItem()
{
@@ -208,6 +208,15 @@ namespace Game.Entities
owner.SendPacket(xpGain);
}
public SelectedAzeriteEssences GetSelectedAzeriteEssences()
{
foreach (SelectedAzeriteEssences essences in m_azeriteItemData.SelectedEssences)
if (essences.Enabled != 0)
return essences;
return null;
}
public override void BuildValuesCreate(WorldPacket data, Player target)
{
UpdateFieldFlag flags = GetUpdateFieldFlagsFor(target);
@@ -263,6 +263,11 @@ namespace Game.Entities
_updateMask[block] &= ~(uint)UpdateMask.GetBlockFlag(index);
}
public bool Empty()
{
return _values.Empty();
}
public int Size()
{
return _values.Count;
@@ -656,9 +656,9 @@ namespace Game.Entities
public class SelectedAzeriteEssences : BaseUpdateData<AzeriteItem>
{
UpdateField<uint> SpecializationID = new UpdateField<uint>(0, 1);
UpdateField<uint> Enabled = new UpdateField<uint>(0, 2);
UpdateFieldArray<uint> AzeriteEssenceID = new UpdateFieldArray<uint>(3, 3, 4);
public UpdateField<uint> SpecializationID = new UpdateField<uint>(0, 1);
public UpdateField<uint> Enabled = new UpdateField<uint>(0, 2);
public UpdateFieldArray<uint> AzeriteEssenceID = new UpdateFieldArray<uint>(3, 3, 4);
public SelectedAzeriteEssences() : base(7) { }
+2 -1
View File
@@ -585,6 +585,7 @@ namespace Game.Entities
case TypeId.Item:
case TypeId.Container:
case TypeId.AzeriteItem:
case TypeId.AzeriteEmpoweredItem:
{
Item item = (Item)questGiver;
Global.ScriptMgr.OnQuestAccept(this, item, quest);
@@ -1122,7 +1123,7 @@ namespace Game.Entities
}
if (quest.QuestSortID > 0)
UpdateCriteria(CriteriaTypes.CompleteQuestsInZone, (ulong)quest.QuestSortID);
UpdateCriteria(CriteriaTypes.CompleteQuestsInZone, quest.Id);
UpdateCriteria(CriteriaTypes.CompleteQuestCount);
UpdateCriteria(CriteriaTypes.CompleteQuest, quest.Id);
+7
View File
@@ -1392,6 +1392,13 @@ namespace Game.Entities
return playerCurrency.WeeklyQuantity;
}
public uint GetTrackedCurrencyCount(uint id)
{
if (!_currencyStorage.ContainsKey(id))
return 0;
return _currencyStorage[id].TrackedQuantity;
}
//Action Buttons - CUF Profile
public void SaveCUFProfile(byte id, CUFProfile profile) { _CUFProfiles[id] = profile; }
+14 -5
View File
@@ -25,6 +25,7 @@ using Game.Maps;
using Game.Network.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Game.Garrisons
{
@@ -301,8 +302,8 @@ namespace Game.Garrisons
return _owner.GetTeam() == Team.Horde ? GarrisonFactionIndex.Horde : GarrisonFactionIndex.Alliance;
}
GarrisonType GetGarrisonType() { return GarrisonType.Garrison; }
GarrSiteLevelRecord GetSiteLevel() { return _siteLevel; }
public GarrisonType GetGarrisonType() { return GarrisonType.Garrison; }
public GarrSiteLevelRecord GetSiteLevel() { return _siteLevel; }
public ICollection<Plot> GetPlots()
{
@@ -314,7 +315,7 @@ namespace Game.Garrisons
return _plots.LookupByKey(garrPlotInstanceId);
}
bool HasBlueprint(uint garrBuildingId) { return _knownBuildings.Contains(garrBuildingId); }
public bool HasBlueprint(uint garrBuildingId) { return _knownBuildings.Contains(garrBuildingId); }
public void LearnBlueprint(uint garrBuildingId)
{
@@ -519,7 +520,7 @@ namespace Game.Garrisons
return _followers.LookupByKey(dbId);
}
uint CountFollowers(Predicate<Follower> predicate)
public uint CountFollowers(Predicate<Follower> predicate)
{
uint count = 0;
foreach (var pair in _followers)
@@ -868,12 +869,20 @@ namespace Game.Garrisons
public class Follower
{
public GarrisonFollower PacketInfo = new GarrisonFollower();
public uint GetItemLevel()
{
return (PacketInfo.ItemLevelWeapon + PacketInfo.ItemLevelArmor) / 2;
}
public GarrisonFollower PacketInfo = new GarrisonFollower();
public bool HasAbility(uint garrAbilityId)
{
return PacketInfo.AbilityID.Any(garrAbility =>
{
return garrAbility.Id == garrAbilityId;
});
}
}
}
}
+6 -1
View File
@@ -140,6 +140,11 @@ namespace Game.Scenarios
return true;
}
public ScenarioRecord GetEntry()
{
return _data.Entry;
}
ScenarioStepState GetStepState(ScenarioStepRecord step)
{
if (!_stepStates.ContainsKey(step))
@@ -334,7 +339,7 @@ namespace Game.Scenarios
public virtual void Update(uint diff) { }
public void SetStepState(ScenarioStepRecord step, ScenarioStepState state) { _stepStates[step] = state; }
ScenarioStepRecord GetStep()
public ScenarioStepRecord GetStep()
{
return _currentstep;
}