• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Attack Ignoring Attack

Status
Not open for further replies.
Level 23
Joined
Apr 16, 2012
Messages
4,041
triggering it will be most likely the easiest way. Especially if it is passive onHit chance and if you have DDS. That way you can set some variable to 1 before you deal the damage, and then in your damage handler you check if the variable is 1, if it is you set the damage to the initial value(store in variable as well, or make it static value like 100, 150, 200...)
 

EdgeOfChaos

E

EdgeOfChaos

Psuedocode:

Event - You want to do armorpiercing damage
Condition - Attacker is armor piercing unit
Actions:

Set d = GetDamage()
set Source = GetDamageSource()
set Target = GetTriggeringUnit()
Set l = GetUnitLife(Target)
If(d<l)
call SetUnitLife(target,l-d)
else
call UnitDamageTarget(Source,Target,99999,blah blah..)
endif

What this will do is, if the unit's life is more than the damage it deals armor piercing damage (via SetLife) and if it's less/equal, it deals 9999999 damage in order to give credit to the attacking unit.
 
You got me all wrong, I do not want to use DDS nor use triggers: only ability / some sort of attack type that ignores armor (chaos deals 100% base damage but does not ignores armor) Orb of curruption make the unit lose armor without knowing how much need to be lowered, spell type attack type still not ignores armor, magic, siege, nothing.
So it must be some ability, if at all?

The Trigger "use unknown type of damage" must have some sort of copy inside an ability or special situation (example that is not true: a paused unit that deals damage is doing unknown damage, etc)
?
 

EdgeOfChaos

E

EdgeOfChaos

You don't need to use DDS.

function APDamage takes unit source, unit target, real d returns nothing
local l = getunitlife(u)
if(d>l)
...
etc using my method.

Without triggers may be impossible. You would need to ignore base hero magic resist too, which I don't know how you would without trigger.
 
You don't need to use DDS.

function APDamage takes unit source, unit target, real d returns nothing
local l = getunitlife(u)
if(d>l)
...
etc using my method.

Without triggers may be impossible. You would need to ignore base hero magic resist too, which I don't know how you would without trigger.

I don't care weather the damage notice magic resistance or not.
 

EdgeOfChaos

E

EdgeOfChaos

I believe damage type of "Enhanced" in the Damage Unit event ignores armor, but I don't know how to replicate that in the object editor.

Why are you so against using triggers for this?
 
I believe damage type of "Enhanced" in the Damage Unit event ignores armor, but I don't know how to replicate that in the object editor.

Why are you so against using triggers for this?

I have 1000 units in the map attacking with orbs of slow, i do not want each damage interation to be checked, just to copy the effect using ability or somehign as the such
 
Yes. Triggers. This one function was created by Malhorne, give credit.

JASS:
    function GetArmor takes unit u returns real
        local real life = GetWidgetLife( u )
        local real life2
        local real x = GetUnitX( u )
        local real y = GetUnitY( u )
        local unit v = CreateUnit( Player(15), DUMMY_ID, x, y, 0 )
        local real test = 10
        if GetWidgetLife(u) > 200 then
            set test = 100
        endif
        call UnitDamageTarget( v, u, test, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null )
        set life2 = life - GetWidgetLife( u )
        call RemoveUnit( v )
        set v = null
        call SetWidgetLife( u, GetWidgetLife( u ) + life2 )
        if ( life2 > test ) then
            return (-1*(test - life2 ) ) / ( life2 * ARMOR_CONSTANT ) 
        else
            return ( test - life2 ) / ( life2 * ARMOR_CONSTANT )
        endif
    endfunction

Armor constant = Armor damage reduction multiplier in gameplay constants.
DummyID = UnitID of dummy.
 
Status
Not open for further replies.
Top