-
Notifications
You must be signed in to change notification settings - Fork 93
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
Outlaw's skills #333
Open
Terotrous
wants to merge
8
commits into
NoCode-NoLife:master
Choose a base branch
from
Terotrous:Outlaw
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Outlaw's skills #333
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b0ec1a1
Adding the first few Outlaw skills
Terotrous 3439644
Adding the rest of the skills
Terotrous 6d16537
Adding the rest of the abilities
Terotrous c64ed2e
Fixing the file name for mangle
Terotrous 69d4ba8
Cleaning up folders
Terotrous d1ab126
Readding files
Terotrous 03b9fd9
Cleaning up folders
Terotrous 12deb84
Readding files
Terotrous File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Melia.Shared.Game.Const; | ||
using Melia.Zone.Buffs.Base; | ||
using Melia.Zone.World.Actors; | ||
using Melia.Zone.World.Actors.Components; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Common | ||
{ | ||
/// <summary> | ||
/// Handle for the Silence Debuff, which prevents taking any action | ||
/// </summary> | ||
[BuffHandler(BuffId.Common_Silence)] | ||
public class Common_Silence : BuffHandler | ||
{ | ||
public override void OnExtend(Buff buff) | ||
{ | ||
buff.Target.AddState(StateType.Stunned, buff.Duration); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/ZoneServer/Buffs/Handlers/Common/Skill_MomentaryEvasion_Buff.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Melia.Shared.Data.Database; | ||
using Melia.Shared.Game.Const; | ||
using Melia.Zone.Buffs.Base; | ||
using Melia.Zone.Skills; | ||
using Melia.Zone.Skills.Combat; | ||
using Melia.Zone.World.Actors; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Common | ||
{ | ||
/// <summary> | ||
/// Contains code related to the Momentary Block Buff | ||
/// </summary> | ||
/// <remarks> | ||
/// This buff is granted by certain skills and causes you to always | ||
/// evade for a duration. | ||
/// </remarks> | ||
[BuffHandler(BuffId.Skill_MomentaryEvasion_Buff)] | ||
public class Skill_MomentaryEvasion_Buff : BuffHandler, IBuffCombatDefenseBeforeCalcHandler | ||
{ | ||
/// <summary> | ||
/// Applies the buff's effect during the combat calculations. | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
/// <param name="attacker"></param> | ||
/// <param name="target"></param> | ||
/// <param name="skill"></param> | ||
/// <param name="modifier"></param> | ||
/// <param name="skillHitResult"></param> | ||
public void OnDefenseBeforeCalc(Buff buff, ICombatEntity attacker, ICombatEntity target, Skill skill, SkillModifier modifier, SkillHitResult skillHitResult) | ||
{ | ||
modifier.ForcedEvade = true; | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/ZoneServer/Buffs/Handlers/Scouts/OutLaw/Aggress_Buff.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Melia.Shared.Game.Const; | ||
using Melia.Zone.Buffs.Base; | ||
using Melia.Zone.Network; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Scouts.OutLaw | ||
{ | ||
/// <summary> | ||
/// Handler for Aggress Buff, which massively increases movement speed | ||
/// </summary> | ||
[BuffHandler(BuffId.Aggress_Buff)] | ||
public class Aggress_Buff : BuffHandler | ||
{ | ||
private const float MspdBonus = 30f; | ||
|
||
/// <summary> | ||
/// Starts buff, modifying the movement speed | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnActivate(Buff buff, ActivationType activationType) | ||
{ | ||
var target = buff.Target; | ||
|
||
AddPropertyModifier(buff, target, PropertyName.MSPD_BM, MspdBonus); | ||
Send.ZC_MSPD(target); | ||
} | ||
|
||
/// <summary> | ||
/// Ends the buff, resetting the movement speed | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnEnd(Buff buff) | ||
{ | ||
RemovePropertyModifier(buff, buff.Target, PropertyName.MSPD_BM); | ||
Send.ZC_MSPD(buff.Target); | ||
} | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
src/ZoneServer/Buffs/Handlers/Scouts/OutLaw/Aggress_Debuff.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Melia.Shared.Game.Const; | ||
using Melia.Zone.Buffs.Base; | ||
using Melia.Zone.Network; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Scouts.OutLaw | ||
{ | ||
/// <summary> | ||
/// Handler for Break Brick Debuff, which reduces Evasion | ||
/// </summary> | ||
/// <remarks> | ||
/// NumArg1: Skill Level | ||
/// NumArg2: Unhinge Level | ||
/// This is related to Outlaw13, which changes the buff effect to | ||
/// also increase movement speed but decrease accuracy | ||
/// </remarks> | ||
[BuffHandler(BuffId.Aggress_Debuff)] | ||
internal class Aggress_Debuff : BuffHandler | ||
{ | ||
private const float DRPenaltyPerLevel = 0.02f; | ||
private const float HRPenaltyPerLevel = 0.03f; | ||
private const float MspdBonus = 5f; | ||
|
||
/// <summary> | ||
/// Starts buff, reducing Dodge Rate | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnActivate(Buff buff, ActivationType activationType) | ||
{ | ||
var reduceDR = buff.Target.Properties.GetFloat(PropertyName.DR) * buff.NumArg1 * DRPenaltyPerLevel; | ||
|
||
AddPropertyModifier(buff, buff.Target, PropertyName.DR_BM, -reduceDR); | ||
|
||
if (buff.NumArg2 > 0) | ||
{ | ||
var reduceHR = buff.Target.Properties.GetFloat(PropertyName.HR) * buff.NumArg2 * HRPenaltyPerLevel; | ||
|
||
AddPropertyModifier(buff, buff.Target, PropertyName.HR_BM, -reduceHR); | ||
AddPropertyModifier(buff, buff.Target, PropertyName.MSPD_BM, MspdBonus); | ||
Send.ZC_MSPD(buff.Target); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Ends the buff, resetting dodge rate. | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnEnd(Buff buff) | ||
{ | ||
RemovePropertyModifier(buff, buff.Target, PropertyName.DR_BM); | ||
|
||
if (buff.NumArg2 > 0) | ||
{ | ||
RemovePropertyModifier(buff, buff.Target, PropertyName.HR_BM); | ||
RemovePropertyModifier(buff, buff.Target, PropertyName.MSPD_BM); | ||
Send.ZC_MSPD(buff.Target); | ||
} | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/ZoneServer/Buffs/Handlers/Scouts/OutLaw/BreakBrick_Debuff.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Melia.Shared.Game.Const; | ||
using Melia.Zone.Buffs.Base; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Scouts.OutLaw | ||
{ | ||
/// <summary> | ||
/// Handler for Break Brick Debuff, which reduces Crit Chance | ||
/// </summary> | ||
/// <remarks> | ||
/// NumArg1: Skill Level | ||
/// NumArg2: None | ||
/// </remarks> | ||
[BuffHandler(BuffId.BreakBrick_Debuff)] | ||
internal class BreakBrick_Debuff : BuffHandler | ||
{ | ||
private const float CRTPenaltyPerLevel = 1f; | ||
|
||
/// <summary> | ||
/// Starts buff, reducing Crit rate | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnActivate(Buff buff, ActivationType activationType) | ||
{ | ||
var reduceCrt = buff.Target.Properties.GetFloat(PropertyName.CRTHR) * buff.NumArg1 * CRTPenaltyPerLevel; | ||
|
||
AddPropertyModifier(buff, buff.Target, PropertyName.CRTHR_BM, -reduceCrt); | ||
} | ||
|
||
/// <summary> | ||
/// Ends the buff, resetting Crit rate. | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnEnd(Buff buff) | ||
{ | ||
RemovePropertyModifier(buff, buff.Target, PropertyName.CRTHR_BM); | ||
} | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
src/ZoneServer/Buffs/Handlers/Scouts/OutLaw/BullyPainBarrier_Buff.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
using System; | ||
using Melia.Shared.Game.Const; | ||
using Melia.Zone.Buffs.Base; | ||
using Melia.Zone.Scripting.AI; | ||
using Melia.Zone.Skills; | ||
using Melia.Zone.Skills.Combat; | ||
using Melia.Zone.World.Actors; | ||
using Melia.Zone.World.Actors.CombatEntities.Components; | ||
using Melia.Zone.World.Actors.Monsters; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Scouts.OutLaw | ||
{ | ||
/// <summary> | ||
/// Buff handler for Bully Pain Barrier Buff, which increases evasion | ||
/// and adds threat on successful evade | ||
/// It's completely identical to Bully Buff except that it also | ||
/// grants immunity to knockback and Outlaw12's effect is nerfed | ||
/// </summary> | ||
/// <remarks> | ||
/// NumArg1: Skill Level | ||
/// NumArg2: None | ||
/// </remarks> | ||
[BuffHandler(BuffId.BullyPainBarrier_Buff)] | ||
public class BullyPainBarrier_Buff : BuffHandler, IBuffCombatDefenseAfterCalcHandler | ||
{ | ||
private const float DrBuffRateBase = 0.24f; | ||
private const float DrBuffRatePerLevel = 0.04f; | ||
private const float HatePerLevel = 3f; | ||
|
||
/// <summary> | ||
/// Starts buff, increasing dodge rate. | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnActivate(Buff buff, ActivationType activationType) | ||
{ | ||
var dr = buff.Target.Properties.GetFloat(PropertyName.DR); | ||
var skillLevel = buff.NumArg1; | ||
var rate = DrBuffRateBase + DrBuffRatePerLevel * skillLevel; | ||
var bonus = dr * rate; | ||
|
||
AddPropertyModifier(buff, buff.Target, PropertyName.DR_BM, bonus); | ||
} | ||
|
||
/// <summary> | ||
/// Ends the buff, resetting dodge rate. | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnEnd(Buff buff) | ||
{ | ||
RemovePropertyModifier(buff, buff.Target, PropertyName.DR_BM); | ||
} | ||
|
||
/// <summary> | ||
/// Applies the buff's effect during the combat calculations. | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
/// <param name="attacker"></param> | ||
/// <param name="target"></param> | ||
/// <param name="skill"></param> | ||
/// <param name="modifier"></param> | ||
/// <param name="skillHitResult"></param> | ||
public void OnDefenseAfterCalc(Buff buff, ICombatEntity attacker, ICombatEntity target, Skill skill, SkillModifier modifier, SkillHitResult skillHitResult) | ||
{ | ||
if (skillHitResult.Result == HitResultType.Dodge && attacker.Components.TryGet<AiComponent>(out var component)) | ||
{ | ||
component.Script.QueueEventAlert(new HateIncreaseAlert(target, buff.NumArg1 * HatePerLevel)); | ||
|
||
// Outlaw12 adds additional duration to the buff on successful evade | ||
// For Pain Barrier buff, the maximum increase is 2 seconds | ||
if (target.TryGetActiveAbilityLevel(AbilityId.Outlaw12, out var level)) | ||
{ | ||
buff.IncreaseDuration(TimeSpan.FromSeconds(Math.Max(level, 2))); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using System; | ||
using Melia.Shared.Game.Const; | ||
using Melia.Zone.Buffs.Base; | ||
using Melia.Zone.Scripting.AI; | ||
using Melia.Zone.Skills; | ||
using Melia.Zone.Skills.Combat; | ||
using Melia.Zone.World.Actors; | ||
using Melia.Zone.World.Actors.CombatEntities.Components; | ||
using Melia.Zone.World.Actors.Monsters; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Scouts.OutLaw | ||
{ | ||
/// <summary> | ||
/// Buff handler for Bully Buff, which increases evasion | ||
/// and adds threat on successful evade | ||
/// </summary> | ||
/// <remarks> | ||
/// NumArg1: Skill Level | ||
/// NumArg2: None | ||
/// </remarks> | ||
[BuffHandler(BuffId.Bully_Buff)] | ||
public class Bully_Buff : BuffHandler, IBuffCombatDefenseAfterCalcHandler | ||
{ | ||
private const float DrBuffRateBase = 0.24f; | ||
private const float DrBuffRatePerLevel = 0.04f; | ||
private const float HatePerLevel = 3f; | ||
|
||
/// <summary> | ||
/// Starts buff, increasing dodge rate. | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnActivate(Buff buff, ActivationType activationType) | ||
{ | ||
var dr = buff.Target.Properties.GetFloat(PropertyName.DR); | ||
var skillLevel = buff.NumArg1; | ||
var rate = DrBuffRateBase + DrBuffRatePerLevel * skillLevel; | ||
var bonus = dr * rate; | ||
|
||
AddPropertyModifier(buff, buff.Target, PropertyName.DR_BM, bonus); | ||
} | ||
|
||
/// <summary> | ||
/// Ends the buff, resetting dodge rate. | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnEnd(Buff buff) | ||
{ | ||
RemovePropertyModifier(buff, buff.Target, PropertyName.DR_BM); | ||
} | ||
|
||
/// <summary> | ||
/// Applies the buff's effect during the combat calculations. | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
/// <param name="attacker"></param> | ||
/// <param name="target"></param> | ||
/// <param name="skill"></param> | ||
/// <param name="modifier"></param> | ||
/// <param name="skillHitResult"></param> | ||
public void OnDefenseAfterCalc(Buff buff, ICombatEntity attacker, ICombatEntity target, Skill skill, SkillModifier modifier, SkillHitResult skillHitResult) | ||
{ | ||
if (skillHitResult.Result == HitResultType.Dodge && attacker.Components.TryGet<AiComponent>(out var component)) | ||
{ | ||
component.Script.QueueEventAlert(new HateIncreaseAlert(target, buff.NumArg1 * HatePerLevel)); | ||
|
||
// Outlaw12 adds additional duration to the buff on successful evade | ||
// Note that it only applies to monster attacks, which is why | ||
// it's done after the AI script check | ||
if (target.TryGetActiveAbilityLevel(AbilityId.Outlaw12, out var level)) | ||
{ | ||
buff.IncreaseDuration(TimeSpan.FromSeconds(level)); | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Probably better to merge
IncreaseDuration()
andExtendDuration()
into a single method.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.
I agree this is somewhat confusing and maybe the description should have been a little more clear, but ExtendDuration has several features we don't want here, most particularly that it resets the updatetime on the buff. We probably don't want to constantly call onExtend here either.