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

Triggered Evasion by True Strike

Status
Not open for further replies.
Level 7
Joined
Jan 30, 2011
Messages
267
i want to use triggered evasion in my map and i planned to do it this way:
every unit, that has a chance to evade, has a 100% evasion ability
when a unit with that evasion is attacked, there are 2 possibilities:
1. the attacker gets true strike ability (hit)
2. true strike ability gets removed (dodge)
true strike is based on bash
the system seems to work so far but i havent done very much tests yet, so i would like to know if there are any known issues with this system
(note: all orb effects and other attack modifiers (crit, bash, etc...) are triggered, so that it cant collide)
 
Level 9
Joined
Jul 10, 2011
Messages
562
that is inefficient...

just use bribes damage detection and use the event that fires before the damage is dealt. then run a random numer from 1 to 100 check if the attack is evaded or not if yes set damage to 0 and make a floating text if not deal the damage.
 
Level 7
Joined
Jan 30, 2011
Messages
267
@ruler: no, true strike will stay until the unit attacks the next time
then it will be removed if its a misshit
@clapto: i know that i can easily prevent the dmg by dmg engine (im using nes' dmg mod effect), but i want to do it with real evasion^^ (attack sounds, etc...)
 
Level 7
Joined
Jan 30, 2011
Messages
267
JASS:
library DodgeSystem initializer init
    private function dodge takes nothing returns nothing
        local real random = GetRandomReal(0, 1)
        if(random > 0.3) then
            call UnitAddAbility(GetAttacker(), 'A000')
        else
            call UnitRemoveAbility( GetAttacker(), 'A000'  )
        endif     
    endfunction

    private function init takes nothing returns nothing
        local trigger trig = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_ATTACKED )
        call TriggerAddAction( trig, function dodge )
    endfunction
endlibrary

a simple, quickly written version of my system (not optimized and nothing, just to see the idea)
 
Status
Not open for further replies.
Top