Problem setting ability levels from percentage.

Marvic June B. Corpuz

You can change this now in User CP.
Reaction score
1
Hello again helpers. I have a little trouble on my trigger on how to set the ability for a unit from the percentage of it's attribute. Say for example; My hero has an ability that gives bonus damage to allied units in the entire map, but a dummy has the real ability that grants it to its allies. I want that the bonus damage the allied units gain from the aura is base on 50% of the hero's attribute. And the ability carried by the dummy increases in level base on the calculation from 50% of the hero's attribute. The ability carried by the dummy is base on the Trueshot Aura. I've been trying to set this in my trigger but I could not continue. How do you calculate and set this anyway? I am really confused now.
 

Wardonis

Cool Member
Reaction score
0
here with this you don't even need a dummy. one trigger can do it all

bonusdmgvar is an integer variable

Untitled Trigger 001
*Events
-Unit - A unit Is attacked
*Conditions
-(Owner of (Attacking unit)) Equal to Player 1 (Red)
*Actions
-Set bonusdmgvar = (Intelligence of Archmage 0000 <gen> (Include bonuses))
-Set bonusdmgvar = (bonusdmgvar / 2)
-Unit - Cause (Attacking unit) to damage (Attacked unit), dealing (Real(bonusdmgvar)) damage of attack type Magic and damage type Normal
 

Maelbog

Member
Reaction score
3
You'll need a True shot aura with enough levels and a periodic trigger that
updates the level of the dummy aura based from the attribute of your hero
and checks when your hero is alive or not.

A unit is attacked event has some flaws such as dealing damage regardless if the attack is successful or not.
Also the aura damage benefits from critical strikes.

Perhaps something like this..

Code:
Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set TrueshotDummy[1] = TrueshotDummyforPlayer1 0027 <gen>
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                Unit - Hide TrueshotDummy[(Integer A)]

Code:
Trueshot Learn
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to Trueshot Aura
    Actions
        Set TrueshotGiver[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)

Code:
Trueshot Aura
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (TrueshotGiver[(Integer A)] is alive) Equal to True
                    Then - Actions
                        Unit - Unhide TrueshotDummy[(Integer A)]
                        Set BonusDamage[(Integer A)] = ((Agility of TrueshotGiver[(Integer A)] (Include bonuses)) / 2)
                        Unit - Set level of Trueshot Aura for TrueshotDummy[(Integer A)] to BonusDamage[(Integer A)]
                    Else - Actions
                        Unit - Hide TrueshotDummy[(Integer A)]
 
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