Merge pull request #786 from ze-dom/DW_master_tree_finishup
(cherry picked from commit 06cc3489b92cc4b83a3a743ac9e29d00c144a303)
This commit is contained in:
@@ -0,0 +1,61 @@
|
|||||||
|
// <copyright file="MagicEffectCancelHandlerPlugIn.cs" company="MUnique">
|
||||||
|
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||||
|
// </copyright>
|
||||||
|
|
||||||
|
namespace MUnique.OpenMU.GameServer.MessageHandler;
|
||||||
|
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using MUnique.OpenMU.GameLogic;
|
||||||
|
using MUnique.OpenMU.Network.Packets.ClientToServer;
|
||||||
|
using MUnique.OpenMU.Network.PlugIns;
|
||||||
|
using MUnique.OpenMU.PlugIns;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handler for magic effect cancel packets.
|
||||||
|
/// </summary>
|
||||||
|
[PlugIn]
|
||||||
|
[Display(Name = nameof(PlugInResources.MagicEffectCancelHandlerPlugIn_Name), Description = nameof(PlugInResources.MagicEffectCancelHandlerPlugIn_Description), ResourceType = typeof(PlugInResources))]
|
||||||
|
[Guid("3f25c9a1-4b8d-4e7f-9a2b-1c3d4e5f6a7b")]
|
||||||
|
[MinimumClient(1, 0, ClientLanguage.Invariant)]
|
||||||
|
internal class MagicEffectCancelHandlerPlugIn : IPacketHandlerPlugIn
|
||||||
|
{
|
||||||
|
private const int InfinityArrowSkillId = 77;
|
||||||
|
private const int ExpansionOfWizardrySkillId = 233;
|
||||||
|
private const int ExpansionOfWizardryStrengSkillId = 380;
|
||||||
|
private const int ExpansionOfWizardryMasterySkillId = 383;
|
||||||
|
private const int InfinityArrowStrengSkillId = 441;
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public bool IsEncryptionExpected => true;
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public byte Key => MagicEffectCancelRequest.Code;
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public async ValueTask HandlePacketAsync(Player player, Memory<byte> packet)
|
||||||
|
{
|
||||||
|
MagicEffectCancelRequest message = packet;
|
||||||
|
if (!IsCancellableSkill(message.SkillId) || player.SkillList is null || !player.SkillList.ContainsSkill(message.SkillId))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var magicEffect = player.SkillList.GetSkill(message.SkillId)?.Skill?.MagicEffectDef;
|
||||||
|
if (magicEffect is null || !player.MagicEffectList.ActiveEffects.TryGetValue(magicEffect.Number, out var effect))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await effect.DisposeAsync().ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsCancellableSkill(ushort skillId) => skillId switch
|
||||||
|
{
|
||||||
|
ExpansionOfWizardrySkillId => true,
|
||||||
|
ExpansionOfWizardryStrengSkillId => true,
|
||||||
|
ExpansionOfWizardryMasterySkillId => true,
|
||||||
|
InfinityArrowSkillId => true,
|
||||||
|
InfinityArrowStrengSkillId => true,
|
||||||
|
_ => false,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.42000
|
// Runtime Version:4.0.30319.42000
|
||||||
@@ -2580,6 +2580,24 @@ namespace MUnique.OpenMU.GameServer.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Handler for magic effect cancel packets..
|
||||||
|
/// </summary>
|
||||||
|
public static string MagicEffectCancelHandlerPlugIn_Description {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("MagicEffectCancelHandlerPlugIn_Description", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Magic Effect Cancel Handler.
|
||||||
|
/// </summary>
|
||||||
|
public static string MagicEffectCancelHandlerPlugIn_Name {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("MagicEffectCancelHandlerPlugIn_Name", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to The default implementation of the IMapChangePlugIn which is forwarding everything to the game client with specific data packets..
|
/// Looks up a localized string similar to The default implementation of the IMapChangePlugIn which is forwarding everything to the game client with specific data packets..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -218,6 +218,12 @@
|
|||||||
</data>
|
</data>
|
||||||
<data name="HitHandlerPlugIn075_Description" xml:space="preserve">
|
<data name="HitHandlerPlugIn075_Description" xml:space="preserve">
|
||||||
<value>Handler for hit packets.</value>
|
<value>Handler for hit packets.</value>
|
||||||
|
</data>
|
||||||
|
<data name="MagicEffectCancelHandlerPlugIn_Name" xml:space="preserve">
|
||||||
|
<value>Magic Effect Cancel Handler</value>
|
||||||
|
</data>
|
||||||
|
<data name="MagicEffectCancelHandlerPlugIn_Description" xml:space="preserve">
|
||||||
|
<value>Handler for magic effect cancel packets.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TalkNpcHandlerPlugIn_Name" xml:space="preserve">
|
<data name="TalkNpcHandlerPlugIn_Name" xml:space="preserve">
|
||||||
<value>Talk Npc Handler</value>
|
<value>Talk Npc Handler</value>
|
||||||
|
|||||||
@@ -9425,7 +9425,7 @@ public readonly struct TargetedSkill095
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is sent by the client when: A player cancels a specific magic effect of a skill, usually 'Infinity Arrow' and 'Wizardy Enhance'.
|
/// Is sent by the client when: A player cancels a specific magic effect of a skill, usually 'Infinity Arrow' and 'Wizardry Enhance'.
|
||||||
/// Causes reaction on server side: The effect is cancelled and an update is sent to the player and all surrounding players.
|
/// Causes reaction on server side: The effect is cancelled and an update is sent to the player and all surrounding players.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly struct MagicEffectCancelRequest
|
public readonly struct MagicEffectCancelRequest
|
||||||
|
|||||||
@@ -2317,7 +2317,7 @@
|
|||||||
<Name>MagicEffectCancelRequest</Name>
|
<Name>MagicEffectCancelRequest</Name>
|
||||||
<Length>7</Length>
|
<Length>7</Length>
|
||||||
<Direction>ClientToServer</Direction>
|
<Direction>ClientToServer</Direction>
|
||||||
<SentWhen>A player cancels a specific magic effect of a skill, usually 'Infinity Arrow' and 'Wizardy Enhance'.</SentWhen>
|
<SentWhen>A player cancels a specific magic effect of a skill, usually 'Infinity Arrow' and 'Wizardry Enhance'.</SentWhen>
|
||||||
<CausedReaction>The effect is cancelled and an update is sent to the player and all surrounding players.</CausedReaction>
|
<CausedReaction>The effect is cancelled and an update is sent to the player and all surrounding players.</CausedReaction>
|
||||||
<Fields>
|
<Fields>
|
||||||
<Field>
|
<Field>
|
||||||
|
|||||||
@@ -9300,7 +9300,7 @@ public readonly ref struct TargetedSkill095Ref
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is sent by the client when: A player cancels a specific magic effect of a skill, usually 'Infinity Arrow' and 'Wizardy Enhance'.
|
/// Is sent by the client when: A player cancels a specific magic effect of a skill, usually 'Infinity Arrow' and 'Wizardry Enhance'.
|
||||||
/// Causes reaction on server side: The effect is cancelled and an update is sent to the player and all surrounding players.
|
/// Causes reaction on server side: The effect is cancelled and an update is sent to the player and all surrounding players.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly ref struct MagicEffectCancelRequestRef
|
public readonly ref struct MagicEffectCancelRequestRef
|
||||||
|
|||||||
@@ -3037,7 +3037,7 @@ public static class ConnectionExtensions
|
|||||||
/// <param name="skillId">The skill id.</param>
|
/// <param name="skillId">The skill id.</param>
|
||||||
/// <param name="playerId">The player id.</param>
|
/// <param name="playerId">The player id.</param>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Is sent by the client when: A player cancels a specific magic effect of a skill, usually 'Infinity Arrow' and 'Wizardy Enhance'.
|
/// Is sent by the client when: A player cancels a specific magic effect of a skill, usually 'Infinity Arrow' and 'Wizardry Enhance'.
|
||||||
/// Causes reaction on server side: The effect is cancelled and an update is sent to the player and all surrounding players.
|
/// Causes reaction on server side: The effect is cancelled and an update is sent to the player and all surrounding players.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public static async ValueTask SendMagicEffectCancelRequestAsync(this IConnection? connection, ushort @skillId, ushort @playerId)
|
public static async ValueTask SendMagicEffectCancelRequestAsync(this IConnection? connection, ushort @skillId, ushort @playerId)
|
||||||
|
|||||||
@@ -330,12 +330,12 @@ internal enum MagicEffectNumber : short
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The wiz enhance strengthener effect.
|
/// The wiz enhance strengthener effect.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
WizEnhance2 = 138,
|
WizEnhanceStrengthener = 138,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The wiz enhance mastery effect.
|
/// The wiz enhance mastery effect.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
WizEnhance3 = 139,
|
WizEnhanceMastery = 139,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The critical damage increase mastery effect.
|
/// The critical damage increase mastery effect.
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ using MUnique.OpenMU.GameLogic.Attributes;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializer which initializes the wizardry enhance effect.
|
/// Initializer which initializes the wizardry enhance effect.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
|
||||||
/// It includes all attributes which are enhanced by the wizardry skill and its master skills.
|
|
||||||
/// </remarks>
|
|
||||||
public class WizardryEnhanceEffectInitializer : InitializerBase
|
public class WizardryEnhanceEffectInitializer : InitializerBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -39,30 +36,18 @@ public class WizardryEnhanceEffectInitializer : InitializerBase
|
|||||||
magicEffect.SendDuration = false;
|
magicEffect.SendDuration = false;
|
||||||
magicEffect.StopByDeath = true;
|
magicEffect.StopByDeath = true;
|
||||||
magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>();
|
magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>();
|
||||||
magicEffect.Duration.ConstantValue.Value = 1200f; // 20 minutes
|
magicEffect.Duration.ConstantValue.Value = 1800f; // 30 minutes
|
||||||
|
|
||||||
var powerUpDefinition = this.Context.CreateNew<PowerUpDefinition>();
|
var minWizDmgPowerUp = this.Context.CreateNew<PowerUpDefinition>();
|
||||||
magicEffect.PowerUpDefinitions.Add(powerUpDefinition);
|
magicEffect.PowerUpDefinitions.Add(minWizDmgPowerUp);
|
||||||
powerUpDefinition.TargetAttribute = Stats.MinimumWizBaseDmg.GetPersistent(this.GameConfiguration);
|
minWizDmgPowerUp.TargetAttribute = Stats.MinimumWizBaseDmg.GetPersistent(this.GameConfiguration);
|
||||||
|
minWizDmgPowerUp.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
minWizDmgPowerUp.Boost.MaximumValue = 100f; // 100 dmg
|
||||||
|
|
||||||
powerUpDefinition.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
|
var minWizDmgPerEnergy = this.Context.CreateNew<AttributeRelationship>();
|
||||||
powerUpDefinition.Boost.ConstantValue.Value = 1.2f;
|
minWizDmgPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration);
|
||||||
powerUpDefinition.Boost.ConstantValue.AggregateType = AggregateType.Multiplicate;
|
minWizDmgPerEnergy.InputOperator = InputOperator.Multiply;
|
||||||
|
minWizDmgPerEnergy.InputOperand = 0.2f / 9; // 45 energy adds 1 min wiz damage
|
||||||
var powerUpDefinition2 = this.Context.CreateNew<PowerUpDefinition>();
|
minWizDmgPowerUp.Boost.RelatedValues.Add(minWizDmgPerEnergy);
|
||||||
magicEffect.PowerUpDefinitions.Add(powerUpDefinition2);
|
|
||||||
powerUpDefinition2.TargetAttribute = Stats.MaximumWizBaseDmg.GetPersistent(this.GameConfiguration);
|
|
||||||
|
|
||||||
powerUpDefinition2.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
|
|
||||||
powerUpDefinition2.Boost.ConstantValue.Value = 1f;
|
|
||||||
powerUpDefinition2.Boost.ConstantValue.AggregateType = AggregateType.Multiplicate;
|
|
||||||
|
|
||||||
var powerUpDefinition3 = this.Context.CreateNew<PowerUpDefinition>();
|
|
||||||
magicEffect.PowerUpDefinitions.Add(powerUpDefinition3);
|
|
||||||
powerUpDefinition3.TargetAttribute = Stats.CriticalDamageChance.GetPersistent(this.GameConfiguration);
|
|
||||||
|
|
||||||
powerUpDefinition3.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
|
|
||||||
powerUpDefinition3.Boost.ConstantValue.Value = 1f;
|
|
||||||
powerUpDefinition3.Boost.ConstantValue.AggregateType = AggregateType.Multiplicate;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
// <copyright file="WizardryEnhanceMasteryEffectInitializer.cs" company="MUnique">
|
||||||
|
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||||
|
// </copyright>
|
||||||
|
|
||||||
|
namespace MUnique.OpenMU.Persistence.Initialization.Skills;
|
||||||
|
|
||||||
|
using MUnique.OpenMU.AttributeSystem;
|
||||||
|
using MUnique.OpenMU.DataModel.Attributes;
|
||||||
|
using MUnique.OpenMU.DataModel.Configuration;
|
||||||
|
using MUnique.OpenMU.GameLogic.Attributes;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializer which initializes the wizardry enhance mastery effect.
|
||||||
|
/// </summary>
|
||||||
|
public class WizardryEnhanceMasteryEffectInitializer : InitializerBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="WizardryEnhanceMasteryEffectInitializer"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context">The context.</param>
|
||||||
|
/// <param name="gameConfiguration">The game configuration.</param>
|
||||||
|
public WizardryEnhanceMasteryEffectInitializer(IContext context, GameConfiguration gameConfiguration)
|
||||||
|
: base(context, gameConfiguration)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
var magicEffect = this.Context.CreateNew<MagicEffectDefinition>();
|
||||||
|
this.GameConfiguration.MagicEffects.Add(magicEffect);
|
||||||
|
magicEffect.Number = (byte)MagicEffectNumber.WizEnhanceMastery;
|
||||||
|
magicEffect.Name = "Wizardry Enhance Mastery Skill Effect";
|
||||||
|
|
||||||
|
var wizardryEnhanceEffect = this.GameConfiguration.MagicEffects.First(e => e.Number == (short)MagicEffectNumber.WizEnhanceStrengthener);
|
||||||
|
magicEffect.InformObservers = wizardryEnhanceEffect.InformObservers;
|
||||||
|
magicEffect.SubType = wizardryEnhanceEffect.SubType;
|
||||||
|
magicEffect.SendDuration = wizardryEnhanceEffect.SendDuration;
|
||||||
|
magicEffect.StopByDeath = wizardryEnhanceEffect.StopByDeath;
|
||||||
|
magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
magicEffect.Duration.ConstantValue.Value = wizardryEnhanceEffect.Duration!.ConstantValue.Value;
|
||||||
|
magicEffect.Duration.MaximumValue = wizardryEnhanceEffect.Duration.MaximumValue;
|
||||||
|
|
||||||
|
foreach (var powerUp in wizardryEnhanceEffect.PowerUpDefinitions)
|
||||||
|
{
|
||||||
|
var powerUpCopy = this.Context.CreateNew<PowerUpDefinition>();
|
||||||
|
magicEffect.PowerUpDefinitions.Add(powerUpCopy);
|
||||||
|
powerUpCopy.TargetAttribute = powerUp.TargetAttribute!.GetPersistent(this.GameConfiguration);
|
||||||
|
powerUpCopy.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
powerUpCopy.Boost.ConstantValue.Value = powerUp.Boost!.ConstantValue.Value;
|
||||||
|
powerUpCopy.Boost.ConstantValue.AggregateType = powerUp.Boost.ConstantValue.AggregateType;
|
||||||
|
powerUpCopy.Boost.MaximumValue = powerUp.Boost.MaximumValue;
|
||||||
|
|
||||||
|
foreach (var boostRelatedValue in powerUp.Boost.RelatedValues)
|
||||||
|
{
|
||||||
|
var boostRelatedValueCopy = this.Context.CreateNew<AttributeRelationship>();
|
||||||
|
boostRelatedValueCopy.InputAttribute = boostRelatedValue.InputAttribute!.GetPersistent(this.GameConfiguration);
|
||||||
|
boostRelatedValueCopy.InputOperator = boostRelatedValue.InputOperator;
|
||||||
|
boostRelatedValueCopy.InputOperand = boostRelatedValue.InputOperand;
|
||||||
|
boostRelatedValueCopy.AggregateType = boostRelatedValue.AggregateType;
|
||||||
|
powerUpCopy.Boost.RelatedValues.Add(boostRelatedValueCopy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var critChancePowerUp = this.Context.CreateNew<PowerUpDefinition>();
|
||||||
|
magicEffect.PowerUpDefinitions.Add(critChancePowerUp);
|
||||||
|
critChancePowerUp.TargetAttribute = Stats.CriticalDamageChance.GetPersistent(this.GameConfiguration);
|
||||||
|
critChancePowerUp.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
// <copyright file="WizardryEnhanceStrengthenerEffectInitializer.cs" company="MUnique">
|
||||||
|
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||||
|
// </copyright>
|
||||||
|
|
||||||
|
namespace MUnique.OpenMU.Persistence.Initialization.Skills;
|
||||||
|
|
||||||
|
using MUnique.OpenMU.AttributeSystem;
|
||||||
|
using MUnique.OpenMU.DataModel.Attributes;
|
||||||
|
using MUnique.OpenMU.DataModel.Configuration;
|
||||||
|
using MUnique.OpenMU.GameLogic.Attributes;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializer which initializes the wizardry enhance strengthener effect.
|
||||||
|
/// </summary>
|
||||||
|
public class WizardryEnhanceStrengthenerEffectInitializer : InitializerBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="WizardryEnhanceStrengthenerEffectInitializer"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context">The context.</param>
|
||||||
|
/// <param name="gameConfiguration">The game configuration.</param>
|
||||||
|
public WizardryEnhanceStrengthenerEffectInitializer(IContext context, GameConfiguration gameConfiguration)
|
||||||
|
: base(context, gameConfiguration)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
var magicEffect = this.Context.CreateNew<MagicEffectDefinition>();
|
||||||
|
this.GameConfiguration.MagicEffects.Add(magicEffect);
|
||||||
|
magicEffect.Number = (byte)MagicEffectNumber.WizEnhanceStrengthener;
|
||||||
|
magicEffect.Name = "Wizardry Enhance Strengthener Skill Effect";
|
||||||
|
|
||||||
|
var wizardryEnhanceEffect = this.GameConfiguration.MagicEffects.First(e => e.Number == (short)MagicEffectNumber.WizEnhance);
|
||||||
|
magicEffect.InformObservers = wizardryEnhanceEffect.InformObservers;
|
||||||
|
magicEffect.SubType = wizardryEnhanceEffect.SubType;
|
||||||
|
magicEffect.SendDuration = wizardryEnhanceEffect.SendDuration;
|
||||||
|
magicEffect.StopByDeath = wizardryEnhanceEffect.StopByDeath;
|
||||||
|
magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
magicEffect.Duration.ConstantValue.Value = wizardryEnhanceEffect.Duration!.ConstantValue.Value;
|
||||||
|
magicEffect.Duration.MaximumValue = wizardryEnhanceEffect.Duration.MaximumValue;
|
||||||
|
|
||||||
|
foreach (var powerUp in wizardryEnhanceEffect.PowerUpDefinitions)
|
||||||
|
{
|
||||||
|
var powerUpCopy = this.Context.CreateNew<PowerUpDefinition>();
|
||||||
|
magicEffect.PowerUpDefinitions.Add(powerUpCopy);
|
||||||
|
powerUpCopy.TargetAttribute = powerUp.TargetAttribute!.GetPersistent(this.GameConfiguration);
|
||||||
|
powerUpCopy.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
powerUpCopy.Boost.ConstantValue.Value = powerUp.Boost!.ConstantValue.Value;
|
||||||
|
powerUpCopy.Boost.ConstantValue.AggregateType = powerUp.Boost.ConstantValue.AggregateType;
|
||||||
|
powerUpCopy.Boost.MaximumValue = powerUp.Boost.MaximumValue;
|
||||||
|
|
||||||
|
foreach (var boostRelatedValue in powerUp.Boost.RelatedValues)
|
||||||
|
{
|
||||||
|
var boostRelatedValueCopy = this.Context.CreateNew<AttributeRelationship>();
|
||||||
|
boostRelatedValueCopy.InputAttribute = boostRelatedValue.InputAttribute!.GetPersistent(this.GameConfiguration);
|
||||||
|
boostRelatedValueCopy.InputOperator = boostRelatedValue.InputOperator;
|
||||||
|
boostRelatedValueCopy.InputOperand = boostRelatedValue.InputOperand;
|
||||||
|
boostRelatedValueCopy.AggregateType = boostRelatedValue.AggregateType;
|
||||||
|
powerUpCopy.Boost.RelatedValues.Add(boostRelatedValueCopy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var maxDmgPowerUp = this.Context.CreateNew<PowerUpDefinition>();
|
||||||
|
magicEffect.PowerUpDefinitions.Add(maxDmgPowerUp);
|
||||||
|
maxDmgPowerUp.TargetAttribute = Stats.MaximumWizBaseDmg.GetPersistent(this.GameConfiguration);
|
||||||
|
maxDmgPowerUp.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
maxDmgPowerUp.Boost.ConstantValue.Value = 1f;
|
||||||
|
maxDmgPowerUp.Boost.ConstantValue.AggregateType = AggregateType.Multiplicate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
// <copyright file="FinishDarkWizardMasterTreePlugIn.cs" company="MUnique">
|
||||||
|
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||||
|
// </copyright>
|
||||||
|
|
||||||
|
namespace MUnique.OpenMU.Persistence.Initialization.Updates;
|
||||||
|
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using MUnique.OpenMU.AttributeSystem;
|
||||||
|
using MUnique.OpenMU.DataModel.Attributes;
|
||||||
|
using MUnique.OpenMU.DataModel.Configuration;
|
||||||
|
using MUnique.OpenMU.GameLogic.Attributes;
|
||||||
|
using MUnique.OpenMU.Persistence.Initialization.Skills;
|
||||||
|
using MUnique.OpenMU.PlugIns;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This update completes the dark wizard master tree expansion of wizardry effects.
|
||||||
|
/// </summary>
|
||||||
|
[PlugIn]
|
||||||
|
[Display(Name = PlugInName, Description = PlugInDescription)]
|
||||||
|
[Guid("C1D2E3F4-5A6B-7C8D-9E0F-1A2B3C4D5E6F")]
|
||||||
|
public class FinishDarkWizardMasterTreePlugIn : UpdatePlugInBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The plug in name.
|
||||||
|
/// </summary>
|
||||||
|
internal const string PlugInName = "Finish Dark Wizard Master Tree PlugIn";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The plug in description.
|
||||||
|
/// </summary>
|
||||||
|
internal const string PlugInDescription = "This update completes the dark wizard master tree expansion of wizardry effects.";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override UpdateVersion Version => UpdateVersion.FinishDarkWizardMasterTree;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override string DataInitializationKey => VersionSeasonSix.DataInitialization.Id;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override string Name => PlugInName;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override string Description => PlugInDescription;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override bool IsMandatory => true;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override DateTime CreatedAt => new(2026, 7, 7, 16, 0, 0, DateTimeKind.Utc);
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override async ValueTask ApplyAsync(IContext context, GameConfiguration gameConfiguration)
|
||||||
|
{
|
||||||
|
// Update Wizardry Enhance effect
|
||||||
|
var wizardryEnhanceEffect = gameConfiguration.MagicEffects.First(e => e.Number == (short)MagicEffectNumber.WizEnhance);
|
||||||
|
wizardryEnhanceEffect.Duration = context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
wizardryEnhanceEffect.Duration.ConstantValue.Value = 1800f; // 30 minutes
|
||||||
|
wizardryEnhanceEffect.PowerUpDefinitions.Clear();
|
||||||
|
|
||||||
|
var minWizDmgPowerUp = context.CreateNew<PowerUpDefinition>();
|
||||||
|
wizardryEnhanceEffect.PowerUpDefinitions.Add(minWizDmgPowerUp);
|
||||||
|
minWizDmgPowerUp.TargetAttribute = Stats.MinimumWizBaseDmg.GetPersistent(gameConfiguration);
|
||||||
|
minWizDmgPowerUp.Boost = context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
minWizDmgPowerUp.Boost.MaximumValue = 100f; // 100 dmg
|
||||||
|
|
||||||
|
var minWizDmgPerEnergy = context.CreateNew<AttributeRelationship>();
|
||||||
|
minWizDmgPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(gameConfiguration);
|
||||||
|
minWizDmgPerEnergy.InputOperator = InputOperator.Multiply;
|
||||||
|
minWizDmgPerEnergy.InputOperand = 0.2f / 9; // 45 energy adds 1 min wiz damage
|
||||||
|
minWizDmgPowerUp.Boost.RelatedValues.Add(minWizDmgPerEnergy);
|
||||||
|
|
||||||
|
// Create Wiz Enhance Strengthener & Mastery Skill Effects
|
||||||
|
var wizEnhanceStrengthenerEffect = this.CreateWizEnhanceStrengthenerEffect(context, gameConfiguration);
|
||||||
|
var wizEnhanceMasteryEffect = this.CreateWizEnhanceMasteryEffect(context, gameConfiguration);
|
||||||
|
|
||||||
|
// Update master skills
|
||||||
|
if (gameConfiguration.Skills.FirstOrDefault(s => s.Number == (short)SkillNumber.ExpansionofWizStreng) is { } expansionOfWizStreng)
|
||||||
|
{
|
||||||
|
expansionOfWizStreng.MagicEffectDef = wizEnhanceStrengthenerEffect;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gameConfiguration.Skills.FirstOrDefault(s => s.Number == (short)SkillNumber.ExpansionofWizMas) is { } expansionOfWizMastery)
|
||||||
|
{
|
||||||
|
expansionOfWizMastery.MagicEffectDef = wizEnhanceMasteryEffect;
|
||||||
|
|
||||||
|
if (expansionOfWizMastery.MasterDefinition is { } masterDefinition)
|
||||||
|
{
|
||||||
|
masterDefinition.ReplacedSkill = gameConfiguration.Skills.First(s => s.Number == (short)SkillNumber.ExpansionofWizStreng);
|
||||||
|
masterDefinition.Aggregation = AggregateType.AddRaw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private MagicEffectDefinition CreateWizEnhanceStrengthenerEffect(IContext context, GameConfiguration gameConfiguration)
|
||||||
|
{
|
||||||
|
var magicEffect = context.CreateNew<MagicEffectDefinition>();
|
||||||
|
gameConfiguration.MagicEffects.Add(magicEffect);
|
||||||
|
magicEffect.Number = (byte)MagicEffectNumber.WizEnhanceStrengthener;
|
||||||
|
magicEffect.Name = "Wizardry Enhance Strengthener Skill Effect";
|
||||||
|
|
||||||
|
var wizardryEnhanceEffect = gameConfiguration.MagicEffects.First(e => e.Number == (short)MagicEffectNumber.WizEnhance);
|
||||||
|
magicEffect.InformObservers = wizardryEnhanceEffect.InformObservers;
|
||||||
|
magicEffect.SubType = wizardryEnhanceEffect.SubType;
|
||||||
|
magicEffect.SendDuration = wizardryEnhanceEffect.SendDuration;
|
||||||
|
magicEffect.StopByDeath = wizardryEnhanceEffect.StopByDeath;
|
||||||
|
magicEffect.Duration = context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
magicEffect.Duration.ConstantValue.Value = wizardryEnhanceEffect.Duration!.ConstantValue.Value;
|
||||||
|
magicEffect.Duration.MaximumValue = wizardryEnhanceEffect.Duration.MaximumValue;
|
||||||
|
|
||||||
|
foreach (var powerUp in wizardryEnhanceEffect.PowerUpDefinitions)
|
||||||
|
{
|
||||||
|
var powerUpCopy = context.CreateNew<PowerUpDefinition>();
|
||||||
|
magicEffect.PowerUpDefinitions.Add(powerUpCopy);
|
||||||
|
powerUpCopy.TargetAttribute = powerUp.TargetAttribute!.GetPersistent(gameConfiguration);
|
||||||
|
powerUpCopy.Boost = context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
powerUpCopy.Boost.ConstantValue.Value = powerUp.Boost!.ConstantValue.Value;
|
||||||
|
powerUpCopy.Boost.ConstantValue.AggregateType = powerUp.Boost.ConstantValue.AggregateType;
|
||||||
|
powerUpCopy.Boost.MaximumValue = powerUp.Boost.MaximumValue;
|
||||||
|
|
||||||
|
foreach (var boostRelatedValue in powerUp.Boost.RelatedValues)
|
||||||
|
{
|
||||||
|
var boostRelatedValueCopy = context.CreateNew<AttributeRelationship>();
|
||||||
|
boostRelatedValueCopy.InputAttribute = boostRelatedValue.InputAttribute!.GetPersistent(gameConfiguration);
|
||||||
|
boostRelatedValueCopy.InputOperator = boostRelatedValue.InputOperator;
|
||||||
|
boostRelatedValueCopy.InputOperand = boostRelatedValue.InputOperand;
|
||||||
|
boostRelatedValueCopy.AggregateType = boostRelatedValue.AggregateType;
|
||||||
|
powerUpCopy.Boost.RelatedValues.Add(boostRelatedValueCopy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var maxDmgPowerUp = context.CreateNew<PowerUpDefinition>();
|
||||||
|
magicEffect.PowerUpDefinitions.Add(maxDmgPowerUp);
|
||||||
|
maxDmgPowerUp.TargetAttribute = Stats.MaximumWizBaseDmg.GetPersistent(gameConfiguration);
|
||||||
|
maxDmgPowerUp.Boost = context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
maxDmgPowerUp.Boost.ConstantValue.Value = 1f;
|
||||||
|
maxDmgPowerUp.Boost.ConstantValue.AggregateType = AggregateType.Multiplicate;
|
||||||
|
|
||||||
|
return magicEffect;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MagicEffectDefinition CreateWizEnhanceMasteryEffect(IContext context, GameConfiguration gameConfiguration)
|
||||||
|
{
|
||||||
|
var magicEffect = context.CreateNew<MagicEffectDefinition>();
|
||||||
|
gameConfiguration.MagicEffects.Add(magicEffect);
|
||||||
|
magicEffect.Number = (byte)MagicEffectNumber.WizEnhanceMastery;
|
||||||
|
magicEffect.Name = "Wizardry Enhance Mastery Skill Effect";
|
||||||
|
|
||||||
|
var wizardryEnhanceEffect = gameConfiguration.MagicEffects.First(e => e.Number == (short)MagicEffectNumber.WizEnhanceStrengthener);
|
||||||
|
magicEffect.InformObservers = wizardryEnhanceEffect.InformObservers;
|
||||||
|
magicEffect.SubType = wizardryEnhanceEffect.SubType;
|
||||||
|
magicEffect.SendDuration = wizardryEnhanceEffect.SendDuration;
|
||||||
|
magicEffect.StopByDeath = wizardryEnhanceEffect.StopByDeath;
|
||||||
|
magicEffect.Duration = context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
magicEffect.Duration.ConstantValue.Value = wizardryEnhanceEffect.Duration!.ConstantValue.Value;
|
||||||
|
magicEffect.Duration.MaximumValue = wizardryEnhanceEffect.Duration.MaximumValue;
|
||||||
|
|
||||||
|
foreach (var powerUp in wizardryEnhanceEffect.PowerUpDefinitions)
|
||||||
|
{
|
||||||
|
var powerUpCopy = context.CreateNew<PowerUpDefinition>();
|
||||||
|
magicEffect.PowerUpDefinitions.Add(powerUpCopy);
|
||||||
|
powerUpCopy.TargetAttribute = powerUp.TargetAttribute!.GetPersistent(gameConfiguration);
|
||||||
|
powerUpCopy.Boost = context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
powerUpCopy.Boost.ConstantValue.Value = powerUp.Boost!.ConstantValue.Value;
|
||||||
|
powerUpCopy.Boost.ConstantValue.AggregateType = powerUp.Boost.ConstantValue.AggregateType;
|
||||||
|
powerUpCopy.Boost.MaximumValue = powerUp.Boost.MaximumValue;
|
||||||
|
|
||||||
|
foreach (var boostRelatedValue in powerUp.Boost.RelatedValues)
|
||||||
|
{
|
||||||
|
var boostRelatedValueCopy = context.CreateNew<AttributeRelationship>();
|
||||||
|
boostRelatedValueCopy.InputAttribute = boostRelatedValue.InputAttribute!.GetPersistent(gameConfiguration);
|
||||||
|
boostRelatedValueCopy.InputOperator = boostRelatedValue.InputOperator;
|
||||||
|
boostRelatedValueCopy.InputOperand = boostRelatedValue.InputOperand;
|
||||||
|
boostRelatedValueCopy.AggregateType = boostRelatedValue.AggregateType;
|
||||||
|
powerUpCopy.Boost.RelatedValues.Add(boostRelatedValueCopy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var critChancePowerUp = context.CreateNew<PowerUpDefinition>();
|
||||||
|
magicEffect.PowerUpDefinitions.Add(critChancePowerUp);
|
||||||
|
critChancePowerUp.TargetAttribute = Stats.CriticalDamageChance.GetPersistent(gameConfiguration);
|
||||||
|
critChancePowerUp.Boost = context.CreateNew<PowerUpDefinitionValue>();
|
||||||
|
|
||||||
|
return magicEffect;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -479,7 +479,7 @@ public enum UpdateVersion
|
|||||||
/// The version of the <see cref="AddIsQuestItemFlagPlugIn"/>.
|
/// The version of the <see cref="AddIsQuestItemFlagPlugIn"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
AddIsQuestItemFlag = 94,
|
AddIsQuestItemFlag = 94,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The version of the <see cref="AddImperialWeapons050UpdateSeason6"/>.
|
/// The version of the <see cref="AddImperialWeapons050UpdateSeason6"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -514,4 +514,9 @@ public enum UpdateVersion
|
|||||||
/// The version of the <see cref="AddElfSoldierBuffPlugIn"/>.
|
/// The version of the <see cref="AddElfSoldierBuffPlugIn"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
AddElfSoldierBuff = 101,
|
AddElfSoldierBuff = 101,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The version of the <see cref="FinishDarkWizardMasterTreePlugIn"/>.
|
||||||
|
/// </summary>
|
||||||
|
FinishDarkWizardMasterTree = 102,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ internal class SkillsInitializer : SkillsInitializerBase
|
|||||||
{ SkillNumber.EarthshakeMastery, MagicEffectNumber.Stunned },
|
{ SkillNumber.EarthshakeMastery, MagicEffectNumber.Stunned },
|
||||||
{ SkillNumber.CritDmgIncPowUp3, MagicEffectNumber.CriticalDamageIncreaseMastery },
|
{ SkillNumber.CritDmgIncPowUp3, MagicEffectNumber.CriticalDamageIncreaseMastery },
|
||||||
{ SkillNumber.SwellLifeProficiency, MagicEffectNumber.GreaterFortitudeProficiency },
|
{ SkillNumber.SwellLifeProficiency, MagicEffectNumber.GreaterFortitudeProficiency },
|
||||||
|
{ SkillNumber.ExpansionofWizStreng, MagicEffectNumber.WizEnhanceStrengthener },
|
||||||
|
{ SkillNumber.ExpansionofWizMas, MagicEffectNumber.WizEnhanceMastery },
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly IDictionary<byte, MasterSkillRoot> _masterSkillRoots;
|
private readonly IDictionary<byte, MasterSkillRoot> _masterSkillRoots;
|
||||||
@@ -701,6 +703,8 @@ internal class SkillsInitializer : SkillsInitializerBase
|
|||||||
new StunEffectInitializer(this.Context, this.GameConfiguration).Initialize();
|
new StunEffectInitializer(this.Context, this.GameConfiguration).Initialize();
|
||||||
new CriticalDamageIncreaseMasteryEffectInitializer(this.Context, this.GameConfiguration).Initialize();
|
new CriticalDamageIncreaseMasteryEffectInitializer(this.Context, this.GameConfiguration).Initialize();
|
||||||
new LifeSwellProficiencyEffectInitializer(this.Context, this.GameConfiguration).Initialize();
|
new LifeSwellProficiencyEffectInitializer(this.Context, this.GameConfiguration).Initialize();
|
||||||
|
new WizardryEnhanceStrengthenerEffectInitializer(this.Context, this.GameConfiguration).Initialize();
|
||||||
|
new WizardryEnhanceMasteryEffectInitializer(this.Context, this.GameConfiguration).Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MapSkillsToEffects()
|
private void MapSkillsToEffects()
|
||||||
@@ -800,7 +804,7 @@ internal class SkillsInitializer : SkillsInitializerBase
|
|||||||
this.AddMasterSkillDefinition(SkillNumber.ExpansionofWizStreng, SkillNumber.ExpansionofWizardry, SkillNumber.Undefined, 2, 2, SkillNumber.ExpansionofWizardry, 20, Formula120Value, Formula120, Stats.MaximumWizBaseDmg, AggregateType.Multiplicate);
|
this.AddMasterSkillDefinition(SkillNumber.ExpansionofWizStreng, SkillNumber.ExpansionofWizardry, SkillNumber.Undefined, 2, 2, SkillNumber.ExpansionofWizardry, 20, Formula120Value, Formula120, Stats.MaximumWizBaseDmg, AggregateType.Multiplicate);
|
||||||
this.AddMasterSkillDefinition(SkillNumber.InfernoStrengthener, SkillNumber.Inferno, SkillNumber.FlameStrengthener, 2, 3, SkillNumber.Inferno, 20, Formula502);
|
this.AddMasterSkillDefinition(SkillNumber.InfernoStrengthener, SkillNumber.Inferno, SkillNumber.FlameStrengthener, 2, 3, SkillNumber.Inferno, 20, Formula502);
|
||||||
this.AddMasterSkillDefinition(SkillNumber.BlastStrengthener, SkillNumber.Cometfall, SkillNumber.LightningStrengthener, 2, 3, SkillNumber.Cometfall, 20, Formula502);
|
this.AddMasterSkillDefinition(SkillNumber.BlastStrengthener, SkillNumber.Cometfall, SkillNumber.LightningStrengthener, 2, 3, SkillNumber.Cometfall, 20, Formula502);
|
||||||
this.AddMasterSkillDefinition(SkillNumber.ExpansionofWizMas, SkillNumber.ExpansionofWizStreng, SkillNumber.Undefined, 2, 3, SkillNumber.ExpansionofWizardry, 20, Formula120Value, Formula120, targetAttribute: Stats.CriticalDamageChance, AggregateType.Multiplicate);
|
this.AddMasterSkillDefinition(SkillNumber.ExpansionofWizMas, SkillNumber.ExpansionofWizStreng, SkillNumber.Undefined, 2, 3, SkillNumber.ExpansionofWizStreng, 20, Formula120Value, Formula120, Stats.CriticalDamageChance, AggregateType.AddRaw);
|
||||||
this.AddMasterSkillDefinition(SkillNumber.PoisonStrengthener, SkillNumber.Poison, SkillNumber.Undefined, 2, 3, SkillNumber.Poison, 20, Formula632);
|
this.AddMasterSkillDefinition(SkillNumber.PoisonStrengthener, SkillNumber.Poison, SkillNumber.Undefined, 2, 3, SkillNumber.Poison, 20, Formula632);
|
||||||
this.AddMasterSkillDefinition(SkillNumber.EvilSpiritStreng, SkillNumber.EvilSpirit, SkillNumber.Undefined, 2, 4, SkillNumber.EvilSpirit, 20, Formula502);
|
this.AddMasterSkillDefinition(SkillNumber.EvilSpiritStreng, SkillNumber.EvilSpirit, SkillNumber.Undefined, 2, 4, SkillNumber.EvilSpirit, 20, Formula502);
|
||||||
this.AddPassiveMasterSkillDefinition(SkillNumber.MagicMasteryGrandMaster, Stats.WizardryBaseDmg, AggregateType.AddRaw, Formula502, 4, 2, SkillNumber.EvilSpiritStreng);
|
this.AddPassiveMasterSkillDefinition(SkillNumber.MagicMasteryGrandMaster, Stats.WizardryBaseDmg, AggregateType.AddRaw, Formula502, 4, 2, SkillNumber.EvilSpiritStreng);
|
||||||
|
|||||||
Reference in New Issue
Block a user