Core/Artifact Handle Artifact tiers + Artifact unlock (3rd relic bonus)

This commit is contained in:
hondacrx
2018-08-01 14:14:51 -04:00
parent 92481d8d9f
commit ae08c81ce6
19 changed files with 275 additions and 63 deletions
+10 -1
View File
@@ -883,13 +883,22 @@ namespace Framework.Constants
Unk9 = 0x40000000,
}
public enum ArtifactCategory
{
Primary = 1,
Fishing = 2
}
public enum ArtifactPowerFlag : byte
{
Gold = 0x01,
First = 0x02,
NoLinkRequired = 0x02,
Final = 0x04,
ScalesWithNumPowers = 0x08,
DontCountFirstBonusRank = 0x10,
MaxRankWithTier = 0x20,
First = NoLinkRequired | DontCountFirstBonusRank,
}
public enum BattlegroundBracketId // bracketId for level ranges
-1
View File
@@ -1052,7 +1052,6 @@ namespace Framework.Constants
JusticePoints = 395,
ValorPoints = 396,
ApexisCrystals = 823,
ArtifactKnowledge = 1171,
}
public enum PlayerCurrencyState
@@ -67,6 +67,8 @@ namespace Framework.Constants
public const int ArtifactsAllWeaponsGeneralWeaponEquippedPassive = 197886;
public const int MaxArtifactTier = 1;
public const byte MaxHonorLevel = 50;
public const byte LevelMinHonor = 110;
public const uint SpellPvpRulesEnabled = 134735;
@@ -1066,6 +1066,7 @@ namespace Framework.Constants
CurrencyResetInterval,
CurrencyStartApexisCrystals,
CurrencyStartJusticePoints,
CurrencyStartArtifactKnowledge,
DailyQuestResetTimeHour,
DbcEnforceItemAttributes,
DeathBonesBgOrArena,
@@ -180,8 +180,8 @@ namespace Framework.Database
"spellItemEnchantmentAllSpecs, spellItemEnchantmentSpec1, spellItemEnchantmentSpec2, spellItemEnchantmentSpec3, spellItemEnchantmentSpec4) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
PrepareStatement(CharStatements.DEL_ITEM_INSTANCE_TRANSMOG, "DELETE FROM item_instance_transmog WHERE itemGuid = ?");
PrepareStatement(CharStatements.DEL_ITEM_INSTANCE_TRANSMOG_BY_OWNER, "DELETE iit FROM item_instance_transmog iit LEFT JOIN item_instance ii ON iit.itemGuid = ii.guid WHERE ii.owner_guid = ?");
PrepareStatement(CharStatements.SEL_ITEM_INSTANCE_ARTIFACT, "SELECT a.itemGuid, a.xp, a.artifactAppearanceId, ap.artifactPowerId, ap.purchasedRank FROM item_instance_artifact_powers ap LEFT JOIN item_instance_artifact a ON ap.itemGuid = a.itemGuid INNER JOIN character_inventory ci ON ci.item = ap.itemGuid WHERE ci.guid = ?");
PrepareStatement(CharStatements.INS_ITEM_INSTANCE_ARTIFACT, "INSERT INTO item_instance_artifact (itemGuid, xp, artifactAppearanceId) VALUES (?, ?, ?)");
PrepareStatement(CharStatements.SEL_ITEM_INSTANCE_ARTIFACT, "SELECT a.itemGuid, a.xp, a.artifactAppearanceId, a.artifactTierId, ap.artifactPowerId, ap.purchasedRank FROM item_instance_artifact_powers ap LEFT JOIN item_instance_artifact a ON ap.itemGuid = a.itemGuid INNER JOIN character_inventory ci ON ci.item = ap.itemGuid WHERE ci.guid = ?");
PrepareStatement(CharStatements.INS_ITEM_INSTANCE_ARTIFACT, "INSERT INTO item_instance_artifact (itemGuid, xp, artifactAppearanceId, artifactTierId) VALUES (?, ?, ?, ?)");
PrepareStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT, "DELETE FROM item_instance_artifact WHERE itemGuid = ?");
PrepareStatement(CharStatements.DEL_ITEM_INSTANCE_ARTIFACT_BY_OWNER, "DELETE iia FROM item_instance_artifact iia LEFT JOIN item_instance ii ON iia.itemGuid = ii.guid WHERE ii.owner_guid = ?");
PrepareStatement(CharStatements.INS_ITEM_INSTANCE_ARTIFACT_POWERS, "INSERT INTO item_instance_artifact_powers (itemGuid, artifactPowerId, purchasedRank) VALUES (?, ?, ?)");
@@ -85,6 +85,14 @@ namespace Framework.Database
PrepareStatement(HotfixStatements.SEL_ARTIFACT_QUEST_XP, "SELECT ID, Difficulty1, Difficulty2, Difficulty3, Difficulty4, Difficulty5, Difficulty6, " +
"Difficulty7, Difficulty8, Difficulty9, Difficulty10 FROM artifact_quest_xp ORDER BY ID DESC");
// ArtifactTier.db2
PrepareStatement(HotfixStatements.SEL_ARTIFACT_TIER, "SELECT ID, ArtifactTier, MaxNumTraits, MaxArtifactKnowledge, KnowledgePlayerCondition, " +
"MinimumEmpowerKnowledge FROM artifact_tier ORDER BY ID DESC");
// ArtifactUnlock.db2
PrepareStatement(HotfixStatements.SEL_ARTIFACT_UNLOCK, "SELECT ID, ItemBonusListID, PowerRank, PowerID, PlayerConditionID, ArtifactID FROM artifact_unlock" +
" ORDER BY ID DESC");
// AuctionHouse.db2
PrepareStatement(HotfixStatements.SEL_AUCTION_HOUSE, "SELECT ID, Name, FactionID, DepositRate, ConsignmentRate FROM auction_house ORDER BY ID DESC");
PrepareStatement(HotfixStatements.SEL_AUCTION_HOUSE_LOCALE, "SELECT ID, Name_lang FROM auction_house_locale WHERE locale = ?");
@@ -1094,6 +1102,10 @@ namespace Framework.Database
SEL_ARTIFACT_QUEST_XP,
SEL_ARTIFACT_TIER,
SEL_ARTIFACT_UNLOCK,
SEL_AUCTION_HOUSE,
SEL_AUCTION_HOUSE_LOCALE,
+4
View File
@@ -50,6 +50,8 @@ namespace Game.DataStorage
ArtifactPowerPickerStorage = DBReader.Read<ArtifactPowerPickerRecord>("ArtifactPowerPicker.db2", HotfixStatements.SEL_ARTIFACT_POWER_PICKER);
ArtifactPowerRankStorage = DBReader.Read<ArtifactPowerRankRecord>("ArtifactPowerRank.db2", HotfixStatements.SEL_ARTIFACT_POWER_RANK);
//ArtifactQuestXPStorage = DBReader.Read<ArtifactQuestXPRecord>("ArtifactQuestXP.db2", HotfixStatements.SEL_ARTIFACT_QUEST_XP);
ArtifactTierStorage = DBReader.Read<ArtifactTierRecord> ("ArtifactTier.db2", HotfixStatements.SEL_ARTIFACT_TIER);
ArtifactUnlockStorage = DBReader.Read<ArtifactUnlockRecord> ("ArtifactUnlock.db2", HotfixStatements.SEL_ARTIFACT_UNLOCK);
AuctionHouseStorage = DBReader.Read<AuctionHouseRecord>("AuctionHouse.db2", HotfixStatements.SEL_AUCTION_HOUSE, HotfixStatements.SEL_AUCTION_HOUSE_LOCALE);
BankBagSlotPricesStorage = DBReader.Read<BankBagSlotPricesRecord>("BankBagSlotPrices.db2", HotfixStatements.SEL_BANK_BAG_SLOT_PRICES);
//BannedAddOnsStorage = DBReader.Read<BannedAddOnsRecord>("BannedAddons.db2", HotfixStatements.SEL_BANNED_ADDONS);
@@ -383,6 +385,8 @@ namespace Game.DataStorage
public static DB6Storage<ArtifactPowerPickerRecord> ArtifactPowerPickerStorage;
public static DB6Storage<ArtifactPowerRankRecord> ArtifactPowerRankStorage;
//public static DB6Storage<ArtifactQuestXPRecord> ArtifactQuestXPStorage;
public static DB6Storage<ArtifactTierRecord> ArtifactTierStorage;
public static DB6Storage<ArtifactUnlockRecord> ArtifactUnlockStorage;
public static DB6Storage<AuctionHouseRecord> AuctionHouseStorage;
public static DB6Storage<BankBagSlotPricesRecord> BankBagSlotPricesStorage;
//public static DB6Storage<BannedAddOnsRecord> BannedAddOnsStorage;
@@ -214,6 +214,26 @@ namespace Game.DataStorage
public uint[] Difficulty = new uint[10];
}
public class ArtifactTierRecord
{
public uint ID;
public uint ArtifactTier;
public uint MaxNumTraits;
public uint MaxArtifactKnowledge;
public uint KnowledgePlayerCondition;
public uint MinimumEmpowerKnowledge;
}
public class ArtifactUnlockRecord
{
public uint ID;
public ushort ItemBonusListID;
public byte PowerRank;
public uint PowerID;
public uint PlayerConditionID;
public byte ArtifactID;
}
public sealed class AuctionHouseRecord
{
public uint Id;
+36 -13
View File
@@ -81,7 +81,7 @@ namespace Game.Entities
{
if (spellInfo.HasEffect(SpellEffectName.GiveArtifactPower))
{
uint artifactKnowledgeLevel = owner.GetCurrency((uint)CurrencyTypes.ArtifactKnowledge);
uint artifactKnowledgeLevel = WorldConfig.GetUIntValue(WorldCfg.CurrencyStartArtifactKnowledge);
if (artifactKnowledgeLevel != 0)
SetModifier(ItemModifier.ArtifactKnowledgeLevel, artifactKnowledgeLevel + 1);
}
@@ -112,6 +112,8 @@ namespace Game.Entities
break;
}
}
CheckArtifactRelicSlotUnlock(owner != null ? owner : GetOwner());
}
return true;
}
@@ -295,6 +297,7 @@ namespace Game.Entities
stmt.AddValue(0, GetGUID().GetCounter());
stmt.AddValue(1, GetUInt64Value(ItemFields.ArtifactXp));
stmt.AddValue(2, GetModifier(ItemModifier.ArtifactAppearanceId));
stmt.AddValue(3, GetModifier(ItemModifier.ArtifactTier));
trans.Append(stmt);
foreach (ItemDynamicFieldArtifactPowers artifactPower in GetArtifactPowers())
@@ -547,11 +550,15 @@ namespace Game.Entities
return true;
}
public void LoadArtifactData(Player owner, ulong xp, uint artifactAppearanceId, List<ItemDynamicFieldArtifactPowers> powers)
public void LoadArtifactData(Player owner, ulong xp, uint artifactAppearanceId, uint artifactTier, List<ItemDynamicFieldArtifactPowers> powers)
{
InitArtifactPowers(GetTemplate().GetArtifactID(), 0);
for (byte i = 0; i <= artifactTier; ++i)
InitArtifactPowers(GetTemplate().GetArtifactID(), i);
SetUInt64Value(ItemFields.ArtifactXp, xp);
SetModifier(ItemModifier.ArtifactAppearanceId, artifactAppearanceId);
SetModifier(ItemModifier.ArtifactTier, artifactTier);
ArtifactAppearanceRecord artifactAppearance = CliDB.ArtifactAppearanceStorage.LookupByKey(artifactAppearanceId);
if (artifactAppearance != null)
SetAppearanceModId(artifactAppearance.ItemAppearanceModifierID);
@@ -612,6 +619,23 @@ namespace Game.Entities
power.CurrentRankWithBonus = (byte)(totalPurchasedRanks + 1);
SetArtifactPower(power);
}
CheckArtifactRelicSlotUnlock(owner != null ? owner : GetOwner());
}
public void CheckArtifactRelicSlotUnlock(Player owner)
{
if (!owner)
return;
byte artifactId = GetTemplate().GetArtifactID();
if (artifactId == 0)
return;
foreach (ArtifactUnlockRecord artifactUnlock in CliDB.ArtifactUnlockStorage.Values)
if (artifactUnlock.ArtifactID == artifactId)
if (owner.MeetPlayerCondition(artifactUnlock.PlayerConditionID))
AddBonuses(artifactUnlock.ItemBonusListID);
}
public static void DeleteFromDB(SQLTransaction trans, ulong itemGuid)
@@ -2194,6 +2218,9 @@ namespace Game.Entities
public void AddBonuses(uint bonusListID)
{
if (HasDynamicValue(ItemDynamicFields.BonusListIds, bonusListID))
return;
var bonuses = Global.DB2Mgr.GetItemBonusList(bonusListID);
if (bonuses != null)
{
@@ -2237,7 +2264,7 @@ namespace Game.Entities
SetDynamicStructuredValue(ItemDynamicFields.ArtifactPowers, index, artifactPower);
}
void InitArtifactPowers(byte artifactId, byte artifactTier)
public void InitArtifactPowers(byte artifactId, byte artifactTier)
{
foreach (ArtifactPowerRecord artifactPower in Global.DB2Mgr.GetArtifactPowers(artifactId))
{
@@ -2250,7 +2277,7 @@ namespace Game.Entities
ItemDynamicFieldArtifactPowers powerData = new ItemDynamicFieldArtifactPowers();
powerData.ArtifactPowerId = artifactPower.Id;
powerData.PurchasedRank = 0;
powerData.CurrentRankWithBonus = (byte)(artifactPower.Flags.HasAnyFlag(ArtifactPowerFlag.First) ? 1 : 0);
powerData.CurrentRankWithBonus = (byte)((artifactPower.Flags & ArtifactPowerFlag.First) == ArtifactPowerFlag.First ? 1 : 0);
SetArtifactPower(powerData, true);
}
}
@@ -2366,22 +2393,19 @@ namespace Game.Entities
SetAppearanceModId(parent.GetAppearanceModId());
}
public void GiveArtifactXp(ulong amount, Item sourceItem, uint artifactCategoryId)
public void GiveArtifactXp(ulong amount, Item sourceItem, ArtifactCategory artifactCategoryId)
{
Player owner = GetOwner();
if (!owner)
return;
if (artifactCategoryId != 0)
{
ArtifactCategoryRecord artifactCategory = CliDB.ArtifactCategoryStorage.LookupByKey(artifactCategoryId);
if (artifactCategory != null)
{
uint artifactKnowledgeLevel = 1;
if (sourceItem && sourceItem.GetModifier(ItemModifier.ArtifactKnowledgeLevel) != 0)
if (sourceItem != null && sourceItem.GetModifier(ItemModifier.ArtifactKnowledgeLevel) != 0)
artifactKnowledgeLevel = sourceItem.GetModifier(ItemModifier.ArtifactKnowledgeLevel);
else
artifactKnowledgeLevel = owner.GetCurrency(artifactCategory.XpMultCurrencyID) + 1;
else if (artifactCategoryId == ArtifactCategory.Primary)
artifactKnowledgeLevel = WorldConfig.GetUIntValue(WorldCfg.CurrencyStartArtifactKnowledge) + 1;
GtArtifactKnowledgeMultiplierRecord artifactKnowledge = CliDB.ArtifactKnowledgeMultiplierGameTable.GetRow(artifactKnowledgeLevel);
if (artifactKnowledge != null)
@@ -2394,7 +2418,6 @@ namespace Game.Entities
else if (amount >= 50)
amount = 5 * (amount / 5);
}
}
SetUInt64Value(ItemFields.ArtifactXp, GetUInt64Value(ItemFields.ArtifactXp) + amount);
@@ -1401,6 +1401,17 @@ namespace Game.Entities
return _dynamicValues[(int)index][offset];
}
public bool HasDynamicValue(object index, uint value)
{
Cypher.Assert((int)index < _dynamicValuesCount || PrintIndexError(index, false));
uint[] values = _dynamicValues[(int)index];
for (var i = 0; i < values.Length; ++i)
if (values[i] == value)
return true;
return false;
}
public void AddDynamicValue(object index, uint value)
{
Cypher.Assert((int)index < _dynamicValuesCount || PrintIndexError(index, true));
+16 -12
View File
@@ -39,28 +39,32 @@ namespace Game.Entities
{
void _LoadInventory(SQLResult result, SQLResult artifactsResult, uint timeDiff)
{
// 0 1 2 3 4
// SELECT a.itemGuid, a.xp, a.artifactAppearanceId, ap.artifactPowerId, ap.purchasedRank FROM item_instance_artifact_powers ap LEFT JOIN item_instance_artifact a ON ap.itemGuid = a.itemGuid INNER JOIN character_inventory ci ON ci.item = ap.guid WHERE ci.guid = ?
Dictionary<ObjectGuid, Tuple<ulong, uint, List<ItemDynamicFieldArtifactPowers>>> artifactData = new Dictionary<ObjectGuid, Tuple<ulong, uint, List<ItemDynamicFieldArtifactPowers>>>();
//MultiMap<ObjectGuid, ItemDynamicFieldArtifactPowers> artifactPowerData = new MultiMap<ObjectGuid, ItemDynamicFieldArtifactPowers>();
// 0 1 2 3 4 5
// SELECT a.itemGuid, a.xp, a.artifactAppearanceId, a.artifactTierId, ap.artifactPowerId, ap.purchasedRank FROM item_instance_artifact_powers ap LEFT JOIN item_instance_artifact a ON ap.itemGuid = a.itemGuid INNER JOIN character_inventory ci ON ci.item = ap.guid WHERE ci.guid = ?
var artifactData = new Dictionary<ObjectGuid, Tuple<ulong, uint, uint, List<ItemDynamicFieldArtifactPowers>>>();
if (!artifactsResult.IsEmpty())
{
do
{
var artifactDataEntry = Tuple.Create(artifactsResult.Read<ulong>(1), artifactsResult.Read<uint>(2), new List<ItemDynamicFieldArtifactPowers>());
var artifactDataEntry = Tuple.Create(artifactsResult.Read<ulong>(1), artifactsResult.Read<uint>(2), artifactsResult.Read<uint>(3), new List<ItemDynamicFieldArtifactPowers>());
ItemDynamicFieldArtifactPowers artifactPowerData = new ItemDynamicFieldArtifactPowers();
artifactPowerData.ArtifactPowerId = artifactsResult.Read<uint>(3);
artifactPowerData.PurchasedRank = artifactsResult.Read<byte>(4);
artifactPowerData.ArtifactPowerId = artifactsResult.Read<uint>(4);
artifactPowerData.PurchasedRank = artifactsResult.Read<byte>(5);
ArtifactPowerRecord artifactPower = CliDB.ArtifactPowerStorage.LookupByKey(artifactPowerData.ArtifactPowerId);
if (artifactPower != null)
{
if (artifactPowerData.PurchasedRank > artifactPower.MaxPurchasableRank)
artifactPowerData.PurchasedRank = artifactPower.MaxPurchasableRank;
uint maxRank = artifactPower.MaxPurchasableRank;
// allow ARTIFACT_POWER_FLAG_FINAL to overflow maxrank here - needs to be handled in Item::CheckArtifactUnlock (will refund artifact power)
if (artifactPower.Flags.HasAnyFlag(ArtifactPowerFlag.MaxRankWithTier) && artifactPower.Tier < artifactDataEntry.Item3)
maxRank += artifactDataEntry.Item3 - artifactPower.Tier;
artifactPowerData.CurrentRankWithBonus = (byte)(artifactPower.Flags.HasAnyFlag(ArtifactPowerFlag.First) ? 1 : 0);
if (artifactPowerData.PurchasedRank > maxRank)
artifactPowerData.PurchasedRank = (byte)maxRank;
artifactDataEntry.Item3.Add(artifactPowerData);
artifactPowerData.CurrentRankWithBonus = (byte)((artifactPower.Flags & ArtifactPowerFlag.First) == ArtifactPowerFlag.First ? 1 : 0);
artifactDataEntry.Item4.Add(artifactPowerData);
}
artifactData[ObjectGuid.Create(HighGuid.Item, artifactsResult.Read<ulong>(0))] = artifactDataEntry;
@@ -85,7 +89,7 @@ namespace Game.Entities
{
var artifactDataPair = artifactData.LookupByKey(item.GetGUID());
if (item.GetTemplate().GetArtifactID() != 0 && artifactDataPair != null)
item.LoadArtifactData(this, artifactDataPair.Item1, artifactDataPair.Item2, artifactDataPair.Item3);
item.LoadArtifactData(this, artifactDataPair.Item1, artifactDataPair.Item2, artifactDataPair.Item3, artifactDataPair.Item4);
ulong counter = result.Read<ulong>(45);
ObjectGuid bagGuid = counter != 0 ? ObjectGuid.Create(HighGuid.Item, counter) : ObjectGuid.Empty;
+18
View File
@@ -5085,6 +5085,16 @@ namespace Game.Entities
SendPacket(displayPlayerChoice);
}
public bool MeetPlayerCondition(uint conditionId)
{
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(conditionId);
if (playerCondition != null)
if (!ConditionManager.IsPlayerMeetingCondition(this, playerCondition))
return false;
return true;
}
public float GetCollisionHeight(bool mounted)
{
if (mounted)
@@ -5333,6 +5343,14 @@ namespace Game.Entities
_ApplyAllLevelScaleItemMods(true); // Moved to above SetFullHealth so player will have full health from Heirlooms
Aura artifactAura = GetAura(PlayerConst.ArtifactsAllWeaponsGeneralWeaponEquippedPassive);
if (artifactAura != null)
{
Item artifact = GetItemByGuid(artifactAura.GetCastItemGUID());
if (artifact != null)
artifact.CheckArtifactRelicSlotUnlock(this);
}
// Only health and mana are set to maximum.
SetFullHealth();
SetFullPower(PowerType.Mana);
+44 -3
View File
@@ -37,10 +37,12 @@ namespace Game
if (!artifact)
return;
uint currentArtifactTier = artifact.GetModifier(ItemModifier.ArtifactTier);
ulong xpCost = 0;
GtArtifactLevelXPRecord cost = CliDB.ArtifactLevelXPGameTable.GetRow(artifact.GetTotalPurchasedArtifactPowers() + 1);
if (cost != null)
xpCost = (ulong)(artifact.GetModifier(ItemModifier.ArtifactTier) == 1 ? cost.XP2 : cost.XP);
xpCost = (ulong)(currentArtifactTier == PlayerConst.MaxArtifactTier ? cost.XP2 : cost.XP);
if (xpCost > artifact.GetUInt64Value(ItemFields.ArtifactXp))
return;
@@ -56,10 +58,23 @@ namespace Game
if (artifactPowerEntry == null)
return;
if (artifactAddPower.PowerChoices[0].Rank != artifactPower.PurchasedRank + 1 ||
artifactAddPower.PowerChoices[0].Rank > artifactPowerEntry.MaxPurchasableRank)
if (artifactPowerEntry.Tier > currentArtifactTier)
return;
uint maxRank = artifactPowerEntry.MaxPurchasableRank;
if (artifactPowerEntry.Tier < currentArtifactTier)
{
if (artifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.Final))
maxRank = 1;
else if (artifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.MaxRankWithTier))
maxRank += currentArtifactTier - artifactPowerEntry.Tier;
}
if (artifactAddPower.PowerChoices[0].Rank != artifactPower.PurchasedRank + 1 ||
artifactAddPower.PowerChoices[0].Rank > maxRank)
return;
if (!artifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.NoLinkRequired))
{
var artifactPowerLinks = Global.DB2Mgr.GetArtifactPowerLinks(artifactPower.ArtifactPowerId);
if (artifactPowerLinks != null)
{
@@ -84,6 +99,7 @@ namespace Game
if (!hasAnyLink)
return;
}
}
ArtifactPowerRankRecord artifactPowerRank = Global.DB2Mgr.GetArtifactPowerRank(artifactPower.ArtifactPowerId, (byte)(artifactPower.CurrentRankWithBonus + 1 - 1)); // need data for next rank, but -1 because of how db2 data is structured
if (artifactPowerRank == null)
@@ -119,6 +135,31 @@ namespace Game
artifact.SetUInt64Value(ItemFields.ArtifactXp, artifact.GetUInt64Value(ItemFields.ArtifactXp) - xpCost);
artifact.SetState(ItemUpdateState.Changed, _player);
uint totalPurchasedArtifactPower = artifact.GetTotalPurchasedArtifactPowers();
uint artifactTier = 0;
foreach (ArtifactTierRecord tier in CliDB.ArtifactTierStorage.Values)
{
if (artifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.Final) && artifactPowerEntry.Tier < PlayerConst.MaxArtifactTier)
{
artifactTier = artifactPowerEntry.Tier + 1u;
break;
}
if (totalPurchasedArtifactPower < tier.MaxNumTraits)
{
artifactTier = tier.ArtifactTier;
break;
}
}
artifactTier = Math.Max(artifactTier, currentArtifactTier);
for (uint i = currentArtifactTier; i <= artifactTier; ++i)
artifact.InitArtifactPowers(artifact.GetTemplate().GetArtifactID(), (byte)i);
artifact.SetModifier(ItemModifier.ArtifactTier, artifactTier);
}
[WorldPacketHandler(ClientOpcodes.ArtifactSetAppearance)]
+10
View File
@@ -691,6 +691,16 @@ namespace Game
// TODO: Move this to BattlePetMgr::SendJournalLock() just to have all packets in one file
SendPacket(new BattlePetJournalLockAcquired());
ArtifactKnowledge artifactKnowledge = new ArtifactKnowledge();
artifactKnowledge.ArtifactCategoryID = ArtifactCategory.Primary;
artifactKnowledge.KnowledgeLevel = (sbyte)WorldConfig.GetIntValue(WorldCfg.CurrencyStartArtifactKnowledge);
SendPacket(artifactKnowledge);
ArtifactKnowledge artifactKnowledgeFishingPole = new ArtifactKnowledge();
artifactKnowledgeFishingPole.ArtifactCategoryID = ArtifactCategory.Fishing;
artifactKnowledgeFishingPole.KnowledgeLevel = 0;
SendPacket(artifactKnowledgeFishingPole);
pCurrChar.SendInitialPacketsBeforeAddToMap();
//Show cinematic at the first time that player login
@@ -122,4 +122,18 @@ namespace Game.Network.Packets
public ObjectGuid ArtifactGUID;
public ulong Amount;
}
class ArtifactKnowledge : ServerPacket
{
public ArtifactKnowledge() : base(ServerOpcodes.ArtifactKnowledge) { }
public override void Write()
{
_worldPacket.WriteInt32(ArtifactCategoryID);
_worldPacket.WriteInt8(KnowledgeLevel);
}
public ArtifactCategory ArtifactCategoryID;
public sbyte KnowledgeLevel;
}
}
+7
View File
@@ -495,6 +495,13 @@ namespace Game
}
Values[WorldCfg.CurrencyMaxJusticePoints] = (int)Values[WorldCfg.CurrencyMaxJusticePoints] * 100; //precision mod
Values[WorldCfg.CurrencyStartArtifactKnowledge] = GetDefaultValue("Currency.StartArtifactKnowledge", 55);
if ((int)(Values[WorldCfg.CurrencyStartArtifactKnowledge]) < 0)
{
Log.outError(LogFilter.ServerLoading, "Currency.StartArtifactKnowledge ({0}) must be >= 0, set to default 0.", Values[WorldCfg.CurrencyStartArtifactKnowledge]);
Values[WorldCfg.CurrencyStartArtifactKnowledge] = 0;
}
Values[WorldCfg.MaxRecruitAFriendBonusPlayerLevel] = GetDefaultValue("RecruitAFriend.MaxLevel", 85);
if ((int)Values[WorldCfg.MaxRecruitAFriendBonusPlayerLevel] > (int)Values[WorldCfg.MaxPlayerLevel])
{
+1 -1
View File
@@ -5674,7 +5674,7 @@ namespace Game.Spells
{
Item artifact = m_caster.ToPlayer().GetItemByGuid(artifactAura.GetCastItemGUID());
if (artifact)
artifact.GiveArtifactXp((ulong)damage, m_CastItem, (uint)effectInfo.MiscValue);
artifact.GiveArtifactXp((ulong)damage, m_CastItem, (ArtifactCategory)effectInfo.MiscValue);
}
}
+8
View File
@@ -3539,6 +3539,14 @@ Currency.StartJusticePoints = 0
Currency.MaxJusticePoints = 4000
#
# Currency.StartArtifactKnowledge
# Amount artifact knowledge that new players will start with
# Default: 55 (max)
#
Currency.StartArtifactKnowledge = 55
#
###################################################################################################
@@ -0,0 +1,29 @@
--
-- Table structure for table `artifact_tier`
--
DROP TABLE IF EXISTS `artifact_tier`;
CREATE TABLE `artifact_tier` (
`ID` int(10) unsigned NOT NULL DEFAULT '0',
`ArtifactTier` int(10) unsigned NOT NULL DEFAULT '0',
`MaxNumTraits` int(10) unsigned NOT NULL DEFAULT '0',
`MaxArtifactKnowledge` int(10) unsigned NOT NULL DEFAULT '0',
`KnowledgePlayerCondition` int(10) unsigned NOT NULL DEFAULT '0',
`MinimumEmpowerKnowledge` int(10) unsigned NOT NULL DEFAULT '0',
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Table structure for table `artifact_unlock`
--
DROP TABLE IF EXISTS `artifact_unlock`;
CREATE TABLE `artifact_unlock` (
`ID` int(10) unsigned NOT NULL DEFAULT '0',
`ItemBonusListID` smallint(5) unsigned NOT NULL DEFAULT '0',
`PowerRank` tinyint(3) unsigned NOT NULL DEFAULT '0',
`PowerID` int(10) unsigned NOT NULL DEFAULT '0',
`PlayerConditionID` int(10) unsigned NOT NULL DEFAULT '0',
`ArtifactID` tinyint(3) unsigned NOT NULL DEFAULT '0',
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;