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

yet another knockback spell

Status
Not open for further replies.
[I still need help!] yet another knockback spell

i need a knockback spell that uses the Damage detection system, which will 100% of attacks (Passive SPell) will do a tiny 50 push to units, but not a stun, i need it sort of like "Warlocks" where the unit can still cast spells or move around and attack.

if anyone can do this for me i would very much appreciate it
 
Last edited:

Cokemonkey11

Spell Reviewer
Level 29
Joined
May 9, 2006
Messages
3,534
yes you just copy it.


It's using vJass, so the syntax button will give tons of errors. Just save it, I'm assuming there won't be any errors then.

I made a huge ugly "hashtable" (function) of units that deal piercing damage, since there's no way to get them from object editor data, so you can modify that trigger to make it faster or affect more units.

Glad you like,
 

Cokemonkey11

Spell Reviewer
Level 29
Joined
May 9, 2006
Messages
3,534
Change

JASS:
    private function i takes nothing returns nothing
        set tDDKB=CreateTrigger()
        call TriggerAddAction(tDDKB,function a)
    endfunction
endscope

to

JASS:
    private function c takes nothing returns boolean
        return GetUnitTypeId(GetAttacker())=='hpea' //replace peasant with unit xyz rawcode.
    endfunction
    
    private function i takes nothing returns nothing
        set tDDKB=CreateTrigger()
        call TriggerAddCondition(t,Condition(function c))
        call TriggerAddAction(tDDKB,function a)
    endfunction
endscope
 
Status
Not open for further replies.
Top