-
Notifications
You must be signed in to change notification settings - Fork 98
Adding the rest of Assassin's Skills and Abilities #334
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
Open
Terotrous
wants to merge
4
commits into
NoCode-NoLife:master
Choose a base branch
from
Terotrous:Assassin
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
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
35 changes: 35 additions & 0 deletions
35
src/ZoneServer/Buffs/Handlers/Scouts/Assassin/Assassin_Target_Debuff.cs
This file contains hidden or 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,35 @@ | ||
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; | ||
using Melia.Zone.World.Actors; | ||
using Melia.Zone.World.Actors.Characters; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Scouts.Assassin | ||
{ | ||
/// <summary> | ||
/// Handler for Assassin Target debuff, which can only | ||
/// be applied to a single target and needs to clean | ||
/// itself up when it ends | ||
/// </summary> | ||
[BuffHandler(BuffId.Assassin_Target_Debuff)] | ||
internal class Assassin_Target_Debuff : BuffHandler | ||
{ | ||
/// <summary> | ||
/// Remove the variable from the caster when the buff ends, | ||
/// assuming this entity is still the target | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnEnd(Buff buff) | ||
{ | ||
var targetHandle = buff.Target.Handle; | ||
var caster = buff.Caster; | ||
if (caster is Character character && character != null && character.Variables.Temp.TryGetInt("Melia.AssassinationTarget", out var assassinationTarget) && assassinationTarget == targetHandle) | ||
character.Variables.Temp.Remove("Melia.AssassinationTarget"); | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/ZoneServer/Buffs/Handlers/Scouts/Assassin/HallucinationSmoke_Buff.cs
This file contains hidden or 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,46 @@ | ||
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; | ||
using Melia.Zone.World.Actors; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Scouts.Assassin | ||
{ | ||
/// <summary> | ||
/// Handler for Hallucination Smoke Buff, which raises crit rate | ||
/// </summary> | ||
/// <remarks> | ||
/// NumArg1: Skill Level | ||
/// NumArg2: Unused | ||
/// </remarks> | ||
[BuffHandler(BuffId.HallucinationSmoke_Buff)] | ||
internal class HallucinationSmoke_Buff : BuffHandler | ||
{ | ||
// Official bonus rate is unknown | ||
private const float CRTHRBonus = 0.2f; | ||
|
||
/// <summary> | ||
/// Starts buff, increasing Crit Rate | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnActivate(Buff buff, ActivationType activationType) | ||
{ | ||
var CRTHRbuff = buff.Target.Properties.GetFloat(PropertyName.CRTHR) * CRTHRBonus; | ||
|
||
AddPropertyModifier(buff, buff.Target, PropertyName.CRTHR_BM, CRTHRbuff); | ||
} | ||
|
||
/// <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); | ||
} | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
src/ZoneServer/Buffs/Handlers/Scouts/Assassin/HallucinationSmoke_Debuff.cs
This file contains hidden or 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,60 @@ | ||
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; | ||
using Melia.Zone.World.Actors; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Scouts.Assassin | ||
{ | ||
/// <summary> | ||
/// Handler for Hallucination Smoke Debuff, which reduces | ||
/// Accuracy and Evasion | ||
/// </summary> | ||
/// <remarks> | ||
/// NumArg1: Skill Level | ||
/// NumArg2: Damage to take when buff ends | ||
/// </remarks> | ||
[BuffHandler(BuffId.HallucinationSmoke_Debuff)] | ||
internal class HallucinationSmoke_Debuff : BuffHandler | ||
{ | ||
private const float DRPenaltyRate = 0.2f; | ||
private const float HRPenaltyRate = 0.2f; | ||
|
||
/// <summary> | ||
/// Starts buff, reducing Hit and Dodge Rate | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnActivate(Buff buff, ActivationType activationType) | ||
{ | ||
var reduceDR = buff.Target.Properties.GetFloat(PropertyName.DR) * DRPenaltyRate; | ||
var reduceHR = buff.Target.Properties.GetFloat(PropertyName.HR) * HRPenaltyRate; | ||
|
||
AddPropertyModifier(buff, buff.Target, PropertyName.DR_BM, -reduceDR); | ||
AddPropertyModifier(buff, buff.Target, PropertyName.HR_BM, -reduceHR); | ||
} | ||
|
||
/// <summary> | ||
/// Ends the buff, resetting hit and dodge rate, and | ||
/// potentially dealing damage | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnEnd(Buff buff) | ||
{ | ||
RemovePropertyModifier(buff, buff.Target, PropertyName.DR_BM); | ||
RemovePropertyModifier(buff, buff.Target, PropertyName.HR_BM); | ||
|
||
if (buff.NumArg2 > 0 && !buff.Target.IsDead) | ||
{ | ||
var attacker = buff.Caster; | ||
var target = buff.Target; | ||
var damage = buff.NumArg2; | ||
|
||
target.TakeSimpleHit(damage, attacker, SkillId.None); | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or 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
46 changes: 46 additions & 0 deletions
46
src/ZoneServer/Buffs/Handlers/Scouts/Assassin/PiercingHeart_Buff.cs
This file contains hidden or 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,46 @@ | ||
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; | ||
using Melia.Zone.World.Actors; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Scouts.Assassin | ||
{ | ||
/// <summary> | ||
/// Handler for Piercing Heart Buff, which raises crit rate | ||
/// </summary> | ||
/// <remarks> | ||
/// NumArg1: Skill Level | ||
/// NumArg2: Unused | ||
/// </remarks> | ||
[BuffHandler(BuffId.PiercingHeart_Buff)] | ||
internal class PiercingHeart_Buff : BuffHandler | ||
{ | ||
// Official bonus rate is unknown | ||
private const float CRTHRBonus = 0.5f; | ||
|
||
/// <summary> | ||
/// Starts buff, increasing Crit Rate | ||
/// </summary> | ||
/// <param name="buff"></param> | ||
public override void OnActivate(Buff buff, ActivationType activationType) | ||
{ | ||
var CRTHRbuff = buff.Target.Properties.GetFloat(PropertyName.CRTHR) * CRTHRBonus; | ||
|
||
AddPropertyModifier(buff, buff.Target, PropertyName.CRTHR_BM, CRTHRbuff); | ||
} | ||
|
||
/// <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); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/ZoneServer/Buffs/Handlers/Scouts/Assassin/PiercingHeart_Debuff.cs
This file contains hidden or 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,30 @@ | ||
using System; | ||
using Melia.Shared.Game.Const; | ||
using Melia.Zone.Buffs.Base; | ||
using Melia.Zone.World.Actors; | ||
|
||
namespace Melia.Zone.Buffs.Handlers.Scout.Assassin | ||
{ | ||
/// <summary> | ||
/// Handle for the Piercing Heart debuff, which prevents healing | ||
/// </summary> | ||
[BuffHandler(BuffId.PiercingHeart_Debuff)] | ||
public class PiercingHeart_Debuff : BuffHandler | ||
{ | ||
/// <summary> | ||
/// Eliminates all healing if the entity has the piercing heart debuff. | ||
/// </summary> | ||
/// <param name="entity"></param> | ||
/// <param name="hpAmount"></param> | ||
/// <returns></returns> | ||
public static bool TryApply(ICombatEntity entity, ref float hpAmount) | ||
{ | ||
if (!entity.TryGetBuff(BuffId.PiercingHeart_Debuff, out var buff)) | ||
return false; | ||
|
||
hpAmount = 0; | ||
|
||
return true; | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
src/ZoneServer/Pads/Handlers/Scout/Assassin/Assassin_HallucinationSmoke.cs
This file contains hidden or 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,42 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Melia.Shared.Game.Const; | ||
using Melia.Shared.World; | ||
using Melia.Zone.Network; | ||
using Melia.Zone.World.Actors; | ||
using Melia.Zone.World.Actors.Characters; | ||
using Melia.Zone.World.Actors.CombatEntities.Components; | ||
using Melia.Zone.World.Actors.Monsters; | ||
using Melia.Zone.World.Actors.Pads; | ||
using Yggdrasil.Logging; | ||
|
||
namespace Melia.Zone.Pads.Handlers.Scout.Assassin | ||
{ | ||
/// <summary> | ||
/// Handler for the ThrouwingSpear_Hoplite33_Pad, | ||
/// which displays an explosion effect in a given position | ||
/// </summary> | ||
[PadHandler(PadName.Assassin_HallucinationSmoke)] | ||
public class Assassin_HallucinationSmoke : ICreatePadHandler, IDestroyPadHandler | ||
{ | ||
/// <summary> | ||
/// Called when the pad is created. | ||
/// </summary> | ||
/// <param name="sender"></param> | ||
/// <param name="args"></param> | ||
public void Created(object sender, PadTriggerArgs args) | ||
{ | ||
Send.ZC_NORMAL.PadUpdate(args.Creator, args.Trigger, PadName.Assassin_HallucinationSmoke, -0.7853982f, 0, 30, true); | ||
} | ||
|
||
/// <summary> | ||
/// Called when the pad is destroyed. | ||
/// </summary> | ||
/// <param name="sender"></param> | ||
/// <param name="args"></param> | ||
public void Destroyed(object sender, PadTriggerArgs args) | ||
{ | ||
Send.ZC_NORMAL.PadUpdate(args.Creator, args.Trigger, PadName.Assassin_HallucinationSmoke, 0, 145.8735f, 30, false); | ||
} | ||
} | ||
} |
This file contains hidden or 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
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.
Minor description error
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.
Fixed.