-
Notifications
You must be signed in to change notification settings - Fork 492
DL Master Skill Tree Attack Skills Completion #750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
dedccb6
5804748
0d12433
1b57baf
bfbb7eb
eef9f8b
c121c67
6e19145
9052c34
4bcab35
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ public async ValueTask AfterTargetGotAttackedAsync(IAttacker attacker, IAttackab | |
| } | ||
|
|
||
| var currentDistance = startingPoint.EuclideanDistanceTo(currentTarget); | ||
| while (currentDistance < skillEntry.Skill.Range) | ||
| for (int i = 0; i < 3; i++) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| { | ||
| var nextTarget = currentTarget.CalculateTargetPoint(direction); | ||
| if (!currentMap.Terrain.WalkMap[nextTarget.X, nextTarget.Y] | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| // <copyright file="FireScreamSkillPlugIn.cs" company="MUnique"> | ||
| // Licensed under the MIT License. See LICENSE file in the project root for full license information. | ||
| // </copyright> | ||
|
|
||
| namespace MUnique.OpenMU.GameLogic.PlayerActions.Skills; | ||
|
|
||
| using System.Runtime.InteropServices; | ||
| using MUnique.OpenMU.GameLogic.Attributes; | ||
| using MUnique.OpenMU.GameLogic.GuildWar; | ||
| using MUnique.OpenMU.GameLogic.NPC; | ||
| using MUnique.OpenMU.GameLogic.PlugIns; | ||
| using MUnique.OpenMU.Pathfinding; | ||
| using MUnique.OpenMU.PlugIns; | ||
|
|
||
| /// <summary> | ||
| /// Handles the fire scream skill of the dark lord class. Based on a chance, it does an additional damage (explosion) to any targets in a radius which origin is the target itself. | ||
| /// </summary> | ||
| [PlugIn] | ||
| [Display(Name = nameof(PlugInResources.FireScreamSkillPlugIn_Name), Description = nameof(PlugInResources.FireScreamSkillPlugIn_Description), ResourceType = typeof(PlugInResources))] | ||
| [Guid("7E2F9B4A-D6C1-4F8E-A3B5-21E8C7F9D541")] | ||
| public class FireScreamSkillPlugIn : IAreaSkillPlugIn | ||
| { | ||
| /// <inheritdoc /> | ||
| public short Key => 78; | ||
|
|
||
| private short Radius => 2; | ||
|
|
||
| /// <inheritdoc /> | ||
| public async ValueTask AfterTargetGotAttackedAsync(IAttacker attacker, IAttackable target, SkillEntry skillEntry, Point targetAreaCenter, HitInfo? hitInfo) | ||
| { | ||
| if (hitInfo is not { } hit || !Rand.NextRandomBool(0.3)) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| var attackDamage = hit.HealthDamage + hit.ShieldDamage; | ||
| var explosionDamage = attackDamage / 10; | ||
| if (explosionDamage < 1) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| bool FilterTarget(IAttackable attackable) | ||
| { | ||
| if (attackable == attacker) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| if (attackable is Monster { SummonedBy: null } or Destructible) | ||
| { | ||
| return true; | ||
| } | ||
|
|
||
| if (attackable is Monster { SummonedBy: not null } summoned) | ||
| { | ||
| return FilterTarget(summoned.SummonedBy); | ||
| } | ||
|
|
||
| if (attackable is Player { DuelRoom.State: DuelState.DuelStarted } targetPlayer | ||
| && attacker is Player { DuelRoom.State: DuelState.DuelStarted } duelPlayer | ||
| && targetPlayer.DuelRoom == duelPlayer.DuelRoom | ||
| && targetPlayer.DuelRoom.IsDuelist(targetPlayer) && targetPlayer.DuelRoom.IsDuelist(duelPlayer)) | ||
| { | ||
| return true; | ||
| } | ||
|
|
||
| if (attackable is Player { GuildWarContext.State: GuildWarState.Started } guildWarTarget | ||
| && attacker is Player { GuildWarContext.State: GuildWarState.Started } guildWarAttacker | ||
| && guildWarTarget.GuildWarContext == guildWarAttacker.GuildWarContext) | ||
| { | ||
| return true; | ||
| } | ||
|
|
||
| return false; | ||
| } | ||
|
|
||
| var explosionTargets = target.CurrentMap? | ||
| .GetAttackablesInRange(target.Position, this.Radius) | ||
| .Where(a => a.GetDistanceTo(target) <= this.Radius) | ||
| .Where(FilterTarget) ?? []; | ||
| if (!explosionTargets.Any()) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| // Delay the explosion a little bit, so the client can show the hit values staggered | ||
| await Task.Delay(100).ConfigureAwait(false); | ||
|
|
||
| foreach (var explosionTarget in explosionTargets) | ||
| { | ||
| if (explosionTarget.IsActive()) | ||
| { | ||
| // We just need to apply the damage, so we can resort to the bleeding damage method which has DamageAttributes.Undefined | ||
| await explosionTarget.ApplyBleedingDamageAsync(attacker, explosionDamage).ConfigureAwait(false); | ||
| } | ||
| } | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,10 +32,12 @@ public override void Initialize() | |
| magicEffect.Number = (byte)MagicEffectNumber.CriticalDamageIncrease; | ||
| magicEffect.Name = "Critical Damage Increase Skill Effect"; | ||
| magicEffect.InformObservers = true; | ||
| magicEffect.SubType = 17; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| magicEffect.SendDuration = false; | ||
| magicEffect.StopByDeath = true; | ||
| magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.Duration.ConstantValue.Value = 60f; | ||
| magicEffect.Duration.MaximumValue = 180f; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| var durationPerEnergy = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationPerEnergy.InputAttribute = Stats.TotalEnergy.GetPersistent(this.GameConfiguration); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| // <copyright file="CriticalDamageIncreaseMasteryEffectInitializer.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 critical damage increase mastery effect. | ||
| /// </summary> | ||
| public class CriticalDamageIncreaseMasteryEffectInitializer : InitializerBase | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="CriticalDamageIncreaseMasteryEffectInitializer"/> class. | ||
| /// </summary> | ||
| /// <param name="context">The context.</param> | ||
| /// <param name="gameConfiguration">The game configuration.</param> | ||
| public CriticalDamageIncreaseMasteryEffectInitializer(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.CriticalDamageIncreaseMastery; | ||
| magicEffect.Name = "Critical Damage Increase Mastery Skill Effect"; | ||
|
|
||
| var critDmgIncEffect = this.GameConfiguration.MagicEffects.First(e => e.Number == (short)MagicEffectNumber.CriticalDamageIncrease); | ||
| magicEffect.InformObservers = critDmgIncEffect.InformObservers; | ||
| magicEffect.SubType = critDmgIncEffect.SubType; | ||
| magicEffect.SendDuration = critDmgIncEffect.SendDuration; | ||
| magicEffect.StopByDeath = critDmgIncEffect.StopByDeath; | ||
| magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.Duration.ConstantValue.Value = critDmgIncEffect.Duration!.ConstantValue.Value; | ||
| magicEffect.Duration.MaximumValue = critDmgIncEffect.Duration.MaximumValue; | ||
|
|
||
| foreach (var durationRelatedValue in critDmgIncEffect.Duration.RelatedValues) | ||
| { | ||
| var durationRelatedValueCopy = this.Context.CreateNew<AttributeRelationship>(); | ||
| durationRelatedValueCopy.InputAttribute = durationRelatedValue.InputAttribute!.GetPersistent(this.GameConfiguration); | ||
| durationRelatedValueCopy.InputOperator = durationRelatedValue.InputOperator; | ||
| durationRelatedValueCopy.InputOperand = durationRelatedValue.InputOperand; | ||
| magicEffect.Duration.RelatedValues.Add(durationRelatedValueCopy); | ||
| } | ||
|
|
||
| foreach (var powerUp in critDmgIncEffect.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; | ||
|
|
||
| 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; | ||
| powerUpCopy.Boost.RelatedValues.Add(boostRelatedValueCopy); | ||
| } | ||
| } | ||
|
|
||
| var critChancePowerUpDefinition = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitions.Add(critChancePowerUpDefinition); | ||
| critChancePowerUpDefinition.TargetAttribute = Stats.CriticalDamageChance.GetPersistent(this.GameConfiguration); | ||
| critChancePowerUpDefinition.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| critChancePowerUpDefinition.Boost.ConstantValue.Value = 0; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -326,6 +326,11 @@ internal enum MagicEffectNumber : short | |
| /// </summary> | ||
| WizEnhance3 = 139, | ||
|
|
||
| /// <summary> | ||
| /// The critical damage increase mastery effect. | ||
| /// </summary> | ||
| CriticalDamageIncreaseMastery = 148, | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| #region Artificial effects which are not sent to the client, starting at 200. | ||
|
|
||
| /// <summary> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,11 +33,20 @@ public override void Initialize() | |
| magicEffect.InformObservers = true; | ||
| magicEffect.SendDuration = false; | ||
| magicEffect.StopByDeath = true; | ||
| magicEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| magicEffect.Duration.ConstantValue.Value = 2; // 2 seconds | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| var isStunnedPowerUpDefinition = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitions.Add(isStunnedPowerUpDefinition); | ||
| isStunnedPowerUpDefinition.TargetAttribute = Stats.IsStunned.GetPersistent(this.GameConfiguration); | ||
| isStunnedPowerUpDefinition.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| isStunnedPowerUpDefinition.Boost.ConstantValue.Value = 1; | ||
|
|
||
| // Placeholder for master skills that use this effect | ||
| var stunChancePowerUpDefinition = this.Context.CreateNew<PowerUpDefinition>(); | ||
| magicEffect.PowerUpDefinitions.Add(stunChancePowerUpDefinition); | ||
| stunChancePowerUpDefinition.TargetAttribute = Stats.StunChance.GetPersistent(this.GameConfiguration); | ||
| stunChancePowerUpDefinition.Boost = this.Context.CreateNew<PowerUpDefinitionValue>(); | ||
| stunChancePowerUpDefinition.Boost.ConstantValue.Value = 0; | ||
| } | ||
| } | ||



There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zTeamS6.3, emu