-
Notifications
You must be signed in to change notification settings - Fork 102
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 22 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
| 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
182 changes: 182 additions & 0 deletions
182
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,182 @@ | ||
| 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 : BuffHandler | ||
| { | ||
| public override void OnStart(Buff buff) | ||
| { | ||
| var caster = buff.Caster; | ||
|
|
||
| // [Arts] Spirit Expert: Wandering Soul | ||
| if (caster.IsAbilityActive(AbilityId.Sadhu35) || caster is not Character casterCharacter) | ||
| return; | ||
|
|
||
| var dummyCharacter = casterCharacter.Map.GetDummyCharacter((int)buff.NumArg2); | ||
|
|
||
| if (dummyCharacter != null) | ||
| { | ||
| dummyCharacter.Died += this.OnDummyDied; | ||
| } | ||
| } | ||
|
|
||
| public override void OnEnd(Buff buff) | ||
felipecastagnarodecarvalho marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| var caster = buff.Caster; | ||
|
|
||
| if (caster is not Character casterCharacter) | ||
| return; | ||
|
|
||
| var skillCharacter = casterCharacter.IsDummy && casterCharacter.Owner.IsAbilityActive(AbilityId.Sadhu35) | ||
| ? casterCharacter.Owner | ||
| : caster; | ||
|
|
||
| if (skillCharacter.TryGetSkill(SkillId.Sadhu_Anila, out var skill)) | ||
| { | ||
| skillCharacter.SetAttackState(true); | ||
|
|
||
| var pad = new Pad(PadName.Sadhu_Anila_Effect_Pad, skillCharacter, skill, new Square(caster.Position, caster.Direction, 50, 65)); | ||
|
|
||
| pad.Position = caster.Position; | ||
| 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 | ||
| if (casterCharacter.IsDummy && casterCharacter.Owner.IsAbilityActive(AbilityId.Sadhu35)) | ||
| { | ||
| Send.ZC_SKILL_READY(casterCharacter.Owner, caster, skill, caster.Position, caster.Position); | ||
| Send.ZC_NORMAL.UpdateSkillEffect(casterCharacter.Owner, caster.Handle, caster.Position, caster.Direction, Position.Zero); | ||
| Send.ZC_SKILL_MELEE_GROUND(casterCharacter.Owner, caster, skill, caster.Position, ForceId.GetNew(), null); | ||
| } else | ||
| { | ||
| skill.IncreaseOverheat(); | ||
| } | ||
| } | ||
|
|
||
| // [Arts] Spirit Expert: Wandering Soul | ||
| if (casterCharacter.IsDummy && casterCharacter.Owner.IsAbilityActive(AbilityId.Sadhu35)) | ||
| { | ||
| this.RemoveDummyCharacter(casterCharacter); | ||
| return; | ||
| } | ||
|
|
||
| casterCharacter.Properties.Modify(PropertyName.MSPD_BM, -buff.NumArg1); | ||
|
|
||
| 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> | ||
| /// Remove the dummy character from the map | ||
| /// </summary> | ||
| /// <param name="character"></param> | ||
| private void RemoveDummyCharacter(Character character) | ||
| { | ||
| if (character.Owner is Character ownerCharacter) | ||
felipecastagnarodecarvalho marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Send.ZC_OWNER(ownerCharacter, character, 0); | ||
|
|
||
| Send.ZC_LEAVE(character); | ||
|
|
||
| character.Map.RemoveDummyCharacter(character); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Makes the chararacter returns to original position | ||
| /// and also get ride of the dummy character | ||
| /// </summary> | ||
| /// <param name="character"></param> | ||
| /// <param name="dummyHandle"></param> | ||
| private void ReturnToBody(Character character, int dummyHandle) | ||
| { | ||
| var dummyCharacter = character.Map.GetDummyCharacter(dummyHandle); | ||
|
|
||
| if (dummyCharacter == null) | ||
| return; | ||
|
|
||
| character.Position = dummyCharacter.Position; | ||
| character.Direction = dummyCharacter.Direction; | ||
|
|
||
| dummyCharacter.Died -= this.OnDummyDied; | ||
|
|
||
| Send.ZC_ROTATE(character); | ||
| Send.ZC_SET_POS(character, dummyCharacter.Position); | ||
| Send.ZC_OWNER(character, dummyCharacter, 0); | ||
| Send.ZC_LEAVE(dummyCharacter); | ||
|
|
||
| character.Map.RemoveDummyCharacter(dummyCharacter); | ||
| } | ||
|
|
||
| /// <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> | ||
| /// Attacks the target | ||
| /// </summary> | ||
| /// <param name="skill"></param> | ||
| /// <param name="caster"></param> | ||
| private void Attack(Skill skill, ICombatEntity caster, ICombatEntity target) | ||
| { | ||
| var modifier = SkillModifier.MultiHit(3); | ||
| var skillHitResult = SCR_SkillHit(caster, target, skill, modifier); | ||
|
|
||
| target.TakeDamage(skillHitResult.Damage, caster); | ||
|
|
||
| var hit = new HitInfo(caster, target, skill, skillHitResult, TimeSpan.FromMilliseconds(200)); | ||
|
|
||
| Send.ZC_HIT_INFO(caster, target, hit); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Called when the dummy character died | ||
| /// disappeared. | ||
| /// </summary> | ||
| /// <param name="character"></param> | ||
| /// <param name="killer"></param> | ||
| private void OnDummyDied(Character character, ICombatEntity killer) | ||
| { | ||
| character.Owner.StopBuff(BuffId.OOBE_Anila_Buff); | ||
| } | ||
| } | ||
| } | ||
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.