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

Attack Passives System

This bundle is marked as awaiting update. A staff member has requested changes to it before it can be approved.
  • Like
Reactions: JesusHipster
Attack Passives System v1.04
Created by: BloodForBlood

Requirements:
1.JassHelper 0.A.2.B or above
2.Damage Event
By: looking_for_help aka eey
3.Stun System
By: iAyanami aka Ayanami
4.Jass NewGen Pack or WEX
5.Table(New Table)


What is this:
It's a triggered version of attack passive abilities with
additional features. You can also add special effects on it.

How to import:
1.Simply copy the folder "Attacks Passives" to your map.
2.Then read each required libraries to how to import.

Spell Functions:
vJASS:
    Functions or System API:
        CriticalStrike.update takes unit whichUnit, real multiplier, real chance, string fx, string attachment, string msg returns nothing
            // This adds critical strike on unit.
            Example: call CriticalStrike.update(u, 2.0, 25.0, "Abilities\\Weapons\\HydraliskImpact\\HydraliskImpact.mdl", "chest", "|cFFFF0000<>!|r")
            Tip: You can set fx to ".mdl" to create no effects.
            Note: The <> represents the damage amount.
        CriticalStrike.remove takes unit whichUnit returns nothing
            // This removes the critical strike from unit.
            Example: call CriticalStrike.remove(u)
        Bash.update takes unit whichUnit, real damagebonus, real duration, real chance, string fx, string attachment returns nothing
            // This adds bash on unit.
            Example: call Bash.update(u, 50.00, 2.00, 25.00, ".mdl", "chest")
            Tip: You can set fx to ".mdl" to create no effects.
        Bash.remove takes unit whichUnit returns nothing
            // This removes the bash from unit.
            Example: call Bash.remove(u)
        Evasion.update takes unit whichUnit, real chance, string fx, string attachment, string msg returns nothing
            // This adds evasion on unit.
            Example: call Evasion.update(u, 30.00, ".mdl", "chest", "|cFFFF0000miss|r")
            Tip: You can set fx to ".mdl" to create no effects.
        Evasion.remove takes unit whichUnit returns nothing
            // This removes the evasion from unit.
            Example: call Evasion.remove(u)
        Cleave.update takes unit whichUnit, real dmgfactor, real AoE, string fx, string attach returns nothing
            // This adds cleave on unit.
            Example: call Cleave.update(u, 0.75, 200, ".mdl", "chest")
            Tip: You can set fx to ".mdl" to create no effects.
        Cleave.remove takes unit whichUnit returns nothing
            // This removes the cleave from unit.
            Example: call Cleave.remove(u)

Changelog
Code:
v1.04:
Added Cleave as requested
Renamed library to "AttackPassivesSystem"
Added custom floating text as requested
Backwards Compatibility is tottally dead
Optimized code
v1.03:
Removed unit indexer requirement.
I used vJASS version of "Physical Damage Detection" instead.
Using HashTable instead of TableArray.
Fixed some bugs.
Removed some useless codes.
v1.02:
Replaced hashtable with Table.
Added effects for bash and evasion.
Added requirement: Any unit indexer
Fix a bug that bash still procs in evasion.
Removed some useless functions:
    the Disable and Enable trigger thing...
v1.01:
Changed scope to library.
Using 1 hashtable instead of 3 and
merged into 1 trigger.
v1.00:
First release.

Special Thanks to:
looking_for_help aka eey for "Physical Damage Detection"
iAyanami aka Ayanami for "StunSystem"
Bribe for "NewTable"
Vexorian
Nestharus
Contents

Attack Passives System (Map)

Reviews
MyPad
Having evolved from just a Bash, Evasion and Critical Strike System, I will leave another review: Notes: CriticalStrike -> should extend array (No allocator found) Bash -> should extend array (No allocator found) Evasion -> should extend array (No...
Dr Super Good
Required for Approval: Code quality requires improvement. Tabs and spaces are used inconsistently to format code. This makes the code hard to read in standard World Editor as a tab is 8 spaces wide. To indent code one should use either all spaces (4...

Notes:

  • The idea behind this .. spell is somewhat too simplistic. A more vivid description about the spell would be more helpful.
  • The Main System Code utilizes scopes, which are not recommended in public resources such as this. Libraries would be required.
  • Modularity is not too keenly observed (Having a new hashtable per system instead of relying on Table instances?)
  • The library DamageEvent isn't a library per se, which requires enclosing it within a newly-declared library.

Suggestions:

  • Encase the Main System code in libraries instead of scopes.
  • Rename the spell to Bash, Critical Strike, and Evasion System.
  • The requirement JNGP should be changed to Sharpcraft WEX as it (JNGP) is outdated and incompatible with the current versions.
  • More to be added..
 
Last edited:
Level 10
Joined
Aug 21, 2010
Messages
316
Very good system for only one reason.Very faithfully shows all the defects and inefficiency of the damage system.Crit, bash, and evasion should be part of the system.

This method
call DisableTrigger( GetTriggeringTrigger() )
call UnitDamageTargetBJ(udg_PDD_source, udg_PDD_target, bonus, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL) call EnableTrigger( GetTriggeringTrigger() )
is a story for itself.
Attacking damage should be automatic.
Attacking damage should support crit, bash,evasion and so on.
Only spell damage should be triggered.
As for your system.
Since it is based on another not so efficient system I can not say anything.
 
Level 5
Joined
Mar 15, 2017
Messages
96

Notes:

  • The idea behind this .. spell is somewhat too simplistic. A more vivid description about the spell would be more helpful.
  • The Main System Code utilizes scopes, which are not recommended in public resources such as this. Libraries would be required.
  • Modularity is not too keenly observed (Having a new hashtable per system instead of relying on Table instances?)
  • The library DamageEvent isn't a library per se, which requires enclosing it within a newly-declared library.

Suggestions:

  • Encase the Main System code in libraries instead of scopes.
  • Rename the spell to Bash, Critical Strike, and Evasion System.
  • The requirement JNGP should be changed to Sharpcraft WEX as it (JNGP) is outdated and incompatible with the current versions.
  • More to be added..
Okay I'll change it to library..
And sorry,I don't know about WEX.And also where can I find the JassHelper for WEX??

Very good system for only one reason.Very faithfully shows all the defects and inefficiency of the damage system.Crit, bash, and evasion should be part of the system.

This method
call DisableTrigger( GetTriggeringTrigger() )
call UnitDamageTargetBJ(udg_PDD_source, udg_PDD_target, bonus, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL) call EnableTrigger( GetTriggeringTrigger() )
is a story for itself.
Attacking damage should be automatic.
Attacking damage should support crit, bash,evasion and so on.
Only spell damage should be triggered.
As for your system.
Since it is based on another not so efficient system I can not say anything.
I disabled that because I was using Physical Damage Detection which I can modify its damage by changing PDD_amount.

And also,I don't know how to use table.I'm a beginner at vJASS(not really beginner,but It's like I only have medium knowledge for it).
 
Last edited by a moderator:

AGD

AGD

Level 16
Joined
Mar 29, 2016
Messages
688
Since you're using vJass, you might want to use the vJass version of PDDS.

It's also nice to use a single Table instead of a TableArray.
You can do it like
JASS:
local integer i = GetUnitUserData(u)*9 //9 is just an example, u must replace it with the number of the kinds of data you store into the table
set table.real[i + 0] = ... //crit chance
set table.real[i + 1] = ... //crit factor
set table.string[i + 2] = ... //crit sfx
//and so on

And there is one very important issue that bugs me - the evasion does not even remotely mimic the proper behavior of an actual evasion. Blocking a damage is not the way to go. Using this system, even when an attack was supposedly evaded, it still triggers orb effects, lifesteal, bash/crit chance, etc. and most importantly, it also triggers a damage event - which it should not. Even I could not think of a way to mimic the game's default evasion behavior. The only way is if we are provided with an "Attack/Missile Launch Event" and a control over the launced attack's/missile's behavior, which is currently not the case.
 
Level 5
Joined
Mar 15, 2017
Messages
96
Since you're using vJass, you might want to use the vJass version of PDDS.

It's also nice to use a single Table instead of a TableArray.
You can do it like
JASS:
local integer i = GetUnitUserData(u)*9 //9 is just an example, u must replace it with the number of the kinds of data you store into the table
set table.real[i + 0] = ... //crit chance
set table.real[i + 1] = ... //crit factor
set table.string[i + 2] = ... //crit sfx
//and so on

And there is one very important issue that bugs me - the evasion does not even remotely mimic the proper behavior of an actual evasion. Blocking a damage is not the way to go. Using this system, even when an attack was supposedly evaded, it still triggers orb effects, lifesteal, bash/crit chance, etc. and most importantly, it also triggers a damage event - which it should not. Even I could not think of a way to mimic the game's default evasion behavior. The only way is if we are provided with an "Attack/Missile Launch Event" and a control over the launced attack's/missile's behavior, which is currently not the case.
hmm,I didn't think of that...And I'll find a way to bypass that issue..

Good. Good.

I find the ability to adapt to coding conventions quite impressive. As it stands, my former remarks are no longer applicable to a certain extent.
Thanks,I just wan't to improve my knowledge on vJASS
 
Last edited:
Level 13
Joined
Mar 21, 2014
Messages
893
Nice system IMO :p
I got questions to ask you. I think that the unit procing critical won't play "attack slam" animation, will they? Also, is there a way to configure floating text for each critical strike? I mean floating text for one critical is "put your text here :p" while the other is like original?

Anyway, 4/5!
 
Level 5
Joined
Mar 15, 2017
Messages
96
Nice system IMO :p
I got questions to ask you. I think that the unit procing critical won't play "attack slam" animation, will they? Also, is there a way to configure floating text for each critical strike? I mean floating text for one critical is "put your text here :p" while the other is like original?

Anyway, 4/5!
Yeah,sadly..It won't play attack slam.I'm trying to find a way to add that feature.
I'll add that custom floating text for ya.
 
Level 5
Joined
Mar 15, 2017
Messages
96
Maybe battle passives?
I am not very good at names but the current name (which is Bash,Critical Strike & Evasion System) is quite clear on what the system does which is good
Maybe "Attack Passives System", but on next update!

EDIT:
Nice system IMO :p
I got questions to ask you. I think that the unit procing critical won't play "attack slam" animation, will they? Also, is there a way to configure floating text for each critical strike? I mean floating text for one critical is "put your text here :p" while the other is like original?

Anyway, 4/5!
Updated!
Added custom floating text and cleave!
 
Last edited:

AGD

AGD

Level 16
Joined
Mar 29, 2016
Messages
688
For a proper evasion, wait till blizzard provides us with the neccessary natives and object or when someone creates an alternative to the default attack system xD. Whichever comes first.

EDIT:
Btw, currently a unit is limited to only one instance of each type of passive, which is quite limiting. Maybe you should provide allow a unit to have as many instance as the user would. For this, you have to create a create() method for each attack passive. Then also provide a method to register/unregister a unit to/from a passive's instance.
 
Last edited:
Level 5
Joined
Mar 15, 2017
Messages
96
For a proper evasion, wait till blizzard provides us with the neccessary natives and object or when someone creates an alternative to the default attack system xD. Whichever comes first.

EDIT:
Btw, currently a unit is limited to only one instance of each type of passive, which is quite limiting. Maybe you should provide allow a unit to have as many instance as the user would. For this, you have to create a create() method for each attack passive. Then also provide a method to register/unregister a unit to/from a passive's instance.
You mean stacking?
 
Having evolved from just a Bash, Evasion and Critical Strike System, I will leave another review:

Notes:

  • CriticalStrike -> should extend array (No allocator found)
  • Bash -> should extend array (No allocator found)
  • Evasion -> should extend array (No allocator found)
  • Cleave -> should extend array (No allocator found)
  • CriticalStrike, Bash, Evasion, Cleave -> Uses string hash, which could produce key collisions in certain cases. See [vJASS] - StringHashEx guaranteed no-collision string hash, Spell Effect Indexer v1.5 (Message #26)
  • CriticalStrike_Actions -> uses GetLastCreatedTextTag() instead of bj_lastCreatedTextTag
  • Evasion_Actions -> uses GetLastCreatedTextTag() instead of bj_lastCreatedTextTag

Nitpicks:


  • Cleave_Filter -> Could use some delimited comments as replacement for a lot of if-then conditions. -> /**/

    You can copy these if you want:

    JASS:
        return (GetWidgetLife(u) > 0.405) /*
    */ and (u != null) /*
    */ and (GetUnitTypeId(u) == 0) /*
    */ and not (IsUnitAlly(u, p))

Additional Comments:


Map works fine, as intended.
However, a more favorable Damage Detection System is preferred (I suggest Flux's DamagePackage).
Stacking will be included, right?

Status:

  • Awaiting Update
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
Required for Approval:
Code quality requires improvement.
  • Tabs and spaces are used inconsistently to format code. This makes the code hard to read in standard World Editor as a tab is 8 spaces wide. To indent code one should use either all spaces (4 per block level) or all tabs and not both.
  • Hashes of constant strings should be turned into constant variables as the resulting value is constant. This improves code maintainability since one can change the hashed string in a single location. Since hashes of strings might not be safe due to collision potential, it is usually recommended to use the key keyword functionality of variables declared in the globals blocks of vJASS to allocate unique named key values for use with hashtables.
Comments and suggestions:
Potentially useful for some RPGs where passive effects are often computed on custom stats. Might also be useful for some custom ability effects that add temporary passives of a nature that cannot be simulated with a hidden ability.

Cleave AoE calculation might not be correct as it does not factor in unit collision radius. This may require checking against the cleave ability as I think that does factor in collision radius when determining if targets are hit. One simulates such hit detection by enumerating units in a larger area (AoE + maximum collision radius) and then filtering the results using the IsUnitInRange set of functions as those functions factor in unit collision size.

The use of Damage Event might no longer be required due to the addition of new natives to handle this functionality in recent patches.

The test map should revive the player's hero upon death. Without this it is very easy for the player to quickly lose their hero which effectively ends the test session before experiencing all the functionality on display.​
 
Level 5
Joined
Mar 15, 2017
Messages
96
Required for Approval:
Code quality requires improvement.
  • Tabs and spaces are used inconsistently to format code. This makes the code hard to read in standard World Editor as a tab is 8 spaces wide. To indent code one should use either all spaces (4 per block level) or all tabs and not both.
  • Hashes of constant strings should be turned into constant variables as the resulting value is constant. This improves code maintainability since one can change the hashed string in a single location. Since hashes of strings might not be safe due to collision potential, it is usually recommended to use the key keyword functionality of variables declared in the globals blocks of vJASS to allocate unique named key values for use with hashtables.
Comments and suggestions:
Potentially useful for some RPGs where passive effects are often computed on custom stats. Might also be useful for some custom ability effects that add temporary passives of a nature that cannot be simulated with a hidden ability.

Cleave AoE calculation might not be correct as it does not factor in unit collision radius. This may require checking against the cleave ability as I think that does factor in collision radius when determining if targets are hit. One simulates such hit detection by enumerating units in a larger area (AoE + maximum collision radius) and then filtering the results using the IsUnitInRange set of functions as those functions factor in unit collision size.

The use of Damage Event might no longer be required due to the addition of new natives to handle this functionality in recent patches.

The test map should revive the player's hero upon death. Without this it is very easy for the player to quickly lose their hero which effectively ends the test session before experiencing all the functionality on display.​
I have no idea if my cleave formula was correct, I am thinking if it's a circle sector. What do you think?
Wow now there is a cleave system on the hive workshop.
Good job.
I hope that soon whatever needed to be updated will be because it is a system that was missing from warcraft 3 before you created it.
I have abandoned this, but I never thought someone will like this, so I will continue this work. By the way, my bash system sucks, it doesn't work on magic immune units. I HAVE A LOT OF THINGS TO FIX, I was not good at vJass that time. Take a look at my code, the code design sucks.
 
Top