• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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 30
Joined
May 9, 2006
Messages
3,560
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 30
Joined
May 9, 2006
Messages
3,560
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