-
Notifications
You must be signed in to change notification settings - Fork 98
Sadhu skills #302
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
felipecastagnarodecarvalho
wants to merge
33
commits into
NoCode-NoLife:master
Choose a base branch
from
felipecastagnarodecarvalho:sadhu_skills
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
Sadhu skills #302
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
9d14ab5
Initial Sadhu skill's implementations
felipecastagnarodecarvalho 0f1cfaa
[WIP] Sadhu skills
felipecastagnarodecarvalho 8a0803a
Merge branch 'master' of https://github.com/NoCode-NoLife/melia into …
felipecastagnarodecarvalho cdf1740
Adding the first sadhu Skill - Prakriti
felipecastagnarodecarvalho 01a2f3a
Polishing Prakriti
felipecastagnarodecarvalho bd6a41f
Adding Anila skill
felipecastagnarodecarvalho 3c5e170
Adding Possession skill (sadhu) + skill base class inheritance
felipecastagnarodecarvalho 80ff162
Adding Enira sadhu skill
felipecastagnarodecarvalho 5aa0295
Working on the sadhu arts that creates clones
felipecastagnarodecarvalho 020d514
Small Update (Sadhu)
felipecastagnarodecarvalho cef4651
Merge branch 'master' into sadhu_skills
felipecastagnarodecarvalho 70535a7
[WIP] Sadhu skills tweek
felipecastagnarodecarvalho e2203f0
Messing up with the IA (for dummies)
felipecastagnarodecarvalho d3fba4d
Minor changes Sadhu
felipecastagnarodecarvalho 60bc776
Minor update sadhu
felipecastagnarodecarvalho 507317e
Merging master
felipecastagnarodecarvalho 10cda3d
Updating sadhu dummy AI
felipecastagnarodecarvalho f2b09d5
Merging master
felipecastagnarodecarvalho 2c6492c
Sadhu skills - Working on the hability skills
felipecastagnarodecarvalho 9ede990
Adding last two Sadhu skills
felipecastagnarodecarvalho e6f87ac
Updating skill file names
felipecastagnarodecarvalho 888b8d5
Merging master
felipecastagnarodecarvalho d55e4af
Merge branch 'master' into sadhu_skills
felipecastagnarodecarvalho 73e8c55
[WIP
felipecastagnarodecarvalho 1a49524
Resolving review conversations
felipecastagnarodecarvalho 08bde3b
Merging Upstream Master
felipecastagnarodecarvalho a0075b3
[WIP] Fixing review issues
felipecastagnarodecarvalho 86338ef
Fixing remaining review issues
felipecastagnarodecarvalho 3c9ed92
Initial fixes for review
felipecastagnarodecarvalho 579e41d
Merge branch 'master' of https://github.com/NoCode-NoLife/Melia into …
felipecastagnarodecarvalho 9c4d791
Updating sadhu skills (2) - commiting before pulling from master
felipecastagnarodecarvalho adadead
Merge branch 'master' of https://github.com/NoCode-NoLife/Melia into …
felipecastagnarodecarvalho 845a5f0
Ready for a new review - sadhu updates
felipecastagnarodecarvalho 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 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
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
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 |
|---|---|---|
|
|
@@ -8,5 +8,6 @@ public enum HitType : short | |
| KnockBack = 3, | ||
| KnockDown = 4, | ||
| Type18 = 18, | ||
| Type33 = 33, | ||
| } | ||
| } | ||
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
153 changes: 153 additions & 0 deletions
153
src/ZoneServer/Buffs/Handlers/Clerics/Sadhu/OOBE_Anila_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,153 @@ | ||
| using System; | ||
| using Melia.Shared.Game.Const; | ||
| using Melia.Zone.Buffs.Base; | ||
| using Melia.Zone.Network; | ||
| using Melia.Zone.Skills.Combat; | ||
| using Melia.Zone.Skills; | ||
| using Melia.Zone.Skills.SplashAreas; | ||
| using Melia.Zone.World.Actors; | ||
| using Melia.Zone.World.Actors.Characters; | ||
| using Melia.Zone.World.Actors.Pads; | ||
| using Melia.Zone.World.Actors.Monsters; | ||
| using static Melia.Zone.Skills.SkillUseFunctions; | ||
| using Melia.Shared.World; | ||
|
|
||
| namespace Melia.Zone.Buffs.Handlers.Clerics.Sadhu | ||
| { | ||
| /// <summary> | ||
| /// Handler for the Out Of Body Experience (OOBE) Anila Buff | ||
| /// which makes the character go back to original position after a while | ||
| /// and leave an effect that damages enemies on hit by a wave effect. | ||
| /// </summary> | ||
| [BuffHandler(BuffId.OOBE_Anila_Buff)] | ||
| public class OOBE_Anila_Buff : Sadhu_BuffHandler_Base | ||
| { | ||
| /// <summary> | ||
| /// Starts buff, adding an event handler for | ||
| /// the death of the dummy character. | ||
| /// </summary> | ||
| /// <param name="buff"></param> | ||
| /// <param name="activationType"></param> | ||
| public override void OnActivate(Buff buff, ActivationType activationType) | ||
| { | ||
| var caster = buff.Caster; | ||
|
|
||
| AddPropertyModifier(buff, caster, PropertyName.MSPD_BM, (int)buff.NumArg1); | ||
|
|
||
| // Don't continue if the caster is not a Character | ||
| if (caster is not Character casterCharacter) | ||
| return; | ||
|
|
||
| var dummyCharacter = casterCharacter.Map.GetCharacter((int)buff.NumArg2); | ||
|
|
||
| if (dummyCharacter != null) | ||
| dummyCharacter.Died += this.OnDummyDied; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Executes the buff handler's end behavior. | ||
| /// Does not actually end or remove the buff. | ||
| /// </summary> | ||
| /// <param name="buff"></param> | ||
| public override void OnEnd(Buff buff) | ||
| { | ||
| var caster = buff.Caster; | ||
|
|
||
| RemovePropertyModifier(buff, caster, PropertyName.MSPD_BM); | ||
|
|
||
| // Ignore if the caster is not a Character | ||
| if (caster is not Character casterCharacter) | ||
| return; | ||
|
|
||
| // It spawns an clone character in form of a spirit that is controlled by AI. | ||
| // So we need to identify the Source character that will be used on the buff ending. | ||
| var characterSkillHandling = casterCharacter is DummyCharacter dummyCharacter && dummyCharacter.Owner.IsAbilityActive(AbilityId.Sadhu35) | ||
| ? dummyCharacter.Owner | ||
| : caster; | ||
|
|
||
| // Don't continue if the caster doesn't have the skill. | ||
| if (!characterSkillHandling.TryGetSkill(SkillId.Sadhu_Anila, out var skill)) | ||
| return; | ||
|
|
||
| characterSkillHandling.SetAttackState(true); | ||
|
|
||
| // Creates the Pad that will handles the buff ending effect that damages enemies that touches it. | ||
| var pad = new Pad(PadName.Sadhu_Anila_Effect_Pad, characterSkillHandling, skill, new Square(caster.Position, caster.Direction, 50, 65)); | ||
|
|
||
| pad.Position = new Position(pad.Trigger.Area.Center.X, caster.Position.Y, pad.Trigger.Area.Center.Y); | ||
| pad.Trigger.MaxActorCount = 7; | ||
| pad.Trigger.LifeTime = TimeSpan.FromSeconds(10); | ||
| pad.Trigger.Subscribe(TriggerType.Enter, this.OnCollisionEnter); | ||
|
|
||
| caster.Map.AddPad(pad); | ||
|
|
||
| // [Arts] Spirit Expert: Wandering Soul - AI Controlled Spirit | ||
| if (casterCharacter is DummyCharacter dummyCharacter2 && dummyCharacter2.Owner.IsAbilityActive(AbilityId.Sadhu35)) | ||
| { | ||
| Send.ZC_SKILL_READY(dummyCharacter2.Owner, caster, skill, caster.Position, caster.Position); | ||
| Send.ZC_NORMAL.UpdateSkillEffect(dummyCharacter2.Owner, caster.Handle, caster.Position, caster.Direction, Position.Zero); | ||
| Send.ZC_SKILL_MELEE_GROUND(dummyCharacter2.Owner, caster, skill, caster.Position, ForceId.GetNew(), null); | ||
| } | ||
| else // Spirit was controlled by the player | ||
| { | ||
| skill.IncreaseOverheat(); | ||
| } | ||
|
|
||
| // [Arts] Spirit Expert: Wandering Soul: AI Controlled Spirit | ||
| // Removes the clone character (spirit) from the map. | ||
| if (casterCharacter is DummyCharacter dummyCharacter3 && dummyCharacter3.Owner.IsAbilityActive(AbilityId.Sadhu35)) | ||
| { | ||
| this.RemoveSpritCloneCharacter(dummyCharacter3); | ||
| return; | ||
| } | ||
|
|
||
| Send.ZC_NORMAL.EndOutOfBodyBuff(casterCharacter, BuffId.OOBE_Anila_Buff); | ||
| Send.ZC_NORMAL.UpdateModelColor(casterCharacter, 255, 255, 255, 255, 0.01f); | ||
| Send.ZC_PLAY_SOUND(casterCharacter, "skl_eff_yuchae_end_2"); | ||
|
|
||
| this.ReturnToBody(casterCharacter, (int)buff.NumArg2); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Called when an actor enters the skill's pad area. | ||
| /// </summary> | ||
| /// <param name="sender"></param> | ||
| /// <param name="args"></param> | ||
| private void OnCollisionEnter(object sender, PadTriggerActorArgs args) | ||
| { | ||
| var pad = args.Trigger; | ||
| var creator = args.Creator; | ||
| var target = args.Initiator; | ||
|
|
||
| if (pad.Trigger.AtCapacity) | ||
| return; | ||
|
|
||
| if (!creator.CanAttack(target)) | ||
| return; | ||
|
|
||
| this.Attack(pad.Skill, creator, target); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Pad's attack handler. | ||
| /// </summary> | ||
| /// <param name="skill"></param> | ||
| /// <param name="caster"></param> | ||
| /// <param name="target"></param> | ||
| private void Attack(Skill skill, ICombatEntity caster, ICombatEntity target) | ||
| { | ||
| var dealsDamageCharacter = caster is DummyCharacter dummyCharacter && dummyCharacter.Owner.IsAbilityActive(AbilityId.Sadhu35) | ||
| ? dummyCharacter.Owner | ||
| : caster; | ||
|
|
||
| var modifier = SkillModifier.MultiHit(3); | ||
| var skillHitResult = SCR_SkillHit(dealsDamageCharacter, target, skill, modifier); | ||
|
|
||
| target.TakeDamage(skillHitResult.Damage, dealsDamageCharacter); | ||
|
|
||
| var hit = new HitInfo(dealsDamageCharacter, target, skill, skillHitResult, TimeSpan.FromMilliseconds(200)); | ||
|
|
||
| Send.ZC_HIT_INFO(dealsDamageCharacter, target, hit); | ||
| } | ||
| } | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.