Increase evasion on units using triggers or JASS

chokladgris

New Member
Reaction score
0
Im working on a hero ability that creates a shield on the targeted unit, increasing evasion (armor would work too but i would prefer evasion). the shield lasts for 8 seconds then the bonus evasion/armor dissapears and the unit is healed a bit.

I cannot find any triggers that increases evasion or armor on targeted unit, is there anything you can do in JASS to make this work?

Another solution would be to use Inner Fire as a base ability, but how do i remove the autocast function?

Thanks for help!
 

jig7c

Stop reading me...-statement
Reaction score
123
you need to put this script in your map...
make a new trigger, convert it to custom text, delete everything in there, and put the following code in it

JASS:
//==============================================================================
//                Bonus -- State modification system -- v1.3
//==============================================================================
//
//  AUTHOR:
//       * Cohadar
//
//  PURPOUSE:
//       * Easy changing of units' max life, max mana, armor, damage, str, agi, int, 
//         move speed, attack speed, evasion, critical...
//         (or anything else you put in)
//
//  EXAMPLES:
//       * set Bonus_Life[whichUnit] = 4    // will add 400 life (DELTA = 100)
//       * set Bonus_Armor[whichUnit] = 10  // will add 10 armor (DELTA = 1)
//       * set Bonus_Damage[whichUnit] = 5  // will add 25 damage (DELTA = 5)
//       * set Bonus_Evasion[whichUnit] = 4 // will add 20% evasion (DELTA = 5%)
//
//  PLUGINS:
//       * Abilities needed by Bonus system are created with plugins
//         If you do not need some bonus type simply do not use that type plugin
//
//  PROS: 
//       * It removes the need for using abilties with 100 levels
//         (significantly reduces map loading time)
//       * It can be easily extended for other bonus types
//
//  CONS:
//       * You have to be smart enough to calculate wanted modification from DELTA
//       * System does not support negative values
//
//  DETAILS:
//       * DELTA is the smallest value of modification (bonus resolution)
//         DELTA is the bonus value in first bonus ability
//       * COUNT is the number of custom abilities used per bonus
//         Valid bonus ranges for binary bonuses are 0..(2^COUNT)-1
//         Valid bonus ranges for linear bonuses are 0..COUNT
//         Bonus is multiplied by DELTA to get the resulting modification
//         For example bonus 7 will change units' life by 700 
//         because life delta is set to 100
//
//  HOW TO IMPORT:
//       * Just create a trigger named Bonus
//         convert it to text and replace the whole trigger text with this one
//       * Create needed abilities with Bonus Plugins
//
//==============================================================================
library Bonus initializer Init

//===========================================================================
globals
    private constant integer MAX_CODES = 20 // max number of abilities per bonus
endglobals    

//===========================================================================
interface IBonus
    method operator DELTA takes nothing returns integer
    method operator MAXBONUS takes nothing returns integer
    method operator[] takes unit whichUnit returns integer
    method operator[]= takes unit whichUnit, integer bonus returns nothing
endinterface

//===========================================================================
//  This one is for stackable item abilities (life, mana, armor, str...)
//===========================================================================
private struct BinaryBonus extends IBonus
    private integer firstCode
    private integer count
    private integer delta
    private integer maxbonus
    private static integer array POWZ // powers of 2 for binary algorithm

    //-----------------------------------------------------------------------
    static method create takes integer firstCode, integer count, integer delta returns BinaryBonus
        local BinaryBonus bb = BinaryBonus.allocate()
        set bb.firstCode = firstCode
        set bb.count = count
        set bb.delta = delta
        set bb.maxbonus = .POWZ[count]-1
        return bb
    endmethod
    
    //-----------------------------------------------------------------------
    method operator DELTA takes nothing returns integer
        return .delta
    endmethod
    
    //-----------------------------------------------------------------------
    method operator MAXBONUS takes nothing returns integer
        return .maxbonus
    endmethod
    
    //-----------------------------------------------------------------------
    method operator[] takes unit whichUnit returns integer
        local integer bonus = 0
        local integer i = .count-1
        loop
            exitwhen i<0
            if GetUnitAbilityLevel(whichUnit, .firstCode+i)>0 then
                set bonus = bonus + .POWZ<i>
            endif
            set i = i - 1
        endloop    
        return bonus    
    endmethod
    
    //-----------------------------------------------------------------------
    method operator[]= takes unit whichUnit, integer bonus returns nothing
        local integer i = .count-1

        if bonus &lt; 0 then
            call BJDebugMsg(&quot;|c00ff0000&quot;+SCOPE_PREFIX+&quot;$NAME$[&quot;+GetUnitName(whichUnit)+&quot;] = &quot;+I2S(bonus)+&quot; // bonus underflow&quot;)
        endif        
        if bonus &gt; .POWZ[.count]-1 then
            call BJDebugMsg(&quot;|c00ff0000&quot;+SCOPE_PREFIX+&quot;$NAME$[&quot;+GetUnitName(whichUnit)+&quot;] = &quot;+I2S(bonus)+&quot; // bonus overflow&quot;)
        endif        
        
        loop
            exitwhen i&lt;0
            if bonus &gt;= .POWZ<i> then
                set bonus = bonus - .POWZ<i>
                if GetUnitAbilityLevel(whichUnit, .firstCode+i)==0 then
                    call UnitAddAbility(whichUnit, .firstCode+i)
                    call UnitMakeAbilityPermanent(whichUnit, true, .firstCode+i)
                endif
            else
                if GetUnitAbilityLevel(whichUnit, .firstCode+i)&gt;0 then
                    call UnitMakeAbilityPermanent(whichUnit, false, .firstCode+i)
                    call UnitRemoveAbility(whichUnit, .firstCode+i)
                endif
            endif
            set i = i - 1
        endloop    
    endmethod
    
    //-----------------------------------------------------------------------
    private static method onInit takes nothing returns nothing
        local integer i = 0
        local integer pow = 1
        loop
            exitwhen i &gt; MAX_CODES
            set .POWZ<i> = pow
            set i = i + 1
            set pow = pow * 2
        endloop
    endmethod
endstruct

//===========================================================================
//  This one is for non-stackable abilities (move speed, evasion, critical, ...)
//===========================================================================
private struct LinearBonus extends IBonus
    private integer firstCode
    private integer count
    private integer delta
    private integer maxbonus

    //-----------------------------------------------------------------------
    private static method hideSpellBook takes integer abilId returns nothing
        local integer p = 0
        loop
            call SetPlayerAbilityAvailable(Player(p), abilId, false)
            set p = p + 1
            exitwhen p == bj_MAX_PLAYER_SLOTS
        endloop         
    endmethod    
    
    //-----------------------------------------------------------------------
    static method create takes integer firstCode, integer count, integer delta, boolean spellBook returns LinearBonus
        local LinearBonus lb = LinearBonus.allocate()
        local integer i
        set lb.firstCode = firstCode
        set lb.count = count
        set lb.delta = delta
        set lb.maxbonus = count
        if spellBook then
            set i = 0
            loop
                exitwhen i&gt;=count
                call .hideSpellBook(firstCode+i)
                set i = i + 1
            endloop    
        endif
        return lb
    endmethod
    
    //-----------------------------------------------------------------------
    method operator DELTA takes nothing returns integer
        return .delta
    endmethod
    
    //-----------------------------------------------------------------------
    method operator MAXBONUS takes nothing returns integer
        return .maxbonus
    endmethod
    
    //-----------------------------------------------------------------------
    method operator[] takes unit whichUnit returns integer
        local integer bonus = 0
        local integer i = .count-1
        loop
            exitwhen i&lt;0
            if GetUnitAbilityLevel(whichUnit, .firstCode+i)&gt;0 then
                return i+1
            endif
            set i = i - 1
        endloop    
        return 0   
    endmethod
    
    //-----------------------------------------------------------------------
    method operator[]= takes unit whichUnit, integer bonus returns nothing
        local integer i = .count-1

        if bonus &lt; 0 then
            call BJDebugMsg(&quot;|c00ff0000&quot;+SCOPE_PREFIX+&quot;$NAME$[&quot;+GetUnitName(whichUnit)+&quot;] = &quot;+I2S(bonus)+&quot; // bonus underflow&quot;)
            set bonus = 0
        endif        
        if bonus &gt; .count then
            call BJDebugMsg(&quot;|c00ff0000&quot;+SCOPE_PREFIX+&quot;$NAME$[&quot;+GetUnitName(whichUnit)+&quot;] = &quot;+I2S(bonus)+&quot; // bonus overflow&quot;)
            set bonus = .count 
        endif        
        
        loop
            exitwhen i&lt;0
            if GetUnitAbilityLevel(whichUnit, .firstCode+i)&gt;0 then
                call UnitMakeAbilityPermanent(whichUnit, false, .firstCode+i)
                call UnitRemoveAbility(whichUnit, .firstCode+i)
                exitwhen true
            endif
            set i = i - 1
        endloop
        
        if bonus &gt; 0 then
            call UnitAddAbility(whichUnit, .firstCode+bonus-1)
            call UnitMakeAbilityPermanent(whichUnit, true, .firstCode+bonus-1)
        endif   
    endmethod
endstruct

//===========================================================================
//  Bonus struct global variables
//===========================================================================
globals
    public IBonus Life
    public IBonus Mana
    public IBonus Armor
    public IBonus Damage
    public IBonus Str
    public IBonus Agi
    public IBonus Int
    public IBonus AttackSpeed
    public IBonus MoveSpeed    
    public IBonus Evasion
    public IBonus Critical
endglobals

//===========================================================================
//  Init bonus structs
//===========================================================================
private function Init takes nothing returns nothing
    set Life   = BinaryBonus.create(&#039;A8L0&#039;, 8, 100)
    set Mana   = BinaryBonus.create(&#039;A8M0&#039;, 8, 100)
    
    set Armor  = BinaryBonus.create(&#039;A8D0&#039;, 8, 1)
    set Damage = BinaryBonus.create(&#039;A8T0&#039;, 8, 5)
    
    set Str    = BinaryBonus.create(&#039;A8S0&#039;, 8, 1)
    set Agi    = BinaryBonus.create(&#039;A8A0&#039;, 8, 1)
    set Int    = BinaryBonus.create(&#039;A8I0&#039;, 8, 1)
    
    set AttackSpeed = BinaryBonus.create(&#039;A8H0&#039;, 7, 5)
    set MoveSpeed   = LinearBonus.create(&#039;A8P1&#039;, 10, 5, false)    
    
    set Evasion  = LinearBonus.create(&#039;A8E1&#039;, 8, 5, true)
    set Critical = LinearBonus.create(&#039;A8C1&#039;, 8, 5, true)
endfunction

function BonusLife takes unit whichUnit, integer amount returns nothing
    set Life[whichUnit] = amount
endfunction

function BonusMana takes unit whichUnit, integer amount returns nothing
    set Mana[whichUnit] = amount
endfunction

function BonusArmor takes unit whichUnit, integer amount returns nothing
    set Armor[whichUnit] = amount
endfunction

function BonusDamage takes unit whichUnit, integer amount returns nothing
    set Damage[whichUnit] = amount
endfunction

function BonusStr takes unit whichUnit, integer amount returns nothing
    set Str[whichUnit] = amount
endfunction

function BonusAgi takes unit whichUnit, integer amount returns nothing
    set Agi[whichUnit] = amount
endfunction

function BonusInt takes unit whichUnit, integer amount returns nothing
    set Int[whichUnit] = amount
endfunction

function BonusAttackSpeed takes unit whichUnit, integer amount returns nothing
    set AttackSpeed[whichUnit] = amount
endfunction

function BonusMoveSpeed takes unit whichUnit, integer amount returns nothing
    set MoveSpeed[whichUnit] = amount
endfunction

function BonusEvasion takes unit whichUnit, integer amount returns nothing
    set Evasion[whichUnit] = amount
endfunction

function BonusCritical takes unit whichUnit, integer amount returns nothing
    set Critical[whichUnit] = amount
endfunction

endlibrary</i></i></i></i>



also need this... follow instructions to implement this
JASS:
//==============================================================================
//                       BONUS PLUGINS -- v1.3
//==============================================================================
//
//  AUTHOR:
//       * Cohadar
//
//  PURPOSE:
//       * Bonus plugins are used for creating abilities needed by Bonus system
//       * Bonus plugins should be disabled by default
//
//  HOW TO USE PLUGINS:
//       * Enable plugin trigger, save the map, close the map, open the map, disable plugin trigger
//       * You must do this for every plugin trigger
//
//  WARNING:
//       * Plugin triggers create lots abilities that start with &#039;A8&#039;
//         Check your map to make sure rawcodes don&#039;t collide with something you already have
//         or your existing abilities may get overwritten.
//       * Some linear abilities use skillbook with Base Order ID: attributemodskill
//         Make sure you do not use this order ID for your custom skillbooks
//       * Ability generation can take a very long time (up to 10 min), be patient.
//         I also noticed it sometimes bugs if you alt-tab during generation.
//
//  CONVENTIONS:
//       * All rawcodes start with &#039;A8&#039;
//       * Binary bonus rawcodes start from zero  // &#039;A8L0&#039;, &#039;A8L1&#039;, &#039;A8L2&#039;, ...
//         Linear bonus rawcodes start from one   // &#039;A8e1&#039;, &#039;A8e2&#039;, &#039;A8e3&#039;, ...
//       * Binary bonuses use uppercase letter on 3-rd digit
//         Linear bonuses use lowercase letter on 3-rd digit
//         Spellbooks use uppercase letter on 3-rd digit (same as their linear bonus ability) &#039;A8e1&#039; -&gt; &#039;A8E1&#039;
//       
//  THANKS TO:
//       * PitzerMike - for making grimex
//
//  NOTE: 
//       * You should probably preload bonus abilities to prevent first cast lag
//  
//==============================================================================

//==============================================================================
//  BONUS Plugin: Life and Mana 
//==============================================================================
//  This trigger should be disabled by default
//==============================================================================
//  To generate bonus abilities:
//  Enable this trigger, save the map, close the map, open the map, disable this trigger
//==============================================================================

//---------------------------------&lt; LIFE &gt;-----------------------------------//
//! external ObjectMerger w3a AIl2 A8L0 anam &quot;Bonus Life&quot; Ilif 1 100   ansf &quot;(binary 0)&quot;
//! external ObjectMerger w3a AIl2 A8L1 anam &quot;Bonus Life&quot; Ilif 1 200   ansf &quot;(binary 1)&quot;
//! external ObjectMerger w3a AIl2 A8L2 anam &quot;Bonus Life&quot; Ilif 1 400   ansf &quot;(binary 2)&quot;
//! external ObjectMerger w3a AIl2 A8L3 anam &quot;Bonus Life&quot; Ilif 1 800   ansf &quot;(binary 3)&quot;
//! external ObjectMerger w3a AIl2 A8L4 anam &quot;Bonus Life&quot; Ilif 1 1600  ansf &quot;(binary 4)&quot;
//! external ObjectMerger w3a AIl2 A8L5 anam &quot;Bonus Life&quot; Ilif 1 3200  ansf &quot;(binary 5)&quot;
//! external ObjectMerger w3a AIl2 A8L6 anam &quot;Bonus Life&quot; Ilif 1 6400  ansf &quot;(binary 6)&quot;
//! external ObjectMerger w3a AIl2 A8L7 anam &quot;Bonus Life&quot; Ilif 1 12800 ansf &quot;(binary 7)&quot;

//---------------------------------&lt; MANA &gt;-----------------------------------//
//! external ObjectMerger w3a AImz A8M0 anam &quot;Bonus Mana&quot; Iman 1 100   ansf &quot;(binary 0)&quot;
//! external ObjectMerger w3a AImz A8M1 anam &quot;Bonus Mana&quot; Iman 1 200   ansf &quot;(binary 1)&quot;
//! external ObjectMerger w3a AImz A8M2 anam &quot;Bonus Mana&quot; Iman 1 400   ansf &quot;(binary 2)&quot;
//! external ObjectMerger w3a AImz A8M3 anam &quot;Bonus Mana&quot; Iman 1 800   ansf &quot;(binary 3)&quot;
//! external ObjectMerger w3a AImz A8M4 anam &quot;Bonus Mana&quot; Iman 1 1600  ansf &quot;(binary 4)&quot;
//! external ObjectMerger w3a AImz A8M5 anam &quot;Bonus Mana&quot; Iman 1 3200  ansf &quot;(binary 5)&quot;
//! external ObjectMerger w3a AImz A8M6 anam &quot;Bonus Mana&quot; Iman 1 6400  ansf &quot;(binary 6)&quot;
//! external ObjectMerger w3a AImz A8M7 anam &quot;Bonus Mana&quot; Iman 1 12800 ansf &quot;(binary 7)&quot;

//==============================================================================

//==============================================================================
//  BONUS Plugin: Armor and Damage
//==============================================================================
//  This trigger should be disabled by default
//==============================================================================
//  To generate bonus abilities:
//  Enable this trigger, save the map, close the map, open the map, disable this trigger
//==============================================================================

//---------------------------------&lt; ARMOR &gt;----------------------------------//
//! external ObjectMerger w3a AId2 A8D0 anam &quot;Bonus Armor&quot; Idef 1 1   ansf &quot;(binary 0)&quot;
//! external ObjectMerger w3a AId2 A8D1 anam &quot;Bonus Armor&quot; Idef 1 2   ansf &quot;(binary 1)&quot;
//! external ObjectMerger w3a AId2 A8D2 anam &quot;Bonus Armor&quot; Idef 1 4   ansf &quot;(binary 2)&quot;
//! external ObjectMerger w3a AId2 A8D3 anam &quot;Bonus Armor&quot; Idef 1 8   ansf &quot;(binary 3)&quot;
//! external ObjectMerger w3a AId2 A8D4 anam &quot;Bonus Armor&quot; Idef 1 16  ansf &quot;(binary 4)&quot;
//! external ObjectMerger w3a AId2 A8D5 anam &quot;Bonus Armor&quot; Idef 1 32  ansf &quot;(binary 5)&quot;
//! external ObjectMerger w3a AId2 A8D6 anam &quot;Bonus Armor&quot; Idef 1 64  ansf &quot;(binary 6)&quot;
//! external ObjectMerger w3a AId2 A8D7 anam &quot;Bonus Armor&quot; Idef 1 128 ansf &quot;(binary 7)&quot;

//---------------------------------&lt; DAMAGE &gt;---------------------------------//
//! external ObjectMerger w3a AItg A8T0 anam &quot;Bonus Damage&quot; Iatt 1 5   ansf &quot;(binary 0)&quot;
//! external ObjectMerger w3a AItg A8T1 anam &quot;Bonus Damage&quot; Iatt 1 10  ansf &quot;(binary 1)&quot;
//! external ObjectMerger w3a AItg A8T2 anam &quot;Bonus Damage&quot; Iatt 1 20  ansf &quot;(binary 2)&quot;
//! external ObjectMerger w3a AItg A8T3 anam &quot;Bonus Damage&quot; Iatt 1 40  ansf &quot;(binary 3)&quot;
//! external ObjectMerger w3a AItg A8T4 anam &quot;Bonus Damage&quot; Iatt 1 80  ansf &quot;(binary 4)&quot;
//! external ObjectMerger w3a AItg A8T5 anam &quot;Bonus Damage&quot; Iatt 1 160 ansf &quot;(binary 5)&quot;
//! external ObjectMerger w3a AItg A8T6 anam &quot;Bonus Damage&quot; Iatt 1 320 ansf &quot;(binary 6)&quot;
//! external ObjectMerger w3a AItg A8T7 anam &quot;Bonus Damage&quot; Iatt 1 640 ansf &quot;(binary 7)&quot;

//==============================================================================

//==============================================================================
//  BONUS Plugin: Strength, Agility and Intelligence
//==============================================================================
//  This trigger should be disabled by default
//==============================================================================
//  To generate bonus abilities:
//  Enable this trigger, save the map, close the map, open the map, disable this trigger
//==============================================================================

//---------------------------------&lt; STR &gt;-----------------------------------//
//! external ObjectMerger w3a AIs1 A8S0 anam &quot;Bonus Strength&quot; Istr 1 1   ansf &quot;(binary 0)&quot;
//! external ObjectMerger w3a AIs1 A8S1 anam &quot;Bonus Strength&quot; Istr 1 2   ansf &quot;(binary 1)&quot;
//! external ObjectMerger w3a AIs1 A8S2 anam &quot;Bonus Strength&quot; Istr 1 4   ansf &quot;(binary 2)&quot;
//! external ObjectMerger w3a AIs1 A8S3 anam &quot;Bonus Strength&quot; Istr 1 8   ansf &quot;(binary 3)&quot;
//! external ObjectMerger w3a AIs1 A8S4 anam &quot;Bonus Strength&quot; Istr 1 16  ansf &quot;(binary 4)&quot;
//! external ObjectMerger w3a AIs1 A8S5 anam &quot;Bonus Strength&quot; Istr 1 32  ansf &quot;(binary 5)&quot;
//! external ObjectMerger w3a AIs1 A8S6 anam &quot;Bonus Strength&quot; Istr 1 64  ansf &quot;(binary 6)&quot;
//! external ObjectMerger w3a AIs1 A8S7 anam &quot;Bonus Strength&quot; Istr 1 128 ansf &quot;(binary 7)&quot;

//---------------------------------&lt; AGI &gt;-----------------------------------//
//! external ObjectMerger w3a AIa1 A8A0 anam &quot;Bonus Agility&quot; Iagi 1 1   ansf &quot;(binary 0)&quot;
//! external ObjectMerger w3a AIa1 A8A1 anam &quot;Bonus Agility&quot; Iagi 1 2   ansf &quot;(binary 1)&quot;
//! external ObjectMerger w3a AIa1 A8A2 anam &quot;Bonus Agility&quot; Iagi 1 4   ansf &quot;(binary 2)&quot;
//! external ObjectMerger w3a AIa1 A8A3 anam &quot;Bonus Agility&quot; Iagi 1 8   ansf &quot;(binary 3)&quot;
//! external ObjectMerger w3a AIa1 A8A4 anam &quot;Bonus Agility&quot; Iagi 1 16  ansf &quot;(binary 4)&quot;
//! external ObjectMerger w3a AIa1 A8A5 anam &quot;Bonus Agility&quot; Iagi 1 32  ansf &quot;(binary 5)&quot;
//! external ObjectMerger w3a AIa1 A8A6 anam &quot;Bonus Agility&quot; Iagi 1 64  ansf &quot;(binary 6)&quot;
//! external ObjectMerger w3a AIa1 A8A7 anam &quot;Bonus Agility&quot; Iagi 1 128 ansf &quot;(binary 7)&quot;

//---------------------------------&lt; INT &gt;-----------------------------------//
//! external ObjectMerger w3a AIi1 A8I0 anam &quot;Bonus Intelligence&quot; Iint 1 1   ansf &quot;(binary 0)&quot;
//! external ObjectMerger w3a AIi1 A8I1 anam &quot;Bonus Intelligence&quot; Iint 1 2   ansf &quot;(binary 1)&quot;
//! external ObjectMerger w3a AIi1 A8I2 anam &quot;Bonus Intelligence&quot; Iint 1 4   ansf &quot;(binary 2)&quot;
//! external ObjectMerger w3a AIi1 A8I3 anam &quot;Bonus Intelligence&quot; Iint 1 8   ansf &quot;(binary 3)&quot;
//! external ObjectMerger w3a AIi1 A8I4 anam &quot;Bonus Intelligence&quot; Iint 1 16  ansf &quot;(binary 4)&quot;
//! external ObjectMerger w3a AIi1 A8I5 anam &quot;Bonus Intelligence&quot; Iint 1 32  ansf &quot;(binary 5)&quot;
//! external ObjectMerger w3a AIi1 A8I6 anam &quot;Bonus Intelligence&quot; Iint 1 64  ansf &quot;(binary 6)&quot;
//! external ObjectMerger w3a AIi1 A8I7 anam &quot;Bonus Intelligence&quot; Iint 1 128 ansf &quot;(binary 7)&quot;

//==============================================================================

//==============================================================================
//  BONUS Plugin: Attack and Move Speed
//==============================================================================
//  This trigger should be disabled by default
//==============================================================================
//  To generate bonus abilities:
//  Enable this trigger, save the map, close the map, open the map, disable this trigger
//==============================================================================

//---------------------------------&lt; ATTS &gt;----------------------------------//
//! external ObjectMerger w3a AIsx A8H0 anam &quot;Bonus Attack Speed&quot; Isx1 1 0.05 ansf &quot;(binary 0)&quot;
//! external ObjectMerger w3a AIsx A8H1 anam &quot;Bonus Attack Speed&quot; Isx1 1 0.10 ansf &quot;(binary 1)&quot;
//! external ObjectMerger w3a AIsx A8H2 anam &quot;Bonus Attack Speed&quot; Isx1 1 0.20 ansf &quot;(binary 2)&quot;
//! external ObjectMerger w3a AIsx A8H3 anam &quot;Bonus Attack Speed&quot; Isx1 1 0.40 ansf &quot;(binary 3)&quot;
//! external ObjectMerger w3a AIsx A8H4 anam &quot;Bonus Attack Speed&quot; Isx1 1 0.80 ansf &quot;(binary 4)&quot;
//! external ObjectMerger w3a AIsx A8H5 anam &quot;Bonus Attack Speed&quot; Isx1 1 1.60 ansf &quot;(binary 5)&quot;
//! external ObjectMerger w3a AIsx A8H6 anam &quot;Bonus Attack Speed&quot; Isx1 1 3.20 ansf &quot;(binary 6)&quot;

//---------------------------------&lt; MOVE &gt;----------------------------------//
//! external ObjectMerger w3a AIms A8P1 anam &quot;Bonus Move Speed&quot; Imvb 1 10  ansf &quot;(linear 1)&quot;
//! external ObjectMerger w3a AIms A8P2 anam &quot;Bonus Move Speed&quot; Imvb 1 20  ansf &quot;(linear 2)&quot;
//! external ObjectMerger w3a AIms A8P3 anam &quot;Bonus Move Speed&quot; Imvb 1 30  ansf &quot;(linear 3)&quot;
//! external ObjectMerger w3a AIms A8P4 anam &quot;Bonus Move Speed&quot; Imvb 1 40  ansf &quot;(linear 4)&quot;
//! external ObjectMerger w3a AIms A8P5 anam &quot;Bonus Move Speed&quot; Imvb 1 50  ansf &quot;(linear 5)&quot;
//! external ObjectMerger w3a AIms A8P6 anam &quot;Bonus Move Speed&quot; Imvb 1 60  ansf &quot;(linear 6)&quot;
//! external ObjectMerger w3a AIms A8P7 anam &quot;Bonus Move Speed&quot; Imvb 1 70  ansf &quot;(linear 7)&quot;
//! external ObjectMerger w3a AIms A8P8 anam &quot;Bonus Move Speed&quot; Imvb 1 80  ansf &quot;(linear 8)&quot;
//! external ObjectMerger w3a AIms A8P9 anam &quot;Bonus Move Speed&quot; Imvb 1 90  ansf &quot;(linear 9)&quot;
//! external ObjectMerger w3a AIms A8P: anam &quot;Bonus Move Speed&quot; Imvb 1 100 ansf &quot;(linear <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile    :)" loading="lazy" data-shortname=":)" />&quot;

//==============================================================================

//==============================================================================
//  BONUS Plugin: Evasion and Critical
//==============================================================================
//  This trigger should be disabled by default
//==============================================================================
//  To generate bonus abilities:
//  Enable this trigger, save the map, close the map, open the map, disable this trigger
//==============================================================================

//---------------------------------&lt; EVASION &gt;-------------------------------//
//! external ObjectMerger w3a AIev A8e1 anam &quot;Bonus Evasion&quot; Eev1 1 0.05 ansf &quot;(linear 1)&quot;
//! external ObjectMerger w3a AIev A8e2 anam &quot;Bonus Evasion&quot; Eev1 1 0.10 ansf &quot;(linear 2)&quot;
//! external ObjectMerger w3a AIev A8e3 anam &quot;Bonus Evasion&quot; Eev1 1 0.15 ansf &quot;(linear 3)&quot;
//! external ObjectMerger w3a AIev A8e4 anam &quot;Bonus Evasion&quot; Eev1 1 0.20 ansf &quot;(linear 4)&quot;
//! external ObjectMerger w3a AIev A8e5 anam &quot;Bonus Evasion&quot; Eev1 1 0.25 ansf &quot;(linear 5)&quot;
//! external ObjectMerger w3a AIev A8e6 anam &quot;Bonus Evasion&quot; Eev1 1 0.30 ansf &quot;(linear 6)&quot;
//! external ObjectMerger w3a AIev A8e7 anam &quot;Bonus Evasion&quot; Eev1 1 0.35 ansf &quot;(linear 7)&quot;
//! external ObjectMerger w3a AIev A8e8 anam &quot;Bonus Evasion&quot; Eev1 1 0.40 ansf &quot;(linear 8)&quot;
//-- spellbook
//! external ObjectMerger w3a Aspb A8E1 anam &quot;Bonus Evasion&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8e1 ansf &quot;(spellbook 1)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNEvasion.blp&quot;
//! external ObjectMerger w3a Aspb A8E2 anam &quot;Bonus Evasion&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8e2 ansf &quot;(spellbook 2)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNEvasion.blp&quot;
//! external ObjectMerger w3a Aspb A8E3 anam &quot;Bonus Evasion&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8e3 ansf &quot;(spellbook 3)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNEvasion.blp&quot;
//! external ObjectMerger w3a Aspb A8E4 anam &quot;Bonus Evasion&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8e4 ansf &quot;(spellbook 4)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNEvasion.blp&quot;
//! external ObjectMerger w3a Aspb A8E5 anam &quot;Bonus Evasion&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8e5 ansf &quot;(spellbook 5)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNEvasion.blp&quot;
//! external ObjectMerger w3a Aspb A8E6 anam &quot;Bonus Evasion&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8e6 ansf &quot;(spellbook 6)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNEvasion.blp&quot;
//! external ObjectMerger w3a Aspb A8E7 anam &quot;Bonus Evasion&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8e7 ansf &quot;(spellbook 7)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNEvasion.blp&quot;
//! external ObjectMerger w3a Aspb A8E8 anam &quot;Bonus Evasion&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8e8 ansf &quot;(spellbook 8)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNEvasion.blp&quot;

//---------------------------------&lt; CRITICAL &gt;-------------------------------//
//! external ObjectMerger w3a AIcs A8c1 anam &quot;Bonus Critical&quot; Ocr1 1 5  ansf &quot;(linear 1)&quot;
//! external ObjectMerger w3a AIcs A8c2 anam &quot;Bonus Critical&quot; Ocr1 1 10 ansf &quot;(linear 2)&quot;
//! external ObjectMerger w3a AIcs A8c3 anam &quot;Bonus Critical&quot; Ocr1 1 15 ansf &quot;(linear 3)&quot;
//! external ObjectMerger w3a AIcs A8c4 anam &quot;Bonus Critical&quot; Ocr1 1 20 ansf &quot;(linear 4)&quot;
//! external ObjectMerger w3a AIcs A8c5 anam &quot;Bonus Critical&quot; Ocr1 1 25 ansf &quot;(linear 5)&quot;
//! external ObjectMerger w3a AIcs A8c6 anam &quot;Bonus Critical&quot; Ocr1 1 30 ansf &quot;(linear 6)&quot;
//! external ObjectMerger w3a AIcs A8c7 anam &quot;Bonus Critical&quot; Ocr1 1 35 ansf &quot;(linear 7)&quot;
//! external ObjectMerger w3a AIcs A8c8 anam &quot;Bonus Critical&quot; Ocr1 1 40 ansf &quot;(linear 8)&quot;
//-- spellbook
//! external ObjectMerger w3a Aspb A8C1 anam &quot;Bonus Critical&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8c1 ansf &quot;(spellbook 1)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp&quot;
//! external ObjectMerger w3a Aspb A8C2 anam &quot;Bonus Critical&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8c2 ansf &quot;(spellbook 2)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp&quot;
//! external ObjectMerger w3a Aspb A8C3 anam &quot;Bonus Critical&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8c3 ansf &quot;(spellbook 3)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp&quot;
//! external ObjectMerger w3a Aspb A8C4 anam &quot;Bonus Critical&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8c4 ansf &quot;(spellbook 4)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp&quot;
//! external ObjectMerger w3a Aspb A8C5 anam &quot;Bonus Critical&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8c5 ansf &quot;(spellbook 5)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp&quot;
//! external ObjectMerger w3a Aspb A8C6 anam &quot;Bonus Critical&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8c6 ansf &quot;(spellbook 6)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp&quot;
//! external ObjectMerger w3a Aspb A8C7 anam &quot;Bonus Critical&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8c7 ansf &quot;(spellbook 7)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp&quot;
//! external ObjectMerger w3a Aspb A8C8 anam &quot;Bonus Critical&quot; spb5 1 &quot;attributemodskill&quot; spb4 1 1 spb3 1 1 spb2 1 True spb1 1 A8c8 ansf &quot;(spellbook 8)&quot; aart &quot;ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp&quot;

//==============================================================================


the example on top of this script shows you how to give bonus evasion and such...
i believe you can use negative values to remove the bonuses after the spell is over...
 

chokladgris

New Member
Reaction score
0
Thank you!

I am really new to JASS, but all that text seems like alot of commands? do i just copy all the text? the green aswell?
 

jig7c

Stop reading me...-statement
Reaction score
123
the green is just the information, the black/blue/gray is the actual code
copy the entire thing, word for word into an an empty trigger...

example!
you want to increase a unit's evasion rate from 5% to 20%

you would want to do this
copy both scripts into a separate converted to custom text script
Bonus Plugin-
Enable this trigger, save the map, close the map, open the map, disable this trigger
then make a new trigger for your spell
event
a unit starts the effect of an ability
condition - ability being cast equal to you <your spell>
actions
custom script: set Bonus_Evasion[GetTriggerUnit()] = 4

that will set the spell casting unit's evasion to 20%
unfortunately, as stated in the script, you cannot put negative values in it, meaning you cannot decrease it.. :(
 

tommerbob

Minecraft. :D
Reaction score
110
Another simpler way of doing it is simply using a spell book with multiple levels of evasion in it. When you cast the spell, increase the evasion levels to X, and then after the duration, reduce those levels again.
 

chokladgris

New Member
Reaction score
0
Jig7c:

Well thanks for the help, but that only puts me back to where i was using triggers, only this is a better way to do it:)

So the evasion effects wont dissapear even when the trigger is destroyed?

Edit: tommerbob:

Okey, im new to this with spellbooks, but i'll check the tutorials!:) thank you
 

jig7c

Stop reading me...-statement
Reaction score
123
no, unfortunately the evasion won't disappear.. but i've seen systems similar to those, where you can put negative values in it, and brings it back down to whatever % you chose it to be... i think its on hiveworkshop.com..

for spell book, you have to give that unit the spell book ability, and then i think remove or disable it, so the passive abilities in it will still work, without the spell book icon showing up

or you can make your evasion into like 5 item abilities, each with different level of evasion..

and then you can add/remove the item abilities to your hero accordingly, and the ability icon won't show up, but the hero will benefit from the evasion..
 

chokladgris

New Member
Reaction score
0
okey, think im just gonna screw this idea lol and go for increased armor instead. I couldnt find any trigger that could increase armor, but i think it should work using inner fire, but that ability has an autocast function. Is it possible to remove the autocast?
 

jig7c

Stop reading me...-statement
Reaction score
123
no, you cannot remove autocast function, but you can make it so 1 autocast will cost 5 mana, and give your dummy unit only 5 mana... that way it'll only cast once :)
 

chokladgris

New Member
Reaction score
0
yea well i just wanted to remove the ability to choose it to autocast, fells kinda wrong with autoccast since the ability is an ultimate hehe :p well guess ill have to come up with something else! thanks you guys! :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top