• 🏆 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!

Cleaving Attacks v1.2.1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Cleaving attacks passive spell.
Very similer to the inbuilt cleaving attack, with the exception that this one has a percent chance to activate.
The effects are:

level 1: 20% chance to hit with 40% splash dmg
level 2: 30% chance to hit with 60% splash dmg
level 3: 40% chance to hit with 80% splash dmg
level 4: 50% chance to hit with 100% splash dmg

I used Weep's damage detection system for this ability.

Thanks to Mr_Bean987, Black-apples and baassee for the great help on the forums.

Code:

  • Cleaving attacks
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Cleaving attacks for GDD_DamageSource) Greater than or equal to 1
    • Actions
      • Set Cleave_Level = (Level of Cleaving attacks for GDD_DamageSource)
      • Set Cleave_Chance = ((Cleave_Level x 10) + 10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to Cleave_Chance
        • Then - Actions
          • Set Cleave_Point = (Position of GDD_DamagedUnit)
          • Set Cleave_Dmg = (GDD_Damage x ((0.20 x (Real(Cleave_Level))) + 0.20))
          • Custom script: set bj_wantDestroyGroup = true
          • Trigger - Turn off (This trigger)
          • Unit Group - Pick every unit in (Units within 150.00 of Cleave_Point matching ((((Matching unit) is sleeping) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True) and ((Matching unit) Not equal to GDD_DamagedUnit)))) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\HumanBloodLarge0.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause GDD_DamageSource to damage (Picked unit), dealing Cleave_Dmg damage of attack type Hero and damage type Normal
          • Custom script: call RemoveLocation(udg_Cleave_Point)
        • Else - Actions
      • Trigger - Turn on (This trigger)


Changelog

v1.1
Removed Imports - No idea how they got there. They are for my map.

The Display Damage triger was for testing purposes, but OK - removed.

Blademaster check removed

Changed location of lvlofcleave triger and changed name

Custom scripts added.

v1.2
Cleave_Chance variable added

((Triggering unit) is sleeping) --> ((Matching unit) is sleeping)

(Position of GDD_DamagedUnit) changed to Cleave_Point

stupid errors I made in a hurry :D
1.2.1
Some other simple errors


It appears that Spellbound is right and the spell will proc even if the dmg done isn't from an attack but from another spell (like shadow strike).

My way of dealing with this problem is as fallows:

If the spell will be a hero spell and only one hero has this condition
  • (Unit-type of GDD_DamageSource) Equal to Your_Hero
should be there to check if its him doing the damage, so you don't have to raise a flag value in every spell you make for other heroes.
Another condition should be:
  • Spell_Fired Equal to False
Spell_Fired will be a variable we triger only in his other abilities like so:
  • Spell_Fired Equal to True
before the damage is done and
  • Spell_Fired Equal to False
after that.

If we want a MUI spell then we will have to have the Spell_Fired trigering in every spell on the map. In that case I think it is easier and simpler to use the inbuild Cleaving Attack ability.


Keywords:
cleave, attack, passive, sweep, strike, AoE
Contents

Cleaving attacks demo map (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 2 Sep 2011 Bribe: It's not MUI.

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

2 Sep 2011
Bribe: It's not MUI.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
215kb for one simple spell? No way.

-Remove all imports.

-Remove the Display Damage trigger

-Remove this line
  • (Unit-type of GDD_DamageSource) Equal to Blademaster
as other units might want this spell.

-Leaks
  • Set Cleave_Point = (Position of GDD_DamagedUnit) - Use Custom Script: call RemoveLocation(udg_Cleave_Point) to remove the location.
  • Set Cleave_UG = (Units within 150.00 of Cleave_Point matching (((((Matching unit) is Sleeping) Not equal to True) and ((Matching unit) Not equal to GDD_DamagedUnit)) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of GDD_Da

-Don't need the unitgroup variable just put this line before the group picking

  • Custom Script:set bj_wantDestroyGroup = true
-This should be set before the whole if.
  • Set lvlofcleave = (Level of Cleaving attacks for GDD_DamageSource)
Posting the code for you as you didnt do that


  • Cleaving attacks
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Unit-type of GDD_DamageSource) Equal to Blademaster
      • (Level of Cleaving attacks for GDD_DamageSource) Greater than or equal to 1
    • Actions
      • Trigger - Turn off (This trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to (((Level of Cleaving attacks for GDD_DamageSource) x 10) + 10)
        • Then - Actions
          • Set Cleave_Point = (Position of GDD_DamagedUnit)
          • Set Cleave_UG = (Units within 150.00 of Cleave_Point matching (((((Matching unit) is Sleeping) Not equal to True) and ((Matching unit) Not equal to GDD_DamagedUnit)) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of GDD_Da
          • Set lvlofcleave = (Level of Cleaving attacks for GDD_DamageSource)
          • Set cleavedmg = (GDD_Damage x ((0.20 x (Real(lvlofcleave))) + 0.20))
          • Unit Group - Pick every unit in Cleave_UG and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\HumanBloodLarge0.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause GDD_DamageSource to damage (Picked unit), dealing cleavedmg damage of attack type Hero and damage type Normal
        • Else - Actions
      • Trigger - Turn on (This trigger)
EDIT:

Fixed the whole trigger for you


  • Cleaving attacks
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Cleaving attacks for GDD_DamageSource) Greater than or equal to 1
    • Actions
      • Trigger - Turn off (This trigger)
      • Set lvlofcleave = (Level of Cleaving attacks for GDD_DamageSource)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to ((lvlofcleave x 10) + 10)
        • Then - Actions
          • Set Cleave_Point = (Position of GDD_DamagedUnit)
          • Set cleavedmg = (GDD_Damage x ((0.20 x (Real(lvlofcleave))) + 0.20))
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 150.00 of Cleave_Point matching ((((Matching unit) is Sleeping) Equal to False) and (((Matching unit) Not equal to GDD_DamagedUnit) and (((Matching unit) belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True)))) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\HumanBloodLarge0.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause GDD_DamageSource to damage (Picked unit), dealing cleavedmg damage of attack type Hero and damage type Normal
          • Custom script: call RemoveLocation(udg_Cleave_Point)
        • Else - Actions
      • Trigger - Turn on (This trigger)


-Also you really should rename the lvlofcleave variable to something more proper.


-And I do think this will be a bit too easy to be approved...
 
Level 3
Joined
Aug 16, 2011
Messages
26
v1.1 -
Removed Imports - No idea how they got there. They are for my map.

The Display Damage triger was for testing purposes, but OK - removed.

Blademaster check removed

Changed location of lvlofcleave triger and changed name

Custom scripts added.

Will you tell me what exactly the custom scripts do so I can use the in the future? Thx for the corrections.

edit: How do I make the collapsible thing in the descripsion?
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
Will you tell me what exactly the custom scripts do so I can use the in the future? Thx for the corrections.

edit: How do I make the collapsible thing in the descripsion?

It's just plain JASS. It's the GUI way to implement JASS lines but in the end, it's all JASS.

In this case we use it for removing memory leaks which takes up unnecessary RAM when it will not be refered to anymore. So it's just a bunch of things that the map will not use but will still take space.

There are a few threads about this, I wont link them as I find myself too lazy. And the Things that leaks thread is way too big and long to be read. In my opinion.

You mean [HIDDEN="HiddenTags"][/HIDDEN]?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Too simple to be approved.
A spell should be more powerful than the original ones (Cleaving Attack) but this one is weaker than the original... what the...

You should change the damage output cleaving damage (more than 100%), than, this will make this spell powerful than the original ones.

Facts:
If you change the damage output to more than 100%, primary unit takes less damage than the cleaved damage.

Like if you set it to 300%, primary unit will always takes 100% damage while the cleaved units will take instead 300%. It's like a damage modifier/multiplier for the cleaved units. It's more like Critical Strike too.
 
Well aside from being dealt by a blademaster the other problems here
are:

• Spell/triggered damage will also trigger the cleaving attack
• There is no bug-free way to determine if the damage is an attack or
a spell
• The only way to make it work properly is to have all non-physical
damage in the map triggered and to set a boolean when it's triggered
to let the game engine know.

A spell should be more powerful than the original ones (Cleaving Attack) but this one is weaker than the original... what the...

There is no rule that says the spell has to be more powerful from the
original ones. In fact, I have wanted a percent-chance cleaving attack
in the past when I used to develop my WarChasers II map.
 
Level 3
Joined
Aug 16, 2011
Messages
26
I think I figured it out.

If the spell will be a hero spell and only one hero has it the solution is simple enough I think. One thing is the condition
  • (Unit-type of GDD_DamageSource) Equal to Your_Hero
should be there to check if its him doing the damage, so you don't have to raise a flag value in every spell you make for other heroes.
Another condition should be:
  • Spell_Fired Equal to False
Spell_Fired will be a variable we triger only in his other abilities like so:
  • Spell_Fired Equal to True
before the damage is done and
  • Spell_Fired Equal to False
after that.

If we want a MUI spell then we will have to have the Spell_Fired trigering in every spell on the map.

I wanted this spell for a hero only and now it works fine for me. For multiple units I think it would be more convenient to use the basic Cleavin Attack ability.
 
Level 3
Joined
Aug 16, 2011
Messages
26
Do you mean in the Damage Detection System? That is way beyond my legue right now. I will add my suggestions from my previous post so people can decide what to do. I guess this spell won't be approved, but my intension was having it reviewed by people far more experienced than me so I can see my rookie mistakes. Thanks for that.
 
Top