Modifying non-hero units attack damage

Dirac

22710180
Reaction score
147
As the title says, is that possible? i don't wan't any green text displaying bonus damage next to the base damage, i just want plain damage increase. Non hero units so modifying stats is not an option
 

johnnymra

New Member
Reaction score
14
Well... you could just give it an upgrade...
I mean make an upgrade that increases damage by X and make the upgrade researched when you buy an item or something... depends on what you wish.
 

Dirac

22710180
Reaction score
147
Upgrades aren't reversible, so what should i do in case that unit drops the item
 

luorax

Invasion in Duskwood
Reaction score
67
I don't think it's possible. I wanted to do the same thing, but the only way I could achieve it was an upgrade (fortunately I don't have to remove the bonuses, as the hero gains those bonuses [armor and attack damage] on level up)
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you can make a similar upgrade with a negative value, give them many ranks, and adjust them accordingly... if you only plan to upgrade or downgrade their damage a few times you can have maybe 100 ranks of each? a little time consuming but worth it if you really need it

Edit: one cosmetic issue with doing this is every time u pick up or drop the item it will increase the # by their armor/damage, may be something you dislike maybe it doesnt matter to you...

and another thought, you could use its attack no2 as the attack that does more damage and disable the first and enable the second when they pick up the item then reverse the effect when they drop it
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
Upgrades with more than 4 levels will increase the loading time.

yes i know but if the map is small anyway, no-one will miss those few seconds, and if you are using normal units rather than heroes to play it, not saying it cant be fun, i doubt it is an extremely large map that uses too many 100 rank abilities or things of that sort
 

dudeim

New Member
Reaction score
22
You can use tome of damage I think it's called in a similiar way to how bonus mods works. I have a system in my map that does this, it's not mine so can't really explain how the inside's work.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
To do this the unit would need an inventory based off the hero inventory and possibly need to be targeted as and or classified as a hero
 

luorax

Invasion in Duskwood
Reaction score
67
Yep, there's an ability called "Item Permanent Damage Gain" - I'll check it later IMO.
 

Dirac

22710180
Reaction score
147
I'll look into it, it sounds like a perfect solution since what i had in mind is modifying the attack of non hero units with inventory. I would appreciate if you posted the system you're using here so i can read it
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
The only thing i can suggest you is to look into the "Status" System of, i think it was, Jesus4Lyf, excuse me if i am wrong.
If it is possible to change the damage of simple units, then Status can do it. if Status cant do it its not possible. simple as that.
 

dudeim

New Member
Reaction score
22
Well the system I use has alot of object data with it that is not done using textmacro's so it would be rather hard to just C&P it, but here is the system:
Note: it has some additional globals like attackspeed etc but you can easily filter them out the part posted only works for the attack damage.
Note2: this system comes from the map YouTD made by Gex
JASS:
//********************************************************************
//**    This file is part of the YouTD engine                       **
//**    copyright by gex @2009,2010 (<a href="http://www.eeve.org" target="_blank" class="link link--external" rel="nofollow ugc noopener">www.eeve.org</a>, <a href="mailto:[email protected]">[email protected]</a>)**
//**                                                                **
//**    If you use it for other purposes, give proper credit and    **
//**    leave this copyright box untouched                          **
//********************************************************************

//Private library used by libUnit to alter unit values
library libPreload uses TimerUtils //You can probably remove this don&#039;t forget to remove uses libPreload then and the function used in the script below


    function preloadAbil takes integer abil returns nothing 
    endfunction


endlibrary

library libBonus initializer init uses libPreload

    
    globals
        integer array bonusAbils
        integer array bonusBasis
        constant real BONUS_MULTIPLIER_HP_REGEN = 1.0
        constant real BONUS_MULTIPLIER_MANA_REGEN = 10.0 //These values seem wrong, but actually, the regen ability uses wrong values (actually twice as big as shown)
        constant integer BONUS_DAMAGE = 0
        constant integer BONUS_IAS = 1
        constant integer BONUS_MANA = 2
        constant integer BONUS_MANA_REG = 3
        constant integer BONUS_ARMOR = 4
        constant integer BONUS_HP = 5
        constant integer BONUS_HP_REGEN = 6
        constant integer BONUS_MANA_REGEN = 7
        constant integer BONUS_BASE = 25
        constant integer REGEN_BONUS_BASE = 100
        constant integer BONUS_BASE_DAMAGE = &#039;IDMA&#039;
        constant integer BONUS_BASE_DAMAGE_NEG = &#039;IDNA&#039;
        constant integer INVENTORY_ABIL = &#039;AInv&#039;
        constant integer TOMES_NEG_START = 40
        constant integer MAX_BASE_DAMAGE_POSITIVE = 20
        constant integer MAX_BASE_DAMAGE_NEGATIVE = 20
        item array tomes
    endglobals
    
    private function init takes nothing returns nothing
        local integer i
        set bonusAbils[BONUS_DAMAGE] = &#039;Adm5&#039;
        set bonusAbils[BONUS_IAS] = &#039;Aas5&#039;
        set bonusAbils[BONUS_MANA] = &#039;Ama5&#039;
        set bonusAbils[BONUS_ARMOR] = &#039;Aar5&#039;   
        set bonusAbils[BONUS_HP] = &#039;Ahp7&#039;
        set bonusAbils[BONUS_HP_REGEN] = &#039;Reg0&#039;   
        set bonusAbils[BONUS_MANA_REGEN] = &#039;Mre5&#039;
        
        set bonusBasis[BONUS_DAMAGE] = BONUS_BASE
        set bonusBasis[BONUS_IAS] = BONUS_BASE
        set bonusBasis[BONUS_MANA] = BONUS_BASE
        set bonusBasis[BONUS_ARMOR] = BONUS_BASE
        set bonusBasis[BONUS_HP] = BONUS_BASE
        set bonusBasis[BONUS_HP_REGEN] = REGEN_BONUS_BASE
        set bonusBasis[BONUS_MANA_REGEN] = REGEN_BONUS_BASE
        
        set i = 0
        loop
            set tomes<i> = CreateItem(BONUS_BASE_DAMAGE+i,0.0,0.0)
            call SetWidgetLife(tomes<i>,0.0)
            set i = i + 1
            exitwhen i == MAX_BASE_DAMAGE_POSITIVE 
        endloop
        set i = 0
        loop
            set tomes[TOMES_NEG_START+i] = CreateItem(BONUS_BASE_DAMAGE_NEG+i,0.0,0.0)
            call SetWidgetLife(tomes[TOMES_NEG_START+i],0.0)
            set i = i + 1
            exitwhen i == MAX_BASE_DAMAGE_NEGATIVE
        endloop      
    endfunction
    
    //Alters base damage (tomes...)
    function alterBaseDamageInternal takes unit u, integer delta returns nothing
        local integer i
        local integer amount
        local item it
        local boolean b = (UnitInventorySize(u) == 0)
        if (delta &lt; 0) then
            set delta = -delta
            set i = TOMES_NEG_START
        elseif (delta &gt; 0) then
            set i = 0
        else
            return
        endif
        if b then
            call UnitAddAbility(u,INVENTORY_ABIL)
        endif
        loop
            exitwhen delta == 0
            set amount = delta - (delta / 2) * 2 //Modulo 2
            if(amount != 0) then
                set it = tomes<i>
                call SetWidgetLife(it,100.0)
                call UnitAddItem(u, it)
                call SetItemPosition(it,0.0,0.0)
            endif
            set delta = delta / 2
            set i = i + 1
        endloop
        if b then
            call UnitRemoveAbility(u,INVENTORY_ABIL)
        endif
    endfunction
    
    private struct BaseDamageModification 
        unit u
        integer delta
        public static method create takes unit u, integer delta returns BaseDamageModification
            local BaseDamageModification b = BaseDamageModification.allocate()
            set b.u = u
            set b.delta = delta
            return b
        endmethod
    
    endstruct
    
    function alterBaseDamageTimer takes nothing returns nothing
        local timer t = GetExpiredTimer()
        local BaseDamageModification bdm = GetTimerData(t)
        call ReleaseTimer(t)
        call alterBaseDamageInternal(bdm.u,bdm.delta)
        call bdm.destroy()
    endfunction
    
    function alterBaseDamage takes unit u, integer delta returns nothing
        local timer t
        local BaseDamageModification bdm
        if (delta == 0) then
            return
        endif 
        set t = NewTimer()
        set bdm = BaseDamageModification.create(u,delta)
        call SetTimerData(t,bdm)        
        call TimerStart(t,0.0,false,function alterBaseDamageTimer)
    endfunction
</i></i></i>

Goodluck
@up: status can't change base damage values only the green bonus value, and it sure as hell is possible to do status can't do everything;)
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
a note for "Item Permanent Damage Gain" that is: the damage added is bonus damage (even it's shown as base damage)
so illusion won't gain that damage.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top