• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Flash Sword w/ Knockback

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: lovelyangel
Give 25% chance to slash an enemy with a lightning came from sky.Dealing 900 damage to attacked unit.

Yeah. i know this is very noob spell. but i'm new at passive skill.if this has many leaks as you thought, i'm sorry.

the trigger is:

[TRIGGER=Flash Sword Ability]
Flash Sword Ability
Events
Unit - A unit Is attacked
Conditions
(Level of Flash Sword for (Attacking unit)) Greater than 0
Actions
Set Caster = (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 4) Equal to 1
Then - Actions
Set Target = (Attacked unit)
Set Angle = (Facing of Caster)
Animation - Play Caster's Attack Slam animation
Unit - Cause Caster to damage Target, dealing 900.00 damage of attack type Hero and damage type Lightning
Special Effect - Create a special effect at (Position of Target) using Abilities\Weapons\Bolt\BoltImpact.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Turn collision for Target Off
Trigger - Turn off (This trigger)
Trigger - Turn on Flash Sword Knockback <gen>
If ((Level of Flash Sword for Caster) Greater than 0) then do (Wait 0.95 seconds) else do (Do nothing)
Trigger - Turn off Flash Sword Knockback <gen>
Unit - Turn collision for Target On
Trigger - Turn on (This trigger)
Else - Actions





[/TRIGGER]

[TRIGGER=Flash Sword Knockback]
Flash Sword Knockback
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at ((Position of Target) offset by 10.00 towards Angle degrees) of type Walkability is off) Equal to False
Then - Actions
Unit - Cause Caster to damage Target, dealing 10.00 damage of attack type Spells and damage type Lightning
Set Targt_Pos = (Position of Target)
Unit - Move Target instantly to (Targt_Pos offset by 1.00 towards Angle degrees)
Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Destructible - Pick every destructible within 105.00 of Targt_Pos and do (Destructible - Kill (Picked destructible))
Else - Actions
[/TRIGGER]

and i don't know the JASS is.

credits:

Special thanks to:

Rogue Galaxy:the idea of Flash Sword


baassee & Maker:the two that helped me to fix the leaks


you the downloader :D


Keywords:
passive,lightning,flash,sword,bash,greater bash
Contents

Flash Sword (Map)

Level 37
Joined
Mar 6, 2006
Messages
9,240
It's too simple, leaks and it's not MUI.

http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/

You don't need the first trigger.

(Attacking unit) Equal to Caster
Boolean Equal to True
->
Level of passive for attacking unit greater than 0

Set Chance = (Random integer number between 1 and 4)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Chance Equal to 3
->
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 4) equal to 3
 
Last edited:
Level 6
Joined
Nov 15, 2010
Messages
112
It's too simple, leaks and it's not MUI.

http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/

You don't need the first trigger.

(Attacking unit) Equal to Caster
Boolean Equal to True
->
Level of passive for triggering unit greater than 0

Set Chance = (Random integer number between 1 and 4)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Chance Equal to 3
->
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 4) equal to 3

wait, if i don't set the boolean is true at the condition, the spell wouldn't work.

and what is the use of "Level of passive for triggering unit greater than 0"??

maybe i can remove the "attacking unit equal to caster". but i can't remove the boolean...

and baassee, what is awesome???
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
  • Leaks like crazy.
  • Not a sign in the whole thing of it being castable more than once at the same time (not MUI).
  • Waits are imprecise which means this will have really random results.
  • You should use MonsoonBoltTarget.mdl instead of this doodad as that can be destroyed instantly and still play its animation.

Definitely, definitely needs fix.
 
Level 6
Joined
Nov 15, 2010
Messages
112
  • Leaks like crazy.
  • Not a sign in the whole thing of it being castable more than once at the same time (not MUI).
  • Waits are imprecise which means this will have really random results.
  • You should use MonsoonBoltTarget.mdl instead of this doodad as that can be destroyed instantly and still play its animation.

Definitely, definitely needs fix.

owh..thanks. and tell me the leaks.

and i have change the doodad to moonson that you've said.

check it out. and please tell me the leaks by post the leaking trigger.

and vote 4 approval
 
Last edited:

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
Set Angle = (Angle from (Position of Caster) to (Position of Target))

Leaks x2 (Position of Caster) and (Position of Target)

Special Effect - Create a special effect at (Position of Target) using Abilities\Weapons\Bolt\BoltImpact.mdl
Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl

Turn all of these into:

Special Effect - Create a special effect at (Position of Target) using Abilities\Weapons\Bolt\BoltImpact.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)

Set FlashKnockBack = ((Position of Target) offset by 10.00 towards Angle degrees)

Leaks (Position of Target) and FlashKnockback is also never removed.
 
Level 6
Joined
Nov 15, 2010
Messages
112
Set Angle = (Angle from (Position of Caster) to (Position of Target))

Leaks x2 (Position of Caster) and (Position of Target)

Special Effect - Create a special effect at (Position of Target) using Abilities\Weapons\Bolt\BoltImpact.mdl
Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl

Turn all of these into:

Special Effect - Create a special effect at (Position of Target) using Abilities\Weapons\Bolt\BoltImpact.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)

Set FlashKnockBack = ((Position of Target) offset by 10.00 towards Angle degrees)

Leaks (Position of Target) and FlashKnockback is also never removed.

you mean like this:

[trigger=Flash Sword Ability]
Flash Sword Ability
Events
Unit - A unit Is attacked
Conditions
(Level of Flash Sword for (Attacking unit)) Greater than 0
Actions
Set Caster = (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 4) Equal to 1
Then - Actions
Set Target = (Attacked unit)
Animation - Play Caster's Attack Slam animation
Unit - Cause Caster to damage Target, dealing 900.00 damage of attack type Hero and damage type Lightning
Special Effect - Create a special effect at (Position of Target) using Abilities\Weapons\Bolt\BoltImpact.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)
Wait 0.50 seconds
Animation - Play Caster's Attack Slam animation
Unit - Cause Caster to damage Target, dealing 900.00 damage of attack type Hero and damage type Lightning
Special Effect - Create a special effect at (Position of Target) using Abilities\Weapons\Bolt\BoltImpact.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)
Wait 0.50 seconds
Animation - Play Caster's Attack Slam animation
Unit - Cause Caster to damage Target, dealing 900.00 damage of attack type Hero and damage type Lightning
Special Effect - Create a special effect at (Position of Target) using Abilities\Weapons\Bolt\BoltImpact.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)
Wait 0.50 seconds
For each (Integer A) from 1 to 20, do (Actions)
Loop - Actions
Unit - Pause Target
Set Position_Caster = (Position of Caster)
Set Position_Target = (Position of Target)
Set Angle = (Angle from Position_Caster to Position_Target)
Set FlashKnockBack = ((Position of Target) offset by 10.00 towards Angle degrees)
Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Wait 0.00 seconds
Unit - Cause Caster to damage Target, dealing 100.00 damage of attack type Spells and damage type Lightning
Unit - Move Target instantly to FlashKnockBack
Unit - Unpause Target
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_FlashKnockBack)
Else - Actions
[/trigger]
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
For one, if you can make your spell using waits and haven't noticed a need to remove the randomocity factor, it's probably too simple and maybe should just be used for something like a cinematic scene.

Implementing a real knockback, one that uses a timer - (hint hint at the alternative to waits), and using a single monsoon bolt to kick off the spell, without any wait action, that might actually look cool.

From personal experience with knockback systems, attach the bolt to the unit so the effect drags with him when he's knocked back. It's good.
 
Level 6
Joined
Nov 15, 2010
Messages
112
For one, if you can make your spell using waits and haven't noticed a need to remove the randomocity factor, it's probably too simple and maybe should just be used for something like a cinematic scene.

Implementing a real knockback, one that uses a timer - (hint hint at the alternative to waits), and using a single monsoon bolt to kick off the spell, without any wait action, that might actually look cool.

From personal experience with knockback systems, attach the bolt to the unit so the effect drags with him when he's knocked back. It's good.

timer????
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
You're leaking some locations, leaking the special effect and the timer should run 0.03, not 0.01 (it's too much lag).

This still has a lot that needs to be changed in order to make it MUI. I advise looking at some of the other spells here how they do indexing, and see if you can build on that. Also, some good MUI tutorials could help.
 
Level 6
Joined
Nov 15, 2010
Messages
112
You're leaking some locations, leaking the special effect and the timer should run 0.03, not 0.01 (it's too much lag).

This still has a lot that needs to be changed in order to make it MUI. I advise looking at some of the other spells here how they do indexing, and see if you can build on that. Also, some good MUI tutorials could help.

tell me where is the leaks..
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
That is not my role to do your programming for you, I am only in this forum to critique. If you can't see the memory leaks on your own, you should develop this spell in the Triggers & Scripts forum where there are a lot of people who will help you spot your memory leaks.

This spell needs lots and lots of thought put into it before it is ready, and part of the requirement is that only "finished" products are allowed to be submitted. In some exceptions, which I have repeatedly made for this spell, I have laxed the rule. Because people expect these submissions to be reliable, it is time for this to be rejected.

When you are finished developing this spell in Triggers & Scripts, let me know, and I will un-reject this so it can be downloadable and enjoyed by everyone. Thanks.
 
Top